@acransac/biwascheme 中文文档教程

发布于 4年前 浏览 17 项目主页 更新于 3年前

BiwaScheme

这是一个分支。 所有学分归原作者 Yutaka Hara 和维护者所有。 版权所有 (c) Yutaka Hara

请参阅存储库中的许可证文件或与 npm 包一起分发

biwascheme logo

BiwaScheme 是一个用 JavaScript 编写的 Scheme 解释器。

适用于网络浏览器(包括移动设备)和 Node.js。

这个分支旨在使 Node.js 的上游 BiwaScheme 适应 web worker 和 Node 的工作线程。 此外,系统 API(套接字、文件系统、导入……)被中和,期望在线程中运行的 Scheme 程序是封闭系统。

Demos

请参阅 http://www.biwascheme.org/

Download

  • http://www.biwascheme.org/

(或者您可以从 复制文件./release.)

How to use

只需加载 biwascheme.js(或 biwascheme-min.js)并编写 Scheme 代码。

<!DOCTYPE html>
<html>
<body>

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

<script src="biwascheme.js"></script>
<script type="text/biwascheme">
(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!") (换行符)

  3. $ biwas a.scm

How to use from inside node.js as a module

  1. $ npm install biwascheme

  2. 创建文件 a.js:

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

  3. $ node a.js

Conformance

BiwaScheme 实现 R7RS small,包括一流的延续和尾调用优化。

主要缺乏的特性是:

  • syntax-rules
  • Exceptions
  • Library system

JavaScript 有两个限制。 这些不会被修复(技术上可以修复但效率非常低)。

  • Strings are immutable
  • Integers are not distinguished from float

Building biwascheme.js

请参阅 @jcubic 的 doc/dev/build.md

License

MIT-LICENSE

BiwaScheme 徽标:Creative Commons Attribution 3.0

Acknowledgements

  • Kent Dyvbig,方案的三个实施模型

  • http://www.cs.indiana.edu/~dyb/pubs/3imp.pdf

  • jsScheme

  • http://alex .ability.ru/scheme.html (不可用)

  • ExplorerCanvas (demo/excanvas.js)

  • http://excanvas.sourceforge.net/

Contact

https://github.com/biwascheme/biwascheme

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

BiwaScheme

This is a fork. All credits go to the original author Yutaka Hara and the maintainers. Copyright (c) Yutaka Hara

See the license file in the repository or distributed with the npm package

biwascheme logo

BiwaScheme is a Scheme interpreter written in JavaScript.

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

This fork aims to adapt the upstream BiwaScheme for Node.js to web workers and Node's worker threads. Also, the system APIs (sockets, filesystem, imports…) are neutralized, expecting Scheme programs running in threads to be closed systems.

Demos

see http://www.biwascheme.org/

Download

  • http://www.biwascheme.org/

(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"></script>
<script type="text/biwascheme">
(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 a.js:

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

  3. $ node a.js

Conformance

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

Building biwascheme.js

See doc/dev/build.md

License

MIT-LICENSE

BiwaScheme logo by @jcubic: Creative Commons Attribution 3.0

Acknowledgements

  • Kent Dyvbig, Three implementation models for scheme

  • http://www.cs.indiana.edu/~dyb/pubs/3imp.pdf

  • jsScheme

  • http://alex.ability.ru/scheme.html (inavailable)

  • ExplorerCanvas (demo/excanvas.js)

  • http://excanvas.sourceforge.net/

Contact

https://github.com/biwascheme/biwascheme

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

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文