Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.54 KB

README.md

File metadata and controls

47 lines (34 loc) · 1.54 KB

clox Interpreter

This repository contains an implementation of the clox interpreter, based on the book "Crafting Interpreters" by Robert Nystrom. clox is a bytecode virtual machine for the Lox programming language, a small, high-level scripting language designed for learning purposes.

This is a personal project driven by my interest in programming languages and compilers. I am using this project as a stepping stone towards understanding compilers and interpreters. It's also my way of furthering my knowledge of C, which means that the code includes (potentially excessive) comments and explanations.

Features

  • High-level scripting language
  • Dynamic typing
  • Lexical scoping
  • First-class functions and closures
  • Object-oriented programming with classes and inheritance
  • Garbage collection
  • Bytecode compilation and execution

Building and Running

To build and run the clox interpreter, follow these steps:

  1. Clone this repository:
git clone https://github.com/your_username/clox.git
cd clox
  1. Compile the project:
make
  1. Run in interactive mode:
./bin/clox

Generating compile_commands.json (optional)

To generate a compile_commands.json file for use with clangd, make sure that you install bear and then run the following command:

bear -- make

Resources