[英]Is there any way to compile AssemblyScript without node.js nor npm? Preferrably a standalone compiler that I could call from another program?
I have been searching some way to compile AssemblyScript without node.js. I have not found it and it is a tragedy because I really could use it to dynamically generate some special web assembly from other programs, for example, from a PHP program, in environments where node is not supported (like many shared hostings).我一直在寻找一些方法来编译没有 node.js 的 AssemblyScript。我没有找到它,这是一个悲剧,因为我真的可以使用它从其他程序动态生成一些特殊的 web 程序集,例如,从 PHP 程序,在环境中不支持节点(如许多共享主机)。 I have the intuition that the compiler does not actually require node at all, that it must be written in some other language, but I have not found any way to install the compiler at all.
我的直觉是编译器实际上根本不需要 node,它必须用其他语言编写,但我还没有找到任何安装编译器的方法。
Do you have any idea of how to use it without node?你知道如何在没有节点的情况下使用它吗?
There is a way to do what you want, but it does not get rid of node completely.有一种方法可以做你想做的事,但它并没有完全摆脱节点。
The AssemblyScript README.md about the asc
compiler lists two ways of building the compiler: the usual compilation to JavaScript, and a bootstrapping process, where you compile asc
to WebAssembly by compiling it to JavaScript and then using that compiler to compile it to WebAssembly.关于
asc
编译器的 AssemblyScript README.md列出了两种构建编译器的方法:通常编译为 JavaScript,以及引导过程,在该过程中,您通过将asc
编译为 JavaScript 然后使用该编译器将其编译为 WebAssembly 来将其编译为 WebAssembly。
The caveat is that, at least initially, you still node to obtain the compiler from sources.需要注意的是,至少在最初,您仍然需要从源代码中获取编译器。
A second caveat is that the frontend for asc
is JavaScript only, for now.第二个警告是
asc
的前端目前只有 JavaScript。 You can use the WebAssembly binary only as a library, which may be actually what you want, given your use-case.您只能将 WebAssembly 二进制文件用作库,根据您的用例,这实际上可能是您想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.