Project

rb-scheme

0.0
No commit activity in last 3 years
No release in over 3 years
An implementation of Scheme subset written in Ruby. It's based on the Stack-Based model introduced in Three Implementation Models for Scheme(http://www.cs.indiana.edu/~dyb/papers/3imp.pdf) by R. Kent Dybvig. The model is implemented by a compiler and virtual machine.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.13
~> 5.10
~> 10.0
 Project Readme

CircleCI

RbScheme

An implementation of Scheme subset written in Ruby. It's based on the Stack-Based model introduced in Three Implementation Models for Scheme by R. Kent Dybvig. The model is implemented by a compiler and virtual machine.

Features

  • first class closures
  • global variables
  • integers/symbols/cons cell/true/false
  • variadic function
  • call/cc(limitation exists)
  • if
  • basic arithmetic functions(+ - * /)
  • set!
  • tail call optimization

Install

$ gem install rb-scheme

Usage

Run

repl

$ rb-scheme

You can use rlwrap for readline

$ rlwrap rb-scheme

with file

$ rb-scheme examples/nqueen.scm

primitives

  • numeric(+, -, *, /)
  • predicate(=, <, >, null?)
  • lisp operations(cons, car, cdr, list)
  • print(display, newline, print)

examples

see examples folder

Development

$ bundle install
$ rake test

License

The gem is available as open source under the terms of the MIT License.