Remix.run Logo
pizlonator 2 days ago

What is Fil-Rust and Fil-Unsafe-Rust?

kobebrookskC3 2 days ago | parent [-]

in my mind it would be doing what fil-c does for c to unsafe rust: a hypothetical memory safe implementation of unsafe rust using the same methods fil-c does e.g. gc

pizlonator 2 days ago | parent [-]

Can't do GC unless you go all-in.

So that implies just running all of Rust through the Fil-C transformation

zozbot234 2 days ago | parent | next [-]

> Can't do GC unless you go all-in.

It can be done, especially with a safe non-GC language that can meaningfully guarantee it won't corrupt GC metadata or break its invariants. You only have real issues (and then only wrt. excess overhead, not unsoundness) with pervasive mutual references between the GC and non-GC parts of the program. You do need to promote GC pointers to a root anytime that non-GC code has direct access to them, and add finalizers to GC objects that may need to drop/run destructors on non-GC data.

baq 2 days ago | parent | prev [-]

that's what I expected, thanks for making this clear!