Skip to content

Implementation of the virtual machine from Robert Nystrom's Crafting Interpreters

Notifications You must be signed in to change notification settings

sebastjancizel/clox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Implementation of the virtual machine from Robert Nystrom's Crafting Interpreters

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published