3tty0n / rpylox

RPython implementation for Lox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RPyLox

This repository is a RPython implementation for Lox. Read more at https://craftinginterpreters.com/

Prerequisite

RPython and Python 2.7

This code base is built with RPython and PyPy 2.7. Please download PyPy repository and put it at the root.

wget https://downloads.python.org/pypy/pypy2.7-v7.3.14-src.tar.bz2
tar xf pypy2.7-v7.3.14-src.tar.bz2 && mv pypy2.7-v7.3.14-src pypy

PyPy 2.7 is based on Python 2.7. Please install Python 2.7 instead of Python 3.x.

Build

You can use Makefile to build rlox-jit and rlox-interp.

rlox-jit support meta-tracing compialtion and runs faster for loop-heavy programs for example.

make targetlox-jit

rlox-interp is an interpreter compiled by using RPython.

make targetlox-interp

Progress

  • Chapter 16
  • Chapter 17
  • Chapter 18
  • Chapter 19
  • Chapter 20
    • Skip this chapter because we can use built-in hash tables
  • Chapter 21
  • Chapter 22
  • Chapter 23
  • Chapter 24
    • Finished 24.5.1 (2023/12/27)
  • Chapter 25
  • Chapter 26
  • Chapter 27
  • Chapter 28
  • Chapter 29
  • Chapter 30

About

RPython implementation for Lox


Languages

Language:Python 98.8%Language:Makefile 0.6%Language:Shell 0.5%