ZAZPRO / toy-lisp-rs

Simple implementation of a Lisp interpreter written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust Toy Lisp interpreter

This is a really simple Lisp interpreter, written in Rust. Just for educational purposes. Used to discover how to work with lexing libraries and how to write basic interpreter. Functionality that is done works really solid, but do not expect any new functionality beyond ones that listed in the Features.

Based on v0.0.1 of this book but with distinct difference in underground structure of lexing and operator evaluation as operators now accept arbitrary number of arguments.

Lisp Features

  • Integers
  • Floats
  • Variable definitions
  • Conditionals
  • Lambdas
  • Arbitrary number of arguments for operators
  • Advanced parsing using logos

Interface Features

  • Advanced REPL with history using rustyline
  • File Evaluation

Installation

Download latest release on Github for your target platform.

Building

  • Clone repository
  • Run: cargo build --release
  • Executable is created at target/release/lisp-rs

Usage

Usage:
        Start a REPL  lisp-rs
        Execute file  lisp-rs [FILE_PATH]

Main options:
        -h, -?, --help Print this help message and exit

Toy Lisp Examples

Check lisp-examples project directory.

About

Simple implementation of a Lisp interpreter written in Rust

License:Other


Languages

Language:Rust 98.0%Language:Common Lisp 1.5%Language:NewLisp 0.5%