问HN:有没有为WASM设计的编程语言?

1作者: 90s_dev6 天前原帖
大家好。我正在寻找所有专门设计为编译到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?有垃圾回收;找不到许可证;最后一次提交是3小时前;文档详尽,但都是以md文件形式存放在仓库中。 - **assemblyscript**(https://github.com/AssemblyScript/assemblyscript)——类似TypeScript;Apache 2许可证,最小运行时带有垃圾回收;用JavaScript实现。 - **walt**(https://github.com/ballercat/walt)——为WASM设计的类似JavaScript的语言,有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)——类似JavaScript,带宏;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