lox-lang-crystal
Version, currently dev branch1 version
- dev branchlatestJul 14, 2023
github.com/HuyNguyenAu/lox-lang-crystal
A Crystal implementation of Lox from Crafting Interpreters.
Installation
# Add this to your shard.yml
dependencies:
lox-lang-crystal:
github: HuyNguyenAu/lox-lang-crystal
branch: devdev is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.1.1- License
- MIT
- Author
- HuyNguyenAu
- Target
lox-lang-crystalfrom src/main.cr
Dependencies
This version declares no dependencies.
README
Crystal Lox
A Crystal implementation of Lox from Crafting Interpreters from Chapter 1 to 13 with the goal of matching the behaviour to be as close as possible to the original Java implementation.
Running a simple Fibonacci Sequence program gives the following:

Requirements
- Crystal 1.6.2
- Python 3.10.8
Setup
Set the permissions of the run and test script:
$ sudo chmod +x ./run.sh
$ sudo chmod +x ./test.sh
Usage
Create a hello_world.lox file:
print "Hello World!"
Run the script:
$ ./run.sh hello_world.lox
Dependencies are satisfied
Building: lox-lang-crystal
Hello World!
Testing
Run the following command:
$ ./test.sh chap13_inheritance
Why?
I've implemented this in C#, but that language was too similar to Java. It means that I couldn't fully understand the fundermentals of language design. My thought was if I used an unfamilar programming language, then I first must understand what the material is explaining and how it works, then I can implement it. For some reason, I thought this would also be a good chance to learn Crystal.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
dev- Seen
- Jul 14, 2023
- Crystal
1.1.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/HuyNguyenAu/lox-lang-crystal
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 1