Skip to content

makotodejima/mkd-lisp-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple interpreter for a Lisp-like language

Designed to execute programs with Lisp-style syntax, focusing on simplicity and extensibility.
Written in Rust. It contains basic components essential for language interpretation - tokenization, parsing into an Abstract Syntax Tree (AST), and evaluation.

Key features:

  • Lisp syntax interpretation, including lists, functions, and arithmetic.
  • Dynamic scoping with nested environment support.
  • Basic error handling for syntax and runtime errors.
  • Implemented in Rust for robustness and efficiency.

Examples

; Arithmetic
(+ 1 2 3)

; Variable definition
(def num 10)
(def another_num 4)
(- num another_num) ; 6

; Functions
(def add (fn (a b) (+ a b)))
(add 3 4) ; 7

; Conditional
(if (> 1 0) true false) ; true
(if (> num another_num) (add num another_num) 0) ; 14

The project is inspired by the following articles:

About

A simple interpreter for a Lisp-like language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages