Share your repls and programming experiences

← Back to all posts
Asteroid
JacobMcPherson1

Welcome to Asteroid!

Asteroid is my small programming language that I've made.

Output:

  • println("Hello, World!");

    • Prints "Hello, World!" with a newline
  • print("Hello, World!");

    • Prints "Hello, World!" without a newline

Comments:

  • % "This is a comment" %

There is only support for single line comments. Sorry!

Variables:

  • Int vars:
    • let ten = 10;
    • var five = 5;
  • String vars:
    • let first_name = "Jacob";
    • var last_name = " McPherson";

'let' and 'var' literally do the same thing lol, I don't even know why I added 'let' tbh.

Basic math:

  • Add with +
  • Subtract with -
  • Multiply with *
  • Divide with /

There's also support for String Concatenation.

To run your file, change the last line in main.py to => parse("your_file.bld.go")

p.s. If you make the file extension .bld it will still run, but you won't have syntax highlighting.
Voters
ruiwenge2
JacobMcPherson1
Comments
hotnewtop
ruiwenge2

Cool!

JacobMcPherson1

@ruiwenge2 Thank you!

ruiwenge2

You’re welcome @JacobMcPherson1

ruiwenge2

@JacobMcPherson1 btw how did you do the syntax highlighting?

JacobMcPherson1

@ruiwenge2 the language is similar to go, so I added .go to the file extension

ruiwenge2

@JacobMcPherson1 ohhh... thanks!

JacobMcPherson1