I made a simple prolog formatter for fun, maybe it can be useful for you 😊
I made a simple prolog formatter for fun, maybe it can be useful for you 😊
@vushu I just read your advent article https://raku-advent.blog/2023/12/19/day-19-autogenerating-raku-bindings/ and I wanted to bounce an idea off you.
We have code written in lang l1, and we need to output code written in lang l2.
Now, we use Raku's built in facilities to define a grammar for l1, and we define action methods to generate the output code in lang l2 which seems to be a lot of string manipulation.
Ideally, for such source to source translations (i.e. compilation), could we have higher level mechanisms, like the output grammar and it's unparsing actions.
l1 --parse-> ast --unparse-> l2
This way we can ensure that whatever final code artifact is generated it is valid (at least according to the defined grammar for l2).
So something like:
```
compile(codeL1, GrammarL1, GrammarL2)
```
should return the valid code artifact according to GrammarL2.
What do you think the ideal API for such a thing could be like?
Day 19 – Autogenerating Raku bindings! - Dan Vu