4 ms·
They're presenting this under the banner "the need for source to source transformations." That seems a bit disingenuous given this is not a source-preserving I
by conartist6 7mo ago
They're presenting this under the banner "the need for source to source transformations."
That seems a bit disingenuous given this is not a source-preserving IR! All comments and nonstandard spacing would be completely removed from your code if you gave it a round trip through this format. That doesn't sound like 99.9% source recovery to me...
- gobdovan 7mo agoThe 99.9% is less impressive than you'd think, currently they're not even keeping the same program behaviour 0.1% of the time. They also mention AST in the pipeline, not CST, so I wouldn't expect source-preservation to be a direct goal. Also, if you use a nonstandard spacing, I'd say that's on you to preserve a mechanical Source-AST mapping if you want to use any tool that mentions dataflow analysis & transforms. As a side note, comments are much trickier than non-standard spacing if their positioning is semantic.
- fg137 7mo agoEspecially as JSDoc is used for type annotations and even type checking in some projects. It's not in ECMA standard but widely used and well supported. The IR as it is implemented today will run into serious trouble.
- throawayonthe 7mo agothe comments are preserved afaict from replies in that thread