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. See examples/ for a few WebRacket projects. Overview of the supported language subset The WebRacket compiler accepts a file containing a top-level form as input. The module form is not supported. However, include is available. For supported data types most functions in racket/base and racket are available as primitives. Most are implemented directly in WebAssembly, some are reimplemented in WebRacket. Datatypes Most basic data types are implemented, some have restrictions. Numbers The numerical tower contains only flonums and fixnums. Complex numbers and bignums are missing. Hash Tables Mutable hash tables of all four varieties ( eq? eqv? equal? always? ) are supported. The values ...
First seen: 2026-01-21 20:41
Last seen: 2026-01-22 12:43