llvm-d

Moritz Maxeiner moritz at ucworks.org
Mon Mar 18 07:37:54 PDT 2013


On Monday, 18 March 2013 at 13:50:29 UTC, Jens Mueller wrote:
>
> I assumed OS X is Posix compliant. I never checked that though. 
> Thanks
> for the pointer.

No problem, OSX seems mostly Posix compliant. The shared 
libraries are suffixed with ".dylib", though, instead of ".so". 
There may be other differences you need to deal with, but that's 
the only one I ran into in my minimalistic approach.

> No problem. I can add this. It is easy to do. I didn't do it 
> because I
> wasn't sure which package manager will be the "official" one. 
> This
> hasn't been settled as far as I know.

You're right, of course, but at present time dub has a package 
registry and is easy to use, so I went with that. If, however, 
there is going to be an official package manager at some point in 
the future I'll change to that, then.

>> - Moreover, ddl doesn't seem to have support for loading from a
>> specific directory (such as "lib"), or at least I can't find it
>
> I don't know how this is done on Windows. On Linux you just set 
> the
> LD_LIBRARY_PATH.

My problem with that is that it's a) not encapsulated inside the 
program and b) OS dependent.

> Probably. There are very few users for such a use case.
> But if you would use LLVM's plain C interface in D users who 
> have used
> the API in C will feel home. I mean why expose the LLVM C API 
> as an
> addition. It certainly does no harm.

The C API will keep being exposed, of course; all I meant was 
that splitting them off might not be the best idea when they 
mostly exist only to be used by the D API and the C API should 
not be used unless you really want/have to.

> Usually, I use dynamic linking. I believe you would do the same 
> if
> optlink worked.

Maybe if optlink had worked with COFF when I started using D 
(back in D1 times), but right now, even if optlink would start 
working on win32 with COFF I'd still go with runtime loading as 
often as possible (Not counting D libraries with D classes in 
them, of course, only C API libraries). Mostly because this way 
you can start your programs with "rdmd program.d". No need to 
care at all about libraries: Getting a working compilation should 
imho be as simple as invoking the compiler with the source file 
that contains your main (or the root file of the library to 
create). Extra argument are necessary for specific configuration, 
but compiling should work with the least amount of extra argument 
as possible.

> The process is usually pretty simple. But the documentation is 
> lacking.
> There are several pieces floating around. I can try writing one 
> document
> and try to push it to the official web site.

That'd be great, thank you very much.

> Do as you like it. I do not think this is a bad approach.

I'll to that, then. I'm currently working on the D API, but I'll 
try to get the copied deimos compatible project started in the 
next couple of days.

- Moritz


More information about the Digitalmars-d-announce mailing list