🔲 Mirror 🔳 - My Other Programming Language!


I made another language. It's called Mirror.

It's statically typed and riddled with bugs. It's coded using Rust and transpiles down to C++.

I only had like 10 hours to make this so it isn't much. And this is also my first time coding in Rust so the code is really bad.

I'll probably revisit this sometime in the future though.

Check out its GitHub repo!

Here's Mirror's syntax.

Mirror has a built in print function that acts as standard output.

Variables are created using the set keyword. Their type is automagically deduced.

Conditionals are as expected.

Functions are defined using the def keyword.

Ranged based for loops are also supported.

And arrays.

And that's it!

Write code in the source.mir file. Here's some code to reverse your name. Try it out!

Enjoy :)

You are viewing a single comment. View All

How do you disambiguate between the condition and body of if statements?

Are brackets optional in if statements?
If not, you would have to change your example:


To keep it more consistent in its rules ^.

To remedy this, I suggest introducing an keyword that combines both, the if and the else keywords. I call it elif.

You could use it like so:


@xxpertHacker Yeah, I was definitely thinking of an elif to keep it simpler. But it separates condition from body by the curly braces.


@xxpertHacker Oh quick question, how do you initialize a shared_ptr with NULL? Does the default constructor initialize it will NULL?


@DynamicSquid Why would you want to initialize a shared_ptr with null? That sounds... counterintuitive?


@DynamicSquid Just tried it in a Repl, this works fine:


@DynamicSquid Sorry for the third ping to your question, but they're null by default.

Unless you need the literal C macro NULL, which is an integer, not a pointer.