brson / miri

An experimental compiler from Rust to WebAssembly (inactive - do not use)
Apache License 2.0
209 stars 15 forks source link

Update to Rust nightly 2017-02-27 #58

Closed eholk closed 7 years ago

eholk commented 7 years ago

This change builds on #53, but updates to a still more recent Rust. Thanks @kazimuth for doing a lot of the more challenging work!

The change ended up being bigger than I'd hoped, but I also refactored and reorganized a few things. Some of this was as a result of troubleshooting some tricky lifetime errors. Breaking out the problematic code into smaller fragments made it easier to reason about what's going on.

I marked the compile-pass and run-compile-pass tests as ignored. There are some new lang items that need to be implemented. I think it would be better to move these tests into run-pass and then use tinycore instead of copying and pasting a lot of code. That will make the tests easier to maintain in the longer term. I've opened #57 so we don't forget.

eholk commented 7 years ago

/cc @dschuff

eddyb commented 7 years ago

You probably just want to set up xargo to build a libcore with -Zalways-encode-mir.

eholk commented 7 years ago

@eddyb Yes, eventually we'd like to just use Rust's libcore. I don't think mir2wasm is anywhere close to being able to build all of libcore yet though. Instead, tinycore is a stopgap to help us make progress in the short term. Once mir2wasm is more mature, I totally expect it to use libcore, libstd, etc.

eddyb commented 7 years ago

@eholk You wouldn't need to translate any of libcore! That's what xargo and -Zalways-encode-mir would be for - I suppose you might also want --emit=metadata to prevent LLVM from ever being involved.

eholk commented 7 years ago

@eddyb The issue is more that mir2wasm supports a very tiny amount of MIR right now, and xargo -Zalways-encode-mir almost certainly uses things that we don't handle correctly yet.

eddyb commented 7 years ago

@eholk But you choose what to translate, and if you start with the roots from your binary crate, you shouldn't reach things from libcore that you don't already have reimplemented for the tests.

eholk commented 7 years ago

@eddyb Ah, now I see. Yeah, that's probably a good direction to go. I opened #59 to track that idea.

kazimuth commented 7 years ago

Thanks for finishing this off, by the way. I ended up swamped by life and wasn't able to finish it :)

eholk commented 7 years ago

No worries, life happens! Every contribution is valuable!

On Mon, Mar 6, 2017 at 7:25 PM, James Gilles notifications@github.com wrote:

Thanks for finishing this off, by the way. I ended up swamped by life and wasn't able to finish it :)

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/brson/mir2wasm/pull/58#issuecomment-284610661, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGdJob1XSe4RtIK36s3KxoDjIk0kwAvks5rjM4_gaJpZM4MOsi0 .