Can D interface with Free Pascal?

Basile B. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Feb 8 10:48:51 PST 2016


On Thursday, 28 January 2016 at 04:26:26 UTC, Taylor Hillegeist 
wrote:
> Just curious... I had a thought that perhaps since Objective C 
> was a replacement for Pascal on the mac. that they might have 
> the same interface. but I'm not savvy enough with fpc to figure 
> out how to try it.

As said in the other posts you can link dlls or even object files 
produced by a D compiler. There is the D runtime to initialize 
and finalize, a particular attention must be put on te calling 
conventions, also some stuff like strings must be passed using 
toStringz() or received with fromStringz() (and Pchar() in 
pascal)...

One thing that's interesting is to develop let's say the GUI with 
Lazarus and use a core made in D. When you'll debug your 
application in Lazarus, and if an exception is raised within the 
object or the dll made in D, the integrated debugger will break 
and display the D source directly in Lazarus.

The first time it happend to me, I was **totally mesmerized**...

(I even made a post here: 
https://forum.dlang.org/thread/aeiwsnmsrchgmkbllqid@forum.dlang.org "//debugger breaks here": it was the Lazarus debugger who displayed a D source).

But actually it's totally logical, it's just the DWARF debug info 
that indicates the source name...




More information about the Digitalmars-d-learn mailing list