Discuss Scratch

What_do_we_do_now
Scratcher
500+ posts

Sharp - A new programming language, made in Scratch!



Sharp - A Programming Language


Sharp is a programming language made by me that is designed to be simple and easy to use. Its main use will be for the upcoming Scratch version of SharpOS, which will be made using the Sharp compiler.

Note: The following section contains some intermediate topics on how the language works. Skip it if you like.
The way Sharp works is first, you enter your code, either through the in-project prompts, or by writing the code in a .txt file, and importing the code to a list. The Sharp compiler will then take that code, break it into pieces, and create bits of code that the executer can then run. The code bits are made in the form of a command, a colon, then some arguments for that command. For example, this code:
print "Hello world!"
will be converted by the compiler into this code:
printStr:"Hello world!"
After that, the executer will take those “cmd:args” pairs and will split them apart, then loop through each line in the compiled code, and execute it.
The intermediate topic section on how the language works is over. Continue reading.
As of 2/16/2023, Sharp is in v3 Beta, with a lot more features planned soon!

Features:
  • Print statement
  • Variables
  • Persistent variables
  • User input
  • Special variables ( special:: )
  • Comments (%)
  • Errors (v3)
  • Graphics support (v3)

Syntax and Commands:
Print:
print "some text"
print a_variable
print 10

Input (v2):
input "some text"
print special::answer

Variables:
var name "What_do_we_do_now"
var year 2023

Persistent variables:
var persist::name "What_do_we_do_now"
Persistent variables do not get deleted each time the code gets compiled.

Graphics:
graphics.move(10)
% move ( ) steps
graphics.x
% x position
graphics.y
% y position
graphics.goto(0, 0)
% goto x: ( ) y: ( )
graphics.show()
% show
graphics.hide()
% hide

Changelog:
Note: Dates are formatted as MM/DD/YYYY

v1 (02/15/2023) - First version. Includes print statement and variables/persistent variables.
v2 (02/16/2023) - Second version. Includes input statement and special variables.
v3 (not released) - Third version. Includes errors (carryover from v2), and various graphics-related things.

Your Ideas
Have an idea to add? Let me know below, and I'll do my best to add it!

Beta Versions
To access beta versions, you must pay me 15BB (BlockBit), then let me know, and I'll allow beta versions for you.

Sharp (C) 2023 by What_do_we_do_now, all rights reserved.

Last edited by What_do_we_do_now (Feb. 17, 2023 03:22:24)

INSERT-USER_NAME
Scratcher
1000+ posts

Sharp - A new programming language, made in Scratch!

The project doesn't exist.
What_do_we_do_now
Scratcher
500+ posts

Sharp - A new programming language, made in Scratch!

INSERT-USER_NAME wrote:

(#2)
The project doesn't exist.
Try this one: https://scratch.mit.edu/projects/804870475/
INSERT-USER_NAME
Scratcher
1000+ posts

Sharp - A new programming language, made in Scratch!

What_do_we_do_now wrote:

INSERT-USER_NAME wrote:

(#2)
The project doesn't exist.
Try this one: https://scratch.mit.edu/projects/804870475/
The link works.

This is quite cool, I don't really ever see programming languages being made in Scratch.
NightmareGaze
Scratcher
100+ posts

Sharp - A new programming language, made in Scratch!

Wouldn't it be significantly easier to learn Python instead? There are many great tutorials and courses. On top of that, Python is relatively simple compared with other programming languages.

Last edited by NightmareGaze (Feb. 16, 2023 08:49:56)

What_do_we_do_now
Scratcher
500+ posts

Sharp - A new programming language, made in Scratch!

NightmareGaze wrote:

(#5)
Wouldn't it be significantly easier to learn Python instead? There are many great tutorials and courses. On top of that, Python is relatively simple compared with other programming languages.
Yeah, I made a version in Python, but that's for the Python version of SharpOS, and the way it works I can't remake in Scratch, so the languages are completely different.
What_do_we_do_now
Scratcher
500+ posts

Sharp - A new programming language, made in Scratch!

Updated OP, image now links to a studio for Sharp projects.
What_do_we_do_now
Scratcher
500+ posts

Sharp - A new programming language, made in Scratch!

car go bump
What_do_we_do_now
Scratcher
500+ posts

Sharp - A new programming language, made in Scratch!

bump
TheCommCraft
Scratcher
500+ posts

Sharp - A new programming language, made in Scratch!

I'd recommend you do loops and conditional statements or just jump instructions
medians
Scratcher
1000+ posts

Sharp - A new programming language, made in Scratch!

oh for a second I thought someone was trying to recreate an old topic because of the name LOL
Is there just no direction blocks or something, or is that just in v3?

Powered by DjangoBB