Question from Bison's maintainer on the D backend

Bastiaan Veelo Bastiaan at Veelo.net
Sun Nov 18 22:23:16 UTC 2018


On Sunday, 18 November 2018 at 15:56:47 UTC, Andrei Alexandrescu 
wrote:
> Hello, Akim Demaille, the maintainer of the famed GNU Bison 
> parser generator, reached out to me with the following 
> (published with his accord):
>
> ====
> I’m the maintainer of GNU Bison, which is a parser generator 
> for C/C++ and Java.  A few years ago someone contributed a D 
> backend for Bison, but at that time, the investment in Bison 
> was low.  Now I’m spending time on it, and Richard Stallman 
> asked me to contact the « D community » to know whether there 
> would be interest for such a backend.
>
> Bison is a LALR(1), LR(1), IELR(1) and GLR parser generator.  
> It’s based on ye olde yacc, by it features several interesting 
> properties.
>
> Of course the D world already features several parser 
> generators, some being even embedded in the language and 
> benefiting from compile time function evaluation.  So it’s very 
> unclear to me if Bison would get some interest.
>
> What would you think about that?
> ====
>
> I wrote back that Bison is currently much more sophisticated 
> than the present alternatives in the D community, and that we'd 
> be interested in continued maintenance of the D backend for 
> Bison. Further discussion revealed:
>
> ====
> I would say that my first and foremost worry would be to 
> integrate something which is not used, and not maintained.  And 
> I am not a D programmer, so I would not be able to decide 
> whether his work was good or not, have it evolve with Bison and 
> releases of D.
>
> Also, something that somewhat worries me is that the D parser 
> was based on the Java parser, not the C++ one.
> ====
>
> More thoughts and reports from the community would be helpful. 
> If you are a current or former Bison user with the D backend, 
> or if you have an interest in contributing reviews and patches 
> for it,  please chime in.
>
>
> Thanks,
>
> Andrei

Without ever having seen a parser generated by the Bison D 
backend, and my last use of Bison itself being close to two 
decades ago, I too think that Bison’s sophistication is not yet 
matched by current D parser generators. We do have generators 
that are easier to use than Flex+Bison, which probably makes it 
more difficult to generate interest in (maintaining) a D backend. 
With the ever increasing C++ compatibility of D it would be 
interesting to know if and how well a parser generated by the C++ 
backend would work. Nevertheless I would expect that a dedicated 
D backend can produce nicer parsers with a nicer interface. 
Regarding being based on the Java backend: If the C++ backend 
relies on the preprocessor (I don’t remember) then that may be 
the reason why (as dpp did not yet exist). It would be 
interesting to know why being based on that backend is worrisome; 
What downsides does that imply?

I don’t think that I will be able to get involved in Bison (too 
far in development using Pegged) but parsers are fun and I hope 
that others have more valuable input on this matter.

Regards,
Bastiaan.


More information about the Digitalmars-d mailing list