[lazarus] About compatibility???

Michael Van Canneyt michael.vancanneyt at wisa.be
Fri Mar 8 07:43:07 EST 2002




On Sat, 9 Mar 2002, Matjaz Mihelic wrote:

> Mattias Gaertner wrote:
>
> >On Fri, 8 Mar 2002 09:43:14 +0100 (W. Europe Standard Time)
> >Michael Van Canneyt <michael.vancanneyt at wisa.be> wrote:
> >
> >>>Since it is impossible to translate any c header file to good pascal code, the current h2pas is the better solution.
> >>>I would like to add a h2pas frontend to the IDE, so that using c libraries will become much easier. But before that, h2pas must be improved.
> >>>
> >>What is missing in h2pas ? (except a preprocessor :) )
> >>
> >
> >:)
> >
> >If someone does that, I will write a frontend for it.
> >
>
> What is missing?? Let's look at the thing from the right angle. I've got
> somelibrary.1.1.2. Somebody else is having somelibrary.1.1.1. This two
> versions are not necesarilly compatible. But the case is the guy that
> made header translatoion had 0.3.1. Then he somehow stopedd posting
> updates. We lose nobody gains.
>
> My suggestion is to go dig deep further. Combine preprocessor with gcc
> or make this bastard, does something like that, so unit headers would be
> obsolete. Every got dam'n lib comes with devel. We'd gain instantly
> access to whole api.
>
> Let's see now there will be gtk2, how long will it take to translate
> headers, half of the time to gtk3, we always lose. We could do some good
> thing.

See my other mail for some serious obstacles to this approach.
If you can solve these without changing the compiler/language,
fine. If not: There is a problem :-)

Personally, I think that h2pas can be extended so it tries to do a
better job, and that it should be used to create 'temporary' units
which are produced on the fly.

The most I can agree with is to add a new keyword 'usesheader' to pascal:

uses unitA; UnitB;

usesheader libC1,libC2;

the compiler could then try to spawn h2pas to create a temporary unit
from the headers, which it then proceeds to compile to a real pascal
unit, which is then used in further compilation.

This does not compromise the pascal language, and should give all
flexibility to use C libraries.

As a side remark, and don't take this personal, but: please try not to use
offensive language. The use of offensive language diminishes the
credibility of a message. Not just yours, but anyones message.

(Unless you're posting a joke of course ;))

Michael.






More information about the Lazarus mailing list