Skip to content

Hitung is a very simple toy programming language for calculation

Notifications You must be signed in to change notification settings

aldidana/hitung

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Hitung is a very simple toy programming language for calculation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages