Skip to content

meooow25/ash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ash

A tree walking interpreter for a subset of R5RS Scheme.

Details

         ╭─────────╮                      ╭────────────╮                ╭────────╮
Text ──► │  Parse  │ ─── Scheme value ──► │  AstParse  │ ──── AST ────► │  Eval  │ ───► Effects and result
         ╰─────────╯                      ╰────────────╯                ╰────────╯

Source code is parsed into S-expressions, represented as Scheme data.
This is then parsed into an abstract syntax tree (AST), which contains primitive Scheme expressions.
The AST is then evaluated.

The primary purpose of ash has been learning and fun. There has been no attempt to improve performance.
ash was initially based on Write Yourself a Scheme in 48 Hours and Write You A Scheme, Version 2.0, but currently has little in common with these tutorials.

Differences from R5RS

The following are not supported

  • Mutation
  • Macros
  • Continuations
  • Non-integral numbers
  • Quasiquotations

Almost all standard procedures, excluding those involving the above features, are available.

Installing

GHC and Cabal are required. The recommended way to install these is using GHCup.
See the downloads page on haskell.org for details.

git clone https://github.com/meooow25/ash.git
cd ash
cabal install

Then simply run

ash -h

Future features, maybe

  • Macros
  • Flonums
  • Compile to byte code

About

An interpreter for a subset of R5RS Scheme

Topics

Resources

License

Stars

Watchers

Forks