Using FPC lib for Linux

I have many units written using FPC on Linux which rely on many FPC’s units and libs (sqldb, fpweb, etc). I’d like to use them with Island for Linux as well. Is it possible to use the vast and rich FPC’s units and libraries with Island (especially Oxygene, but other languages would be great too), instead of glibc, on Linux?

Thank you.

Good question. i guess the main problem would be the import, HeaderImported can import .h files, but not .pas ones, so you’d probably have to manually craft the .fx file for or libraries. That’s assuming FPCs libs expose standard, C-comopatible functions (there’s probably no chance that FPC classes will work).

But i’ll see what Carlo has to say about this on monday, this is more this area of expertise.

So, it’s easier for Element to import C libraries than from one of its own language variant? :blush:

FPC is no closer to Elements than C is. native binaries don’t have any meta data that describe their functions, so we the compiler can’t know what functions are exposed by a static library (or, to a degree, a dll). To know that, we need to import headers. C code is a very common form of header code, so we support it, FPC, not.

I mean in the source code level. You’ve been able to create a great modern Pascal dialect with its own compiler, I thought your compiler should be able to consume FPC or Delphi source code albeit requires some minor modifications (which you can provide another tool for that purpose).

It doesn’t, because FPC and Delphi are different languages than Oxygene. Would we be intellectually capable of creating processor for those if we wanted to? Sure. But they are still different languages, and the Oxygene compiler does not parse Delphi or FPC code. Header Importer would need to get an FPC (and/or Delphi) parser front end, to support what you;re asking for — which is something that until today we had zero requests or need for.

Nothing ironic about this at all.

I see. So, my many years of proven and tested Pascal codes (both in Delphi and FPC) means nothing and I have to rewrite them all in Oxygene from scratch. Alright then. I thought Oxygene is just another dialect of object Pascal like FPC and Delphi, so parsing FPC/Delphi codes (especially FPC as it’s an open source project) wouldn’t be too hard.

I know Oxygene is more modern and better in some aspects than FPC and Delphi, that’s why I’m considering Oxygene. But some people can’t just simply ignore their legacy codes and rewrite them all over again in Oxygene. It’d be a barrier if one want to adopt Oxygene into the existing projects.

sorry, i don’t see now this follows from anything i said.

I just realized that RemObjects got Oxidizer that is able to convert Delphi code into Oxygene. Why don’t you enhance it to be able to consume FPC code as well?

FPC got massive libraries on its repo for many kinds of purposes. For example, CRT unit (ncurses powered), SDL, OpenGL, JSON, spreadsheet (both OpenOffice and MS Office), fpWeb (web framework), etc. You may use them all to enhance Elements on Island, especially Oxygene.

because, 24 hours in the day, and all that.