Ask HN: 有哪些专为 WASM 设计的语言?

1作者: 90s_dev7 个月前
大家好。我正在寻找专门设计用于编译成 WASM 的所有语言。我有一个项目 (hram.dev -- 手工打造的汇编机器),我想构建它来分享 80 年代/90 年代拆开一台新电脑的乐趣,这台电脑会启动一个编辑器,这样你就可以直接用汇编语言对其进行编程,我计划使用 wamr+llvm 来实现接近原生的性能,同时仍然保持隔离,这样你就可以搞砸一些东西。显然,直接编写 WAT 的能力将是基础且肯定有趣的,但我正在寻找更高级别的语言,这些语言编写起来稍微不那么方便,以便在内部捆绑使用,这样用户至少有两个选择来编写代码。您知道还有其他专门为 wasm 设计的语言吗?这是我能找到的: 最有可能的: * curlywas (https://github.com/exoticorn/curlywas) -- 类似 C 语言,但非常底层;看起来非常完整;Rust 实现;MIT 许可证;简短但看似详尽的文档? * wa (https://github.com/wa-lang/wa) -- 类似 Go 语言,不清楚它有多高/低级,详尽的文档,看起来很有希望,AGPL 许可证,文档中有很多中文 * virgil (https://github.com/titzer/virgil) -- 类似 Ruby?GC;找不到许可证;最后一次提交 3 小时前;详尽的文档,但都在 repo 中的 md 文件中 * assemblyscript (https://github.com/AssemblyScript/assemblyscript) -- 类似 TypeScript;Apache 2 许可证,带有 GC 的最小运行时;用 JS 实现 * walt (https://github.com/ballercat/walt) -- 类似 JavaScript,专为 wasm 打造,有 25 位贡献者!看起来不错的文档,可能真的可以使用!大多数提交都是 7 年前,但最后一次提交是 3 年前,MIT 许可证 * onyx (https://wasmer.io/posts/onyxlang-powered-by-wasmer, https://github.com/onyx-lang/onyx) -- 类似 OCaml?最近的活动,完整的文档,BSD 许可证,不确定它是否具有较低级别的功能,或者高级功能在运行时或构建时的成本是多少 * waforth (https://github.com/remko/waforth) -- wasm 的 Forth!优点是它是 Forth,缺点是它是 Forth;MIT 许可证;出色的文档;由于不断查找,似乎效率低下? 不太可能的: * thinscript (https://github.com/evanw/thinscript) -- 类似 JS,带有宏;9 年前被放弃;尚未获得许可 * wase (https://github.com/area9innovation/wase) -- 类似 C 语言的语法,但仍然类似 wasm,不是非常新,也不是非常旧,只有少数贡献者,不确定它有多完整,但它的文档给人一种基本完成的感觉,MIT 许可证 * wam (https://github.com/kanaka/wam) -- wasm 宏预处理器,只有一个人,最后一次提交 7 年前,内置宏很少,Mozilla 许可证 (???) * wah (https://github.com/tmcw/wah) -- wasm 但带有中缀,似乎不能用宏扩展,两个贡献者,最后一次提交 8 年前,Eclipse 许可证 (???) 值得一提的: * mini-c (https://github.com/maierfelix/mini-c) -- C 到 wasm 编译器,似乎 8 年前被放弃,不确定它有多完整 * c4wa (https://github.com/kign/c4wa) -- c 到 wasm 编译器,3 年没有活动,没有许可证,用 Java 编写
查看原文
Hi everyone. I&#x27;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&#x2F;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:<p>Most likely:<p>curlywas (https:&#x2F;&#x2F;github.com&#x2F;exoticorn&#x2F;curlywas) -- c-like but very low-level; seems very complete; rust impl; mit license; short but seemingly thorough docs?<p>wa (https:&#x2F;&#x2F;github.com&#x2F;wa-lang&#x2F;wa) -- go-like, not clear how high&#x2F;low level it is, thorough docs, seems promising, agpl license, lots of mandarin in docs<p>virgil (https:&#x2F;&#x2F;github.com&#x2F;titzer&#x2F;virgil) -- ruby-like? gc; cant find license; last commit 3 hours ago; thorough docs but all in md files in repo<p>assemblyscript (https:&#x2F;&#x2F;github.com&#x2F;AssemblyScript&#x2F;assemblyscript) -- typescript-like; apache 2 license, minimal runtime with gc; implemented in js<p>walt (https:&#x2F;&#x2F;github.com&#x2F;ballercat&#x2F;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<p>onyx (https:&#x2F;&#x2F;wasmer.io&#x2F;posts&#x2F;onyxlang-powered-by-wasmer, https:&#x2F;&#x2F;github.com&#x2F;onyx-lang&#x2F;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<p>waforth (https:&#x2F;&#x2F;github.com&#x2F;remko&#x2F;waforth) -- forth for wasm! upside is that its forth, downside is that its forth; mit license; great docs; seemingly inefficient due to constant lookups?<p>Less likely:<p>thinscript (https:&#x2F;&#x2F;github.com&#x2F;evanw&#x2F;thinscript) -- js-like with macros; abandoned 9 years ago; not yet licensed<p>wase (https:&#x2F;&#x2F;github.com&#x2F;area9innovation&#x2F;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<p>wam (https:&#x2F;&#x2F;github.com&#x2F;kanaka&#x2F;wam) -- wasm macro preprocessor, just one guy, last commit 7 years ago, very few built in macros, mozilla license (???)<p>wah (https:&#x2F;&#x2F;github.com&#x2F;tmcw&#x2F;wah) -- wasm but with infix, doesn&#x27;t seem extensible with macros, two contributors, last commit 8 years ago, eclipse license (???)<p>Honorable mentions:<p>mini-c (https:&#x2F;&#x2F;github.com&#x2F;maierfelix&#x2F;mini-c) -- C to wasm compiler, seemingly abandoned 8 years ago, not sure how complete it is<p>c4wa (https:&#x2F;&#x2F;github.com&#x2F;kign&#x2F;c4wa) -- c to wasm compiler, no activity in 3 years, no license, written in java