Skip to content

hopeless-programmer-online/l0

Repository files navigation

l0

example workflow

Small programming language.

Quick start

  • Install prerequisites.
  • Install l0 package with npm install https://github.com/hopeless-programmer-online/l0.git#refactoring3.
  • Interpret the desired .l0 file with npx l0 file.l0.

Code samples

; hello world
print("Hello, World!")

Logic

x : not(true) print(x)
x : and(true, false) print(x)
x : or(true, false) print(x)
then() { print("then") }
if (true, then)
x : type(true) print(x)

Numbers

x : +(5,2) print(x)
x : -(5,2) print(x)
x : *(5,2) print(x)
x : /(5,2) print(x)
x : >(5,2) print(x)
x : >=(5,2) print(x)
x : <(5,2) print(x)
x : <=(5,2) print(x)
x : type(5) print(x)

Strings

x : length("text") print(x)
x : +("a", "b") print(x)
x : type("text") print(x)

Variables

v : var(5) print(v)
=(v, 10) print(v)
x : type(v) print(x)

Lists

l : List() print(l)
push_front(l, 1) print(l)
push_back(l, 2) print(l)
pop_front(l) print(l)
pop_back(l) print(l)
x : type(l) print(x)

Prerequisites

About

Small programming language

Resources

License

Stars

Watchers

Forks

Packages

No packages published