Skip to content
/ s2lox Public

Simple interpreted toy language, based on the lox language.

License

Notifications You must be signed in to change notification settings

thmtvz/s2lox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

s2lox (started life as lox)

s2lox is a small toy language based on the lox language with some flavour of mine on top of it.

Currently on development.

Getting it

git clone https://github.com/thmtvz/s2lox && cd s2lox
make all
./build/jS2lox resources/examples/hello.lx 
./build/tsS2lox resources/examples/hello.lx 

Depends on:

  • jar
  • npm
  • tsc
  • make
  • java
  • javac
  • nodejs
  • coreutils
git clone https://github.com/thmtvz/s2lox && cd s2lox
make java
./build/jS2lox resources/examples/hello.lx #😄
./build/tsS2lox resources/examples/hello.lx 

=======

Examples

  • The most important program ever:
print "Hello, world!"; //Hello, world!
  • Recursive fibonacci:
fun fib(n){
	if(n < 2) return n;
	return fib(n - 1) + fib(n - 2);
}

var result = fib(12);

print result; //144

About

Simple interpreted toy language, based on the lox language.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published