A practical Scheme interpreter written in JavaScript

Usage no npm install needed!

<script type="module">
  import biwascheme from '';



biwascheme logo

BiwaScheme is a Scheme interpreter written in JavaScript.

Works with web browsers (including mobile devices) and Node.js.




(Or you can just copy the file from ./release.)

How to use

Just load biwascheme.js (or biwascheme-min.js) and write Scheme code.

<!DOCTYPE html>

<div id="bs-console"></div>

<script src="biwascheme.js"></script>
<script type="text/biwascheme">
(display "hello, world!")


How to use with node.js to run a biwa script

  1. $ npm install -g biwascheme

  2. create a file a.scm:

    (display "Hello, world!") (newline)

  3. $ biwas a.scm

How to use from inside node.js as a module

  1. $ npm install biwascheme

  2. create a file a.js:

    var BiwaScheme = require("biwascheme");"(+ 1 2)"); // or BiwaScheme.run_file("a.scm");

  3. $ node a.js

Statically build biwa-powered website

The npm package contains biwascheme.mjs for module bundlers like rollup. See for an example.

Note that biwascheme.mjs does not include jQuery unlike biwascheme-x.y.z.js. You need to bundle jQuery manually if you want to use functions defined in src/library/webscheme_lib.js.

Building biwascheme.js

You need Node.js (tested with v16.5.0) and npm (tested with v7.20.1) to build biwascheme.js.

See doc/dev/


BiwaScheme implements most of the features of R7RS small, including first-class continuation and tail call optimization.

Major lacking features are:

  • syntax-rules
  • Exceptions
  • Library system

There are two limitations that arise from JavaScript. These will not be fixed (it's technically possible to fix but will be very inefficient).

  • Strings are immutable
  • Integers are not distinguished from float




BiwaScheme logo by @jcubic: Creative Commons Attribution 3.0



Yutaka HARA (yhara)