Giter Club home page Giter Club logo

biwascheme's Introduction

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"></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 -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"); BiwaScheme.run("(+ 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 https://github.com/acmiyaguchi/svelte-biwascheme-example 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/build.md.

Development

How to run tests

Prerequisites: Node.js, npm

  1. $ npm install
  2. $ npm run serve
  3. Open http://localhost:7001/test/spec.html

Some more tests

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

Links

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's People

Contributors

acmiyaguchi avatar alanthird avatar anadrome avatar cpressey avatar dependabot[bot] avatar eatonphil avatar epozzobon avatar erjiang avatar jbonigomes avatar jcubic avatar jfhbrook avatar kenpratt avatar kpengboy avatar lilsweetcaligula avatar masatake avatar matthewdean avatar mikecat avatar mtornwall avatar okuoku avatar peterolson avatar pulpgrinder avatar rain-1 avatar spatten avatar tanguyandreani avatar vidjuheffex avatar viebel avatar woxtu avatar wware avatar yhara avatar zaoqi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.