https://github.com/selectnull/pylox
Python implementation of Lox language
https://github.com/selectnull/pylox
interpreter lox-language programming-language python
Last synced: 8 months ago
JSON representation
Python implementation of Lox language
- Host: GitHub
- URL: https://github.com/selectnull/pylox
- Owner: selectnull
- License: mit
- Created: 2017-01-19T23:59:49.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-25T23:21:45.000Z (about 9 years ago)
- Last Synced: 2025-06-11T06:11:34.401Z (8 months ago)
- Topics: interpreter, lox-language, programming-language, python
- Language: Python
- Size: 20.5 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
pylox
=====
pylox is Python implementation of Lox programming language which is a
demo language from [Crafting Interpreters](http://www.craftinginterpreters.com/)
book by [Bob Nystrom](https://github.com/munificent).
I'm doing this because:
1. I want to learn about language design and implementation
2. I don't want to just read the book or copy and paste the code from it
and I want to do something else than C or Java
3. Python is my main language these days and I want to use something I'm
most comfortable with
4. Maybe after Python version I decide to reimplement it (or make my
own toy language) in Go. Or force myself to learn Rust which seems
like a good idea.
5. Fun.
This is **work in progress**.
Requirements
------------
Python 3.6 for no particular reasons except f-strings are used in few
places. Other than that, it could easily be ported to even Python 2.7
(but I don't plan to).
Install it
----------
pip install pylox
Make sure you run it with Python3, I suggest you install it inside
virtualenv.
Run it
------
from source:
python3 -m pylox [script]
or if installed via pip:
pylox [script]
License
-------
MIT.