
Psyche: A domain specific language designed for creating WebAssembly modules - iwillrunoutofsp
https://github.com/0918nobita/psyche
======
6nf
Here's my self-compiling toy compiler for WASM:

[https://pierrerossouw.github.io/wats/](https://pierrerossouw.github.io/wats/)

~~~
Lerc
> Language reference

> Coming soon

Yes please.

------
linux2647
What is the significance of creating a domain specific language for WASM?
Doesn’t using something like Rust work well enough? (Genuinely curious)

~~~
est31
I don't know why the author created Psyche, but WASM is mostly made for being
sent over the wire e.g. when you visit a web site. For this, small binaries
are usually very helpful because it speeds up JIT and download. Rust on the
other hand wasn't really made for creating small binaries. This is because of
the language encouraging non-erased generics aka monomorphization as well as
associated bloat bugs like [1]. Maybe one day the bloat bug is fixed and
someone can create a lint to warn against generics and we'll get
monomorphization-free iterator libraries, but until then Rust isn't _perfect_
for wasm.

[1]: [https://github.com/rust-lang/rust/issues/46477](https://github.com/rust-
lang/rust/issues/46477)

~~~
whatwgg
Nim (higher level than C) creates small binaries and uses Emscripten to
produce WASM.

