https://github.com/meooow25/ash
An interpreter for a subset of R5RS Scheme
https://github.com/meooow25/ash
scheme-interpreter
Last synced: 3 months ago
JSON representation
An interpreter for a subset of R5RS Scheme
- Host: GitHub
- URL: https://github.com/meooow25/ash
- Owner: meooow25
- License: mit
- Created: 2022-06-13T14:18:08.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-25T13:10:18.000Z (about 3 years ago)
- Last Synced: 2025-02-10T03:28:20.815Z (5 months ago)
- Topics: scheme-interpreter
- Language: Haskell
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ash
A tree walking interpreter for a subset of [R5RS](https://schemers.org/Documents/Standards/R5RS/)
[Scheme](https://en.wikipedia.org/wiki/Scheme_(programming_language)).## Details
```
╭─────────╮ ╭────────────╮ ╭────────╮
Text ──► │ Parse │ ─── Scheme value ──► │ AstParse │ ──── AST ────► │ Eval │ ───► Effects and result
╰─────────╯ ╰────────────╯ ╰────────╯
```Source code is parsed into [S-expressions](https://en.wikipedia.org/wiki/S-expression), represented as Scheme data.
This is then parsed into an [abstract syntax tree](https://en.wikipedia.org/wiki/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](https://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours)
and [Write You A Scheme, Version 2.0](https://wespiser.com/writings/wyas/00_overview.html), but currently has little in common with
these tutorials.## Differences from R5RS
The following are not supported
* Mutation
* Macros
* Continuations
* Non-integral numbers
* QuasiquotationsAlmost 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](https://www.haskell.org/downloads/) 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