-
-
Notifications
You must be signed in to change notification settings - Fork 655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A problem with npm and some questions #36
Comments
Seems this is failing here. Just tried and it is failing for me as well, going to take a look.
Not yet, but it should be rather trivial to add as a command line option like
Somewhat. There is a low-level API exported from index.ts, which is meant to work the same regardless of if the compiler has been compiled to JS or WASM (eventually). All the other things can also be used from TypeScript, of course, but there is no API documentation except the comments in the sources yet and the portable polyfill (d.ts) must be included in the application using it.
The prototype was based on TypeScript's compiler API, while NEXT is a complete reimplementation with the goal to compile the compiler itself to WebAssembly eventually.
Yes, there is no development taking place on the prototype anymore.
There is some support already, but it's currently limited to static strings. Static arrays are planned as well. This is somewhat connected with having a working runtime, i.e. a memory manager and GC.
Just recently I started to implement function expressions, which use tables, so it shouldn't be long. |
Appears I somehow moved the Binaryen dependency to devDependencies. Should work now with the fix above applied. |
It's now also possible to import the memory instance (here: env.memory), like so: Usage: |
Thanks, now the npm installation works well. As for the program API, I found out that I can use it this way:
However, I added the
Perhaps, it's required to add something to the script itself, but I don't know what I should add. The script itself:
Where can I see an example? |
Looks like an issue with Binaryen, going to take a look.
That's not how it works, memory is a configuration thing :)
It's still in its early days, but this compiler test (output) shows what's possible already. Basically, whenever a string literal is used, it becomes a data segment in the form 4bytes length + length * 16bit charcodes. |
Memory imports should validate now. Let me know if you see any other issues :) |
Hello! Thank you for the memory imports fix, now it works correctly as expected. But the bug with npm installation has arose again for me:
As in the previous time, the installation via Take a look, please. |
Does it work now? I think the switch to webpack 4 broke it again. |
Yes, it works. Thanks. |
Bumps [assemblyscript](https://github.com/AssemblyScript/assemblyscript) from 0.10.1 to 0.12.0. - [Release notes](https://github.com/AssemblyScript/assemblyscript/releases) - [Commits](AssemblyScript/assemblyscript@v0.10.1...v0.12.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Hey there!
I have tried to create a simple program following the guide
https://github.com/AssemblyScript/assemblyscript/wiki/Hello-World
but for me the installation via npm doesn't work, when I do
npm run build
, I get the following:However, I have tried tried out the alternative way to install the tool
And it compiled successfully.
However, it will be nice, if you fix the installation via npm.
Also, some questions.
Is there a way to import
Memory
in a script? That is to say, how can I get something like(import "js" "mem" (memory 1))
in the.wasm
module?Is there any program API besides the CLI API? As here https://www.npmjs.com/package/assemblyscript#api
Why do you switch from the Prototype to the NEXT version? Is the NEXT version something completely new? Will be I right, if I say that it's recommended to use the NEXT version, rather than this module
https://www.npmjs.com/package/assemblyscript
?
Also, I wonder, do you plan to implement a support for
(data ...)
expressions? It's a rather useful thing in case when one needs to define a constant array, for example.And
Table
(of functions) hasn't been supported yet, hasn't it?The text was updated successfully, but these errors were encountered: