Skip to content

Loxscript is an interpreted, dynamically typed scripting language

Notifications You must be signed in to change notification settings

yashrathi-git/loxscript

Repository files navigation

Loxscript

Python port of the book crafting interpreters with some of my own changes and additions.

Features and quick tutorial

You could find the tutorial here

Requirements

  • python >= 3.8

Installation

Install with pip

$ 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

Without pip

  1. Clone the repo
    $ git clone https://github.com/yashrathi-git/loxscript
  2. Navigate to source code directory.
    $ cd loxscript
  3. 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

TODO:

  • 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.

About

Loxscript is an interpreted, dynamically typed scripting language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published