Yes, the ledger.proto including the data.proto from ccore is supposed to be that. Indeed it doesn't currently represent comments but a while ago it was discussed to be able to do that, and to allow programmatic transformation on the parsed output and to reconstitute text, as well as round-tripping. It's never been done, but IIRC it was the next project on the cparser front.
I spent a good amount of time dealing with zero-copy C++ protos from Python and it wasn't obvious and more or less gave up. I'm hoping to restart v3 in Rust at some point and to maybe write a proto generator for a Rust-native data structure at that time. Well, you know, probably in retirement if I'm realistic, unless someone else does it. A few people have written decent Rust parser for the full Beancount syntax BTW. On Sun, Jun 9, 2024 at 6:52 PM Filip Filmar <fil...@gmail.com> wrote: > Hi. > > Perhaps this is a wrong-headed idea from the get go. I apologize if so. > > As asked in the subject - is there a language neutral IR for the > ledger, that isn't the freeform text format? I ask because I'd rather use a > different programming language for any beancount extensions. > https://github.com/beancount/beancount/blob/master/beancount/cparser/ledger.proto > is kind of that, except it does not preserve the include structure as far > as I can tell. > > One reason is I'm not that skilled with python. Another is that last time > I checked beancount pulls in a preposterous amount of python deps, each one > a potential dependency hell. This is of course not beancount's fault, but > it is something I worry about. > > Thanks, > F > > -- > You received this message because you are subscribed to the Google Groups > "Beancount" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to beancount+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/CAKaOXii_goRTnyCQyvKDms944S0dGT0i3C2%2BHOEpVSRU08u2dQ%40mail.gmail.com > <https://groups.google.com/d/msgid/beancount/CAKaOXii_goRTnyCQyvKDms944S0dGT0i3C2%2BHOEpVSRU08u2dQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhNG4XsAsqaK2Y1vyhJEkmo6yLbWi2PgCsPG1vXDGgv0Ng%40mail.gmail.com.