Python port of the book crafting interpreters with some of my own changes and additions.
You could find the tutorial here
- python >= 3.8
$ pip install git+https://github.com/yashrathi-git/loxscript
Now you could run loxscript
to access the interpreter.
If you are doing user install, you must add the user-level bin
directory to your PATH
environment variable in order to use loxscript. If you are using a Unix derivative (FreeBSD, GNU / Linux, OS X), you can achieve this by using export PATH="$HOME/.local/bin:$PATH"
command.
Usage:
$ loxscript # Starts a loxscript repl
$ loxscript path/to/source_code.ls # Executes the file
- Clone the repo
$ git clone https://github.com/yashrathi-git/loxscript
- Navigate to source code directory.
$ cd loxscript
- Running(Make sure you are in the source code directory):
$ python run.py # Starts a loxscript repl $ python run.py path/to/source_code.ls # Executes the file
- ADD TESTS!
- Support for multiline comments
- Complete classes and inheritance part
- Lists and Dicts
- Lambdas
- Provide builtins to do web-requests
- Add
setup.py
for direct install - Add support for decorators
- Add more builtins with decorators like
@property
,@classmethod
etc.