Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 921 Bytes

README.md

File metadata and controls

41 lines (31 loc) · 921 Bytes

Hitung

Hitung is a very simple toy programming language for calculation.

Motivation

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

  1. https://aldidana.com/membuat-bahasa-pemrograman-rust-llvm-lexer/
  2. https://aldidana.com/membuat-bahasa-pemrograman-rust-llvm-parser/
  3. https://aldidana.com/membuat-bahasa-pemrograman-rust-llvm-jit-compiler/

Process

  1. Lexical Analysis
  2. Parsing
  3. JIT (just in time) compiler with LLVM

What this language can do

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

License

MIT @Aldi Priya Perdana