rust-lang / miri

An interpreter for Rust's mid-level intermediate representation
Apache License 2.0
4.39k stars 340 forks source link

in-tree serverless priroda #2602

Open oli-obk opened 1 year ago

oli-obk commented 1 year ago

Maintaining and using https://github.com/oli-obk/priroda is cumbersome.

  1. Breaks all the time when miri changes
  2. Requires a server backend to drive the HTML UI
  3. Need to use miri as a library and extract all kinds of possibly private data

So, my proposal is to rewrite priroda from scratch, but this time in-tree here.

  1. Get miri to compile to wasm and create a demo
  2. Add an API to the miri lib for debugger style usage. Initially this is just the stepper API wrapped
  3. Add a wasm project called priroda to this repo that renders the current state and drives the miri API just like original priroda did, but this time without the server
bjorn3 commented 1 year ago

I don't think the current priroda inherently depends on being a server, but it does require running rustc on a separate thread from the ui. Using wasm won't remove this requirement no matter how much you rewrite. By the way note that priroda already has the rustc driver and the http server driving the ui relatively separated. The http server side submits commands to the rustc driver and receives the result. This combined makes me think that a gradual change rather than a from the ground up rewrite would be more effective.

oli-obk commented 1 year ago

Ah yes, I completely forgot about this, thanks! So maybe the first step is to move priroda over here and update it and then keep it updated by building it together with miri, even in the rustc repo

RalfJung commented 1 year ago

My concern here is maintenance cost, but if the development of the rest of Miri doesn't have to care much about the priroda part then that seems fine for me.