Source spans? Roundtripping? #878
haydenflinner
started this conversation in
General
Replies: 1 comment
-
Can you expand on that a little bit? Re: spans/roundtripping in general, I think things are complicated in that... facet can be derived on types that are generated by macros, so they're not necessarily present verbatim in the source code. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
With the advent of wasm/wasi/makepad/wanix and I'm sure innumerable other attempts, generating code at runtime looks a lot more ergonomic. No longer to be relegated to only superfast json/regex parsers and databases.
If attempting that, facet offers a great view into currently defined structs. But if one wanted to modify those structs in the source, I believe some info is missing. The source spans and originating file path, as one example.
Even more likely to be out of scope for base facet, but extending on the above, with Facet we basically have Deserialize implemented for rust data structures. What if we could modify the in-memory Facet reprs, and then Serialize it back to disk?
I recognize this is pretty far from facet's current aim, but what do folks think? Are there other approaches to this for Rust or similar languages implemented outside of IDEs? Anything to be taken for facet?
Beta Was this translation helpful? Give feedback.
All reactions