https://github.com/itsrainingmani/lox
Lox programming language
https://github.com/itsrainingmani/lox
c interpreter java programming-language
Last synced: 5 months ago
JSON representation
Lox programming language
- Host: GitHub
- URL: https://github.com/itsrainingmani/lox
- Owner: itsrainingmani
- License: mit
- Created: 2022-04-26T19:18:46.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T08:16:34.000Z (about 1 year ago)
- Last Synced: 2025-03-01T06:44:24.485Z (11 months ago)
- Topics: c, interpreter, java, programming-language
- Language: Java
- Homepage:
- Size: 308 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Getting Started
Welcome to the Lox programming language. I am following the *Crafting Interpreters* [book](http://craftinginterpreters.com/)
## Folder Structure
- `lox` : the root folder that contains the source code for the lox language
- `lox\tool`: the folder that contains other tooling to help with building the language. For ex., `GenerateAst.java` allows us to programmatically build a java file that implements Expressions.
- `lox\java`: the folder that contains the source code for the Java interpreter, `jlox`
- `lox\c`: the folder that contains the source code for the C Bytecode VM, `clox`
Meanwhile, the compiled output files will be generated in the `bin` folder by default
## Building Clox
There are two ways to build the `clox`, the Bytecode VM implementation of Lox -
- Using the conventional make commands that the author built
- Using the `build.zig` file that I wrote. This should be a little faster at compiling c files on average due to the power of zig's c compiler
To use `build.zig`, run the following command in your shell -
```shell
~ zig build
```
To build and open the clox REPL directly, run -
```shell
~ zig build repl
```
## Progress Report
* May 26th, 2022 at 10:43 AM ET, the entire jlox interpreter is complete and is passing all tests!
* March 25th, 2023 at 5:17 AM ET - Completed Chapter 20: Hash Tables