Skip to content

An interpreter of a subset of Scheme written in Haskell

Notifications You must be signed in to change notification settings

wasabi315/Hasche

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hasche

/ˈhæʃ/: Haskell + Scheme

An interpreter of a subset of Scheme written in Haskell

Features

  • REPL Session
  • call/cc
  • Non-hygienic macros

Usage

Build

$ cabal build

Run

$ cabal exec hasche -- exec programs/hello.scm
# or
$ cabal exec hasche -- repl

List of available syntax, macros & functions

Special forms

define, define-macro, set!, lambda, if, quote, quasiquote, unquote, unquote-splicing, match

Basic macros

begin, when, unless, and, or, cond, let, let*, letrec, do

Basic functions

eval, apply
null?, pair?, boolean?, number?, string?, symbol?, procedure?
not
+, -, *, /, =, <, <=, >, >=
list?, car, cdr, cons, list, length, memq, last, append, set-car!, set-cdr!, caar, cadr, cdar, cddr, map, for-each
string-append, symbol->string, string->symbol, string->number, number->string
eq?, neq?, equal?
open-input-file, open-output-file, close-input-port, close-output-port, read, display, write, newline, load
call/cc, call-with-current-continuation
gensym

Lazy evaluation

delay, force, delay-force, promise-done?

Future works

  • Multiple values
  • Tail call optimization
  • Hygienic macro
  • Exception handling

About

An interpreter of a subset of Scheme written in Haskell

Topics

Resources

Stars

Watchers

Forks