[Lazarus] Parser

Marco van de Voort marcov at stack.nl
Thu Jul 1 08:23:47 CEST 2010


On Thu, Jul 01, 2010 at 01:36:56AM +0300, Adem wrote:

> > I think these "pie in the sky" kind of scenarios are several years if
> > not longer beyond the initial C compiler.  It will be a plant that needs
> > a lot of nurturing and care for a very long term, before it becomes an
> > alternative, and faces stiff competition.  And there is another problem
> > that the "pie in the sky" scenarios seem to be the main reasons for the
> > compiler, so it will require quite a pigheaded team.

> Of course, such stretched scenarios will take time --if they ever
> materialize.  But, we can never know; perhaps there's already someone
> brilliant enough in the crowd here who's looking for some such feat pull
> and later use it as part of his/her CV.

There is a difference between hope and dreaming. Be careful that you don't
get hung up in some scenario where you "wait" for people to come, or wait
till the hordes come and help out in the purest open source spirit.

Somehow that never happens.

> > If these rosy C helps Pascal interoperability scenarios are possible at all. Kylix uses Pascal bindings to libc, despite Borland having a (compatible!) C/C++ compiler.  And C++ compatible Delphi code is stuffed top till bottom
> > with {$externalsym xx} and similar helper commands
> I am curious: Since compilers are your domain, allow me to ask: Do you 
> think Borland did that (peppering code with '$externalsym xx ' stuff) 
> because there was not other/better way? And, if you had a truly 
> compatible C/C++ compiler, would you end up doing that too?

I fear so. The trouble is that I think that joining two so different
languages (I mean as far as interfacing goes, e.g.  C's big reliance on
preprocessing that is very freeform and has no automated equivalent) totally
transparently is very, very difficult. Maybe even not possible.

Personally, I would invest more time in this before I went on a wild goose
chase, and question why there are no quality automated translators already,
after these languages have been side by side for 4 decades.

The pie in the sky scenarios might turn out to be attractive on paper only
e.g.  when only a very small subset of headers might be readily usable
without heavily adding finely grained directives. 

Borland had a commercial C++ compiler, commercial Pascal compilers,
knowledge in the company, and they didn't. I think they suspected that
something fully automated would never be possible, and keeping it lowtech
and transparents makes it doable for more users.




More information about the Lazarus mailing list