Theseus icon indicating copy to clipboard operation
Theseus copied to clipboard

Add support for `std`

Open tsoutsman opened this issue 2 years ago • 3 comments

The CI is too slow to even check out the rust submodule, let alone build the compiler. Probably best to create a separate branch rather than merging into theseus_main.

To upstream this we would have to:

  • Implement the rest of std functionality
  • Publish theseus_ffi and theseus_shim to crates.io

tsoutsman avatar Nov 06 '23 12:11 tsoutsman

@kevinaboos should be ready for review

tsoutsman avatar Nov 15 '23 04:11 tsoutsman

@kevinaboos should be ready for review

Great! I'll take a look tonight or tomorrow late afternoon.

kevinaboos avatar Nov 16 '23 01:11 kevinaboos

couldn't we just have the shim and libtheseus layers convert to/from those existing ABI-stable FFI types, regardless of whether they came from our lib or another lib?

So not really. E.g. we call app_io::stdout and get an alloc::sync::Arc<dyn Writer>. We can't call stabby::Arc::from_raw(alloc::sync::Arc::into_raw(writer)) because stabby::Arc and sync::Arc could have different layouts. And there's not really much else we could do. We can't get an owned reference to the dyn Writer and so we can't turn it into a stabby trait object and wrap it in a stabby::Arc.

And conceptually that makes sense. writer is layed out in memory as an alloc::sync::Arc<dyn Writer> and there is no way we can interpret it as a stabby::Arc<vtable!(dyn Writer)> because they have different layouts.

tsoutsman avatar Nov 18 '23 00:11 tsoutsman