WebRacket
The WebRacket language is a subset of Racket that compiles to WebAssembly (wasm).
The long-term goal is to support full Racket. However, to quote Piet Hein, “Things take time.”
The subset supported by the WebRacket compiler is large enough, to enable programmers to build practical programs for the web.
The generated WebAssembly can be run either in the terminal (via Node) or in the browser. The browser is the main focus. WebAssembly is somewhat of a moving target. The compiler only uses widely supported features of WebAssembly. Expect the generated code to work in Chrome, Firefox and Safari.
A JavaScript FFI makes it possible to use standard JavaScript functions as well as browser specific APIs. Included are bindings for the DOM, Canvas, MathJax, XTermJS and JSXGraph.
The hope is that this project allows the Racket community to experiment with WebAssembly. The ideal outcome is that the experience can be used to extend the normal Racket compiler with a WebAssembly backend. In the meantime, we can have fun writing Racket programs that run in the browser.
Is WebRacket for you?
If you want to develop Racket programs that run in the browser and want to avoid JavaScript, then WebRacket is for you.
The FFI allows you to use WebRacket functions as event callbacks on the JavaScript side.
... continue reading