Open lqd opened 8 years ago
4) br_table
is supported in the binaryen C API, but I didn't hook up the relooper support for it yet. So for now we can't use it here. But practically speaking it's just an optimization, as we can do everything it does semantically (just without an efficient jump table). However, if there are reasons we need it more urgently, please let me know and I can prioritize it.
8) Probably best to ignore wasm64 for now. It's not even specced yet, there is just a general plan for it at this point.
10) I think it'd be awesome if we could pass rustc's test suite, or at least the run-pass and run-fail tests.
@eholk That's a long ways off, although to get things semi-working you could somehow ignore all of the intrinsics and MIR Rvalues/types and compile a broken libcore/libstd that tests can link to.
Yeah, definitely. I think of it as passing the test suite is how we could know we are done, and it also gives a concrete set of test cases to start with. I imagine at least a few of them have no dependencies on libcore/libstd, so we might be able to start with those.
Of course, maybe the WebAssembly platform is sufficiently different that we'll want to have a libwebstd instead, or maybe libwebcore at least.
@eholk The platform-specific stuff would result in a different libstd
, but libcore
is fundamental to Rust and has no OS dependencies, while liballoc
and libcollections
only require a memory allocator.
@eddyb Thanks! I knew there was some very small amount of stuff that Rust needs on each platform, I just didn't remember how it all breaks down. Anyway, it seems like it should be quite possible to run most Rust code on WebAssembly.
Of course, maybe the WebAssembly platform is sufficiently different that we'll want to have a libwebstd instead, or maybe libwebcore at least.
When using emscripten as the runtime we can get pretty good POSIX fidelity, so I'm confident we can make std mostly work.
Here's a recently-updated list of things/roadmap of sorts 😄
fun_names
map to not use the Sig but the Substs otherwise we'll end up with duplicate translated fns ( + with the same name) when more complex cases with traits/generics/monomorphizations are testedassert
PR)tmp0 = &mut (*((*var0).5: &'a mut fmt::Write + 'a))
found in fmt::Formatter::write_str
num::<impl i8>::saturating_mul
Thanks so much @lqd! I try to get easy issues into TWiR's call to participation each week, and I've added mir2wasm to my weekly triage list. I'll endeavor to break some of these out and try to stir up some more contributors.
Some thoughts/braindump on possible next steps:
trans_operand
panics if a value is not a Rust 32 bits isize, the binaryops emit the hardcoded i32 versions of those instructions, etc)br_table
existed in the binaryen API ? -- since it looked interesting for this use case but I didn't investigate it very much)trans_lval
)update: typo