bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison's semantic parsers


From: Hans Aberg
Subject: Re: Bison's semantic parsers
Date: Tue, 10 Oct 2000 19:27:49 +0200

At 14.07 +0200 0-10-10, Akim Demaille wrote:
>I think this is incompatible with the policy of the FSF which promotes
>C.  Richard, what would you say?

I do not think there is any reason of promoting C over C++ anymore, as C++
compilers have gome a long way, and do not have the problems a few years
ago.

>Anyway, Bison is still a small project, I don't think we'd win
>anything using C++.

>From the general point of view, one can program faster and more secure with
C++ even when dealing with more low level programming or simple
programming, such as in Bison. To mention such a simple feature that ease
up a lot is the C++ string class, in the standard library. In order to
avoid too much overhead when adding new characters one-by-one to a string,
one can say allocate only at sizes 2^n. -- Just as an example of what
features the user need not worry about.

There is one snag though when programming with C++, and that is that C code
can normally not call C++ functions, only vice versa. Thus, if say Bison
uses C++, it can perhaps not be used as a plugin or DLL, if the programming
calling it is written in C.

One other problem with C++, but probably not in the case of Bison, is that
it is extremely difficult to implement a conservative GC -- there is simply
no convenient way of finding the root set with in C++ proper. (The Hans
Boehm GC goes into the layer between C++ and the OS and does a root search
there, but this method is both OS dependent and not very efficient.) And
there is no support for threading and distributed programming, and it
difficult to implement functional programming unboxed elements in
combination with multiple inheritance, and some other such problems.

>        http://www.lrde.epita.fr/people/akim/download/Corbett.tz2

I will try to pick it down. Please note though that it is important to keep
the name extensions right, because those are used for correct file
conversion and action. For example, .tgz will be saved as a tgz, whereas a
tz2 will be open by an editor, which may then bomb...


  Hans Aberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]