I wrote my first lanugage programming lanugage (compiler) so I could learn Rust.
The language is named plank.
If you’d like to use this wonderful language, feel free.
/! Here's an example Plank program.
/! It prints hello 25 times; then plank afterwards.
Number i: 0
while i < 25 then
print "hello, "
update i <= i + 1
endWhile
print "plank"
./compile.sh --setup
Further info is found in the github readme.
/! Here's how you comment your code.
/! Declaring a variable.
Number num: 14
Number another: 1
/! Assigning to a variable.
update num <= 26
/! If conditional branch
if num > another then
/! Here's how to print to console.
print "wow! num is greater than that other variable"
endIf
/! Here's an example while loop
while num >= another do
update another <= another + 1
if num > another then
print "still smaller"
endIf
endWhile
print "now greater!"
Would like to further research how programming languages work and create some sort of guide or resource for people that they could start from.
But as is, there are still things missing here I’d like to work on. For example, this doesn’t even use an AST (Abstract Syntax Tree) when parsing, it basically parses/validates/emits to c code all in the same file, so error messages are basically non-existant.