58

The WebRacket language is a subset of Racket that compiles to WebAssembly

I read the WASM spec and became somewhat of an expert in it for the purpose of eventually designing a low-level language specifically for wasm, to be the most efficient and lowest-level language you could possibly have for wasm, and then gradually add high level concepts into it to make it more convenient. Kind of like building C on top of asm, and then gradually evolving it into C++. That project never came about though due to lack of community interest and time on my part, but I like seeing languages that take a fresh look at how to integrate with wasm using novel techniques to aim for maximal efficiency.

18 minutes agopublicdebates

Is there any shared lineage between this and Whalesong, a previous Racket->JS compiler?

Of course both projects have the same maintainer if I recall, Jens Axel Søgaard is a rockstar :)

19 minutes agogcr

I love this. Racket is the future we were promised.

2 hours agonoelwelsh

Is a (Web)Racket engineer a racketeer?

17 minutes agoKarenDaBass

They're certainly a schemer. :-)

11 minutes agogcr

It is interesting to see another language target WebAssembly especially one like Racket. The fact that it compiles to a subset of the language limits its utility right now. I think it is a neat proof of concept but it needs full language support.

2 hours agodfajgljsldkjag

For folks curious about the supported language subset, here's a summary:

- Modules aren't implemented yet, but are high on the list

- Continuation-based control flow isn't supported yet, including break and promises. Tail calls are supported though.

- No support for complex numbers, bignums, weak hashtables, immutable hashtables, prefab structs, regexp, or file I/O support

Most of the rest of racket/base should work, according to the README. There's also a FFI for javascript, including bindings for Math, DOM, Canvas, MathJax, XTermJS, and JSXGraph. Overall feels like you can use most of the language right now unless you need odd Racket-isms or call/cc.

12 minutes agogcr

As far as I know compiling full Racket to WASM is impossible because of continuations.

13 minutes agovolemo

I noticed the --expose-gc. Does this mean it's using the (now standardized) Wasm GC feature?