So I've created a "compiled" language (Halppp) so I wanted to see if I could use it to create an interpreted language.
Using the previous knowledge of building the compiler, for the language I'm now building the interpreter in, helped a lot since I know what parts I needed to parse the input. Since the compiler is self compiled it's also easy to reuse design parts from it.
I started Saturday and got it in a working state Today(Sunday). Still a lot of features missing but usable for something minor.
let a = "Hello"
let b = "World"
b = b + "!"
print RED + a + " " + b + "!" + RESET
filer "ver.txt" version
tonum version
print GREEN + "Version: " + RESET + version 
print "Update version? " + YELLOW + "(y/n)" + RESET
printnobr RED + "> " + RESET
read input
if input == "y"
    | version = version + 0.1
    | print GREEN + "Updated version to: " + RESET + version
    | filew "ver.txt" version
exit

Features
- assign variables
- concat strings
- mathematical operation
- conditional branching
- colored printing
- reassign variables
- read/write files
- syscalls
- functions
- loops
- lists
- input arguments
The syntax design
I wanted a simple design with no fancy stuff
- single line statments
- not identation dependent
 
     
                                
Comments (0)