Hacker News new | past | comments | ask | show | jobs | submit login
Psyche: A domain specific language designed for creating WebAssembly modules (github.com)
44 points by iwillrunoutofsp 78 days ago | hide | past | web | favorite | 5 comments

Here's my self-compiling toy compiler for WASM:


> Language reference

> Coming soon

Yes please.

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

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

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

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact