3 ms·
Ask HN: Languages Designed for WASM?
Hi everyone. I'm on a hunt to find all languages that are designed specifically to compile to WASM. I have a project (hram.dev -- hand-rolled assembly machine) that I want to build to share the joy of unwrapping a new computer in the 80s/90s that boots up with an editor so that you can program it directly in assembly, and I plan to use wamr+llvm for near-native performance while still having isolation so that you can mess things up. Obviously the ability to write WAT directly will be fundamental and certainly fun, but I am looking for higher level languages that make it slightly less convenient to write, to bundle with it internally so that users have at least two choices of how to write code. Do you know of any other languages designed specifically for wasm? These are all I could find:
Most likely:
curlywas (https://github.com/exoticorn/curlywas) -- c-like but very low-level; seems very complete; rust impl; mit license; short but seemingly thorough docs?
wa (https://github.com/wa-lang/wa) -- go-like, not clear how high/low level it is, thorough docs, seems promising, agpl license, lots of mandarin in docs
virgil (https://github.com/titzer/virgil) -- ruby-like? gc; cant find license; last commit 3 hours ago; thorough docs but all in md files in repo
assemblyscript (https://github.com/AssemblyScript/assemblyscript) -- typescript-like; apache 2 license, minimal runtime with gc; implemented in js
walt (https://github.com/ballercat/walt) -- JavaScript-like made for wasm, 25 contributors! decent looking docs, might actually be usable! most commits 7 years ago but last commit 3 years ago though, mit license
onyx (https://wasmer.io/posts/onyxlang-powered-by-wasmer, https://github.com/onyx-lang/onyx) -- ocaml-like? recent activity, full docs, bsd license, not sure if it has lower level capabilities or how much the higher level features cost at runtime or build time
waforth (https://github.com/remko/waforth) -- forth for wasm! upside is that its forth, downside is that its forth; mit license; great docs; seemingly inefficient due to constant lookups?
Less likely:
thinscript (https://github.com/evanw/thinscript) -- js-like with macros; abandoned 9 years ago; not yet licensed
wase (https://github.com/area9innovation/wase) -- C-like syntax but still wasm-like, not super recent but not super old, only a few contributors, not sure how complete it is but its docs give a feeling of being mostly-complete, MIT license
wam (https://github.com/kanaka/wam) -- wasm macro preprocessor, just one guy, last commit 7 years ago, very few built in macros, mozilla license (???)
wah (https://github.com/tmcw/wah) -- wasm but with infix, doesn't seem extensible with macros, two contributors, last commit 8 years ago, eclipse license (???)
Honorable mentions:
mini-c (https://github.com/maierfelix/mini-c) -- C to wasm compiler, seemingly abandoned 8 years ago, not sure how complete it is
c4wa (https://github.com/kign/c4wa) -- c to wasm compiler, no activity in 3 years, no license, written in java
- 90s_dev 1y agoI am leaning towards curlywas strangely enough. It just feels like the right language somehow. Not too low level to be boring to write, not too high level to take the fun out of writing low level code, not too old to consider it abandoned, docs relatively thorough and thoughtful, just enough syntax to make it familiar to C programmers and become a good stepping stone into writing C (maybe).
- 90s_dev 1y agoOne thing it's missing is arrays/structs as a way to access memory more conveniently, which I think is probably a must-have, though I bet I could add them on top of this language with how small it looks. Well, except that it's written in Rust and I don't understand Rust despite trying many times.
- Alex-Programs 1y agoThis looks fun. I don't have any specific suggestions - I've always used WASM with Rust - but I wish you luck with your project! P.S. You might have more success with replies on Reddit. HN is very all-or-nothing.
- 90s_dev 1y agoThanks I'll give it a try.
- 90s_dev 1y agoTried the reddit thing, funny story. I tried to post to the wasm sub and it said it was restricted. I posted to webdev and they said maybe try posting it at the programminglanguages sub. So I tried there and they deleted it! I don't understand anyone anymore.
- Alex-Programs 1y agoClassic Reddit. IRC, perhaps? :)