(moving this to its own thread)
I think what’s outlined in this issue would be really really valuable for ReScript: [Feature request] zero-cost binding to tagged JS objects · Issue #5207 · rescript-lang/rescript-compiler · GitHub
It’d mean one could seamlessly move between JS/TS and ReScript for variant-heavy code, such as ASTs (GraphQL, Babel, markdown and HTML-parsers etc, even TypeScript itself comes to mind). This in itself is very attractive as one part where ReScript shines is working with AST-like data, thanks to proper pattern matching etc.
@Hongbo, in theory, do you think the work you’ve done with @obj
simplifies working on something like what’s outlined in the issue?