You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After discussing this one with @dbaeumer, I think there might be merit in having some kind of first-class runtime primitives for enums and variants.
So instead of passing a string or a { tag, val } object shape, to instead have a singular importable type instance which represents the enum or variant.
This would mean, for example, with an interface like HTTP, instead of creating an outgoing request like:
import{bar}from'foo:bar';const{ X, Y, E, F }=bar;bar.q(X.a('string'),Y.a(2),{a: 4},E.first,F.a|F.b);
Note that only the "primitive types" variant, flags and enum get treated this way, and not records, tuple, option or result.
For option and result primitives though, we need to figure out how to get a handle to them - either as some kind of special import or dare I say global.
After discussing this one with @dbaeumer, I think there might be merit in having some kind of first-class runtime primitives for enums and variants.
So instead of passing a string or a
{ tag, val }
object shape, to instead have a singular importable type instance which represents the enum or variant.This would mean, for example, with an interface like HTTP, instead of creating an outgoing request like:
we would instead write:
This would be a major change to the bindgen, but could be worth considering at some point.
The text was updated successfully, but these errors were encountered: