-
-
Notifications
You must be signed in to change notification settings - Fork 681
Open
Labels
Description
Something that would be useful for some applications of wasm modules is to be able to define structured types that are stored on the stack.
This is also useful in cases when it is desirable to avoid use of the heap/linear-memory, but code structure would benefit from storing multiple values inside a structure together, like a class.
This could be a decorator, similar to @unmanaged. It's worth noting that @unmanaged gets us part-way in that the memory the type uses on the heap is smaller and doesn't have the GC header.
It might look like this.
@stack
class Config {
constructor(public field: u64) { }
}I imagine there are a few terms that would suit, such as:
@stack@struct@valueType
Related to #2253
jeaiii, mrchantey, Heath123, moomoolive, Tacodiva and 3 more