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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add webassembly language #6429
base: main
Are you sure you want to change the base?
Add webassembly language #6429
Conversation
objdumper=llvm-objdump | ||
objdumperType=llvm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used llvm-objdump
here because wasmtime supports a --target=<triple>
parameter that cross-compiles WASM modules for other architectures. The problem is that when using objdump
it then can't disassemble the resulting file. I'm not sure if there is a better solution to handle these cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks a lot for taking the time to add support for this, we really appreciate it :)
I have a few minor comments on the config files, but other than that, this looks great!
etc/config/wasm.defaults.properties
Outdated
group.wasmtime.isSemVer=true | ||
|
||
compiler.wasmtime2001.name=Wasmtime 20.0.1 | ||
compiler.wasmtime2001.exe=/opt/compiler-explorer/wasmtime-20.0.1/wasmtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path in the defaults
environment should be the one where a typical wasm installation would find the binary - this is usually /usr/bin/{binaryname}
for most other language compilers, but whatever works best in wasm's case would be ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too sure what to do here, wasmtime defaults to installing via a shell script, and the default location is $HOME/.wasmtime/bin/wasmtime
, installing via cargo
(the rust package manager) also installs it in the users home directory. I also don't think there are any system packages for it. At least that I could find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I see. We could probably merge as-is then, but let's see what others think first, I'll bring it up tomorrow if noone checks this before :)
Thanks for the extra insight!
The previous regex had a exponential backtracking issue under some inputs.
I'd love to have Wasmer supported as well! Let me know if we can help with that :) |
Awesome! I already have a WIP patch locally adding wasmer! I was waiting to get this merged in before proposing that. |
馃憢 Hey,
This PR adds support for the Webassembly Text Language (#1871). Currently it only supports the wasmtime compiler, but it should be possible to add others (i.e. v8 / wasmer / etc...).
It looks like the monaco does not support the WAT language, so I've added a simple mode for it, that is mostly copied from the clojure mode with some changes. From what I've tested it seems to work reasonably well.