Skip to content

Latest commit

 

History

History
72 lines (55 loc) · 2.75 KB

README.md

File metadata and controls

72 lines (55 loc) · 2.75 KB

Lantern

A modern, interpreted, statically typed scripting language, built from the ground-up using Rust.

This is a pre-1.0.0 release! Expect bugs, crashes, and more!

Goals:

  • Bullet-proof null safety
  • Eloquent error handling
  • Rich standard library
  • Package system
  • Powerful tools for testing
  • Extendability with custom runtimes

The goals above are what we are striving for in the long-run, however, there is still much to do in the early stages of this project.

Todo List:

  • Tokenizer
  • AST Parser
  • Runtime
  • Records
  • Options
  • Results
  • Compile-time type checking
  • Multi-file support
  • External package support
  • Inheritance
  • Documentation system
  • Generics
  • Improved compiler and runtime errors (accurate line and column numbers)
    • 3 todos left!
  • 100% doc coverage
  • LSP server
  • Tree-sitter parser
  • lantern test command

There's still a long ways to go, so don't expect this to reach version 1.0.0 anytime soon! (You can always contribute by making a pull request wink wink)

Installation

  1. Install Rust if you haven't already. Installation instructions can be found here.
  2. Clone this repository and navigate to its root folder by running the following in your terminal:
git clone 'https://github.com/DatAsianBoi123/lantern-lang.git' && cd lantern-lang
  1. Install the CLI tool by running cargo install --path cli in the root folder. This may take a while!

Congratulations! You have now installed Lantern. Run lantern -h for info about running scripts, and try running some scripts in the /scripts directory.

Refer to the wiki to get started writing Lantern code.

A vim syntax file can also be found in /syntax/la.vim.

Workspace Details

This project is broken up into multiple different crates, each with its own functionality.

  • lang contains structs and enums that essentially bridge Lantern data with Rust. For example, this crate includes a LanternValue enum that represents a lantern value such as a str or num.
  • parse handles parsing of Lantern code. Right now, this crate only performs lexical analysis and syntax analysis.
  • runtime contains functionality to execute a list of statements generated by the parse crate.
  • builtin contains builtin top-level functions and variables that are a part of the std library, such as print, stringify, and input. Note that builtin records are not found in this crate, rather, are found in lang.
  • macros contains procedural macros that assist in making native Lantern functions.
  • lantern is the main crate that exports all the crates above.
  • cli is the main cli used when installing this crate, executable using lantern.