请问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?有垃圾回收;找不到许可证;最后一次提交是3小时前;文档详尽,但都在仓库的md文件中。 - assemblyscript(https://github.com/AssemblyScript/assemblyscript)——类似TypeScript;Apache 2许可证,最小运行时带垃圾回收;用JS实现。 - 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)——类似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