Skip to content

Simple implementation of a Lisp interpreter written in Rust

License

Notifications You must be signed in to change notification settings

ZAZPRO/toy-lisp-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published