Disclaimer: This language was not intended to be used for anything other than a learning experience and a bit of fun. In it's current form, do not use it for anything other than that.
STAKZ is a stack-based language with enforced types, created for use on the Apple M1 Processor.
First, you'll need to be using a variant of the Apple M1 chip. If you're not, unfortunately, you can't run the compiled binary. If you are on a variant of the M1, congrats, you can continue!
Step 1
Create a file, e.g test.stx
. Write some stakz code inside of it (check out the /examples
dir for some basic examples).
Step 2
Run make
to create an executable of the compiler.
$ make
Step 3 Once the compiler has been made, run it:
$ ./a <path-to-file>
Step 4 The previous step will have generated the assembly for your fantastic program. Now all you need to do is build it and you'll be able to run it!
$ make build
Step 5 (The best one) Run your program!
$ ./stakz
Example
"Hello, World!" out
Further examples can be found in the /examples
dir
- Create Lexer
- Create Parser
- Generate Assembly from Parser
- Optimise the Compiler
- Add more features (highest priority being modification of stack variables and the ability to
pop
elements from the stack)
References used for making the Compiler
For helping decide how to implement the Parser