Hacker News new | ask | show | jobs
by fweimer 41 days ago
Is the support gap mostly related to weak references and finalizers? Or is something else missing?

(Obviously those are already pretty significant gaps.)

2 comments

The most problematic missing feature for both C# and Go is interior pointers. But there are many others.
I thought that C# does not have escaping interior pointers, unlike Go. Last time I looked at the CLR, I couldn't find support for interior pointers.
Only so-called "ref" (and "out") variables/returns/fields can point to the inside of an object. These follow some borrow-checking rules so they can also point into stack variables, thus only ref-like types like Span<T> can hold ref and ref-like fields, and these are always rooted in the stack. But refs into the inside of a class type can escape the function, because they can keep the object alive.
It does but only on the stack, known as `ref struct`. E.g. `Span<T>` is an interior pointer, and this is extremely common in modern C#.
Those are supported afaics. It's reflection that isn't supported according to the docs.
Wasm GC does not offer weak refs or finalizers at this point: https://github.com/WebAssembly/gc/blob/main/proposals/gc/Pos...
uh the readme itself says it comes with different flavours of precise GC so clearly not using Wasm GC?