3 ms·
You should check out https://github.com/tweag/topiary https://github.com/tweag/topiary Yes, theoretically if you had ~identical grammars you could use it to do
by morgante 3y ago
You should check out https://github.com/tweag/topiary https://github.com/tweag/topiary
Yes, theoretically if you had ~identical grammars you could use it to do a full transpilation. There's a lot of challenges with that though. Writing a correct grammar for 1 language is complicated enough, but writing one for two where all your nodes and fields end up the same is likely insurmountable.
In practice, languages are either:
- Far enough apart that any pure AST transformation is insufficient and you need an AI component to produce usable output
- Close enough that you're better off just targeting the specific parts that differ and rewriting those while leaving the rest alone. I think GritQL can do well here.
- snthpy 3y agoAwesome, thanks. Big fan of the Tweag folks and Nix and Nickel so will definitely check it out.