Hitung is a very simple toy programming language for calculation.
Mostly for Indonesian who want to learn how programming language works. You can read the tutorial for this on my blog here in Bahasa Indonesia
- https://aldidana.com/membuat-bahasa-pemrograman-rust-llvm-lexer/
- https://aldidana.com/membuat-bahasa-pemrograman-rust-llvm-parser/
- https://aldidana.com/membuat-bahasa-pemrograman-rust-llvm-jit-compiler/
- Lexical Analysis
- Parsing
- JIT (just in time) compiler with LLVM
example:
- Variable assignment
a = 8
b = a + 2 * 3
this will print 14
- As calculator
2 + 5 * 3 / 3 * 7 - 10
this will evaluate to 2 + (((5 * 3) / 3) * 7 ) - 10
and this will print 27
for the result
- Conditional (only support 1 level)
if 1 > 2 then 1 else 0
this will print 0
MIT @Aldi Priya Perdana