Skip to content

Latest commit

 

History

History
74 lines (67 loc) · 1.16 KB

README.md

File metadata and controls

74 lines (67 loc) · 1.16 KB

Pod Interpreter

Written in Go!

Example:

let a = 10;
let b = 12;
if a == 10 {
    print a;
}else if b == 12 {
    print a+b;
}else {
    print 0;
}

Prerequsites

  • go (>=1.22.2)

Build

make build
# Wasm
make build-wasm

Usage

Native Executable can be found in ./bin

./bin/podinterpreter {arguments} {.pod file}`

Arguments

  • tokenize
  • parse (parse expression)
  • evaluate (evaluate expression)
  • run (run program)

Web server starts at localhost:8080. Web interpreter files can be found in ./bin/wasm

# Wasm (server at localhost:8080)
make run-wasm

To-Do

  • Tokenizer
  • Parser
  • Expression Evaluator
  • Variable
  • Print
  • If statement
  • While loop
  • For loop
  • Functions
  • Return
  • File read/write
  • Stdin
  • Stdlib

References

Operators

+, -, *, /, ^, %, ==, !=, >, >=, <, <=, &&, ||

Function

func, return

Initialize

let

If and loops

if, else, for, while

Data types

string, number, true/false

Other

;, (, ), {, }