+
Skip to content

corani/olox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Olox

The Lox interpreter in Odin.

The repo for the "Crafting Interpreters" book can be found here: https://github.com/munificent/craftinginterpreters

Disclaimer: I started on this knowing absolutely nothing about Odin and am using this project as a way to get to know the language. The implementation therefor is definitely not idiomatic Odin, and probably very inefficient and "ugly".

If you're an Odin expert, feel free to point out what could be done better!

Setup

Make sure you have llvm and clang installed. I had to do the following to get it to work properly:

$ sudo apt install llvm-11 clang-11
$ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100
$ sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-11 100

Install Odin from source:

$ git clone https://github.com/odin-lang/Odin
$ cd Odin
$ make

Make sure to add the Odin folder to your path (or symlink the Odin executable from a location in your path).

Compile and run

$ ./build.sh 
$ bin/olox examples/fix.lox

TODO

Look at subtype polymorphism and vtables

About

Lox in Odin

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载