BiwaScheme

用 JavaScript 编写的 Scheme 解释器。「Scheme interpreter written in JavaScript」

Github星跟蹤圖

BiwaScheme

biwascheme logo

BiwaScheme is a Scheme interpreter written in JavaScript.

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

Demos

see http://www.biwascheme.org/

Download

(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>
<html>
<body>

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

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

</body>
</html>

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

  1. $ npm install 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 server.js:

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

  3. $ node server.js

Files

  • release/
    • the following files are generated here with $ make
      • biwascheme.js
      • biwascheme-min.js
      • node_biwascheme.js
  • demo/
    • Demos
  • src/
    • deps/
      • Dependencies (jQuery, underscore)
    • system/
      • Source code of the interpreter
    • library/
      • Built-in library functions
    • platform/
      • Platform dependent code (browser, node, etc.)
  • test/
    • Unit tests
  • tuplespace/
    • (experimental) TupleSpace implemented in Scheme
  • web/
  • www.biwascheme.org.js
    • web server

Building biwascheme.js

Prerequisites:

  • make
  • sed
  • node, npm, npx (Node.js)

Make compiles src/*.js into release/biwascheme.js.

$ npm install
$ make

Links

Development memos

How to add a new file

  • edit Makefile
  • edit src/development_loader.js

How to release

(moved to doc/dev/release.md)

How to upgrade dependencies

jQuery:

  • update src/deps/jquery.js

underscore:

  • update src/deps/underscore.js
  • update node_modules/biwascheme/package.json

underscore.string:

  • update src/deps/underscore.string.js
  • update node_modules/biwascheme/package.json

Website

The source of www.biwascheme.org is in ./website.

Run local website

You can run the website locally with Node and express.

$ make
$ make website
$ npm install
$ node local_website.js
$ open http://localhost:7001

License

MIT-LICENSE

BiwaScheme logo by @jcubic: Creative Commons Attribution 3.0

Acknowledgements

Contact

https://github.com/biwascheme/biwascheme

Yutaka HARA (yhara) yutaka.hara.gmail.com
http://twitter.com/yhara_en

概覽

名稱與所有者biwascheme/biwascheme
主編程語言JavaScript
編程語言Makefile (語言數: 6)
平台Linux, Mac, Windows
許可證MIT License
發布數32
最新版本名稱v0.8.0 (發布於 )
第一版名稱0.5.1 (發布於 2009-08-28 17:14:37)
創建於2011-08-08 02:40:34
推送於2024-04-26 08:50:39
最后一次提交2023-03-31 22:09:12
星數723
關注者數39
派生數127
提交數1.3k
已啟用問題?
問題數198
打開的問題數40
拉請求數125
打開的拉請求數1
關閉的拉請求數12
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?
去到頂部