5

I have recently been reading up on the D programming language, and am interested in using it for a small application that would run on OpenBSD.

As far as I can see there is no OpenBSD port for the compiler, but I can see a reference to OpenBSD in the posix.mak file. I don't have an OpenBSD development environment handy at the moment, so before I go and prepare one I was wondering if anyone has tried developing with D on OpenBSD.

How did it go? Was it easy to setup? Are there any 'gotchas' to be aware of? Thanks in advance.

John Jeffery
  • 990
  • 5
  • 19

2 Answers2

3

The official druntime (for dmd) does not support OpenBSD. In order for everything to work properly with any OS with D, druntime must support it. It's possible that it would build for OpenBSD and work with some stuff (I don't know), but for it to really work properly, it needs to specifically support OpenBSD. There are a number of version blocks specific to OSes, and unless a version block for OpenBSD (or Posix) exists, then that functionality is missing, and won't work. If enough is missing, then nothing will work.

Now, druntime does vary on some level from compiler to compiler, as that's where the lower level, system-specific stuff goes (e.g. the C bindings to glibc and Win32). So, gdc and ldc have their own versions of druntime and may very well support OpenBSD. However, the official compiler, dmd, does not currently do so.

So, if you want to use OpenBSD with D, you're going to have to look at gdc and ldc. I believe that the gdc developers in particular have done some extra work to add additional OSes and architectures, since it's trying to get into gcc-proper, but I really don't know what exactly it supports at this point, and I have no idea what the current state of ldc is. However, there's a decent chance that they support OpenBSD.

Jonathan M Davis
  • 37,181
  • 17
  • 72
  • 102
1

I found only this: https://bitbucket.org/goshawk/gdc/src/b3b60fdac583/d/phobos/std/c/openbsd/openbsd.d
So, at least GDC(GCC frontend for D) have some OpenBSD support. But is it working - i couldn't say.
But you can try :)

Raxillan
  • 233
  • 2
  • 6
  • Yes, thanks for the link. It, like the posix.mak file I mentioned, hints that some attempt has been made to run this on OpenBSD. I will have a go at getting it to work, but I am still interested in hearing from anyone who has actually got a D development environment running on OpenBSD. – John Jeffery Mar 16 '12 at 05:39
  • @Raxillan: Stop spreading FUD. If you don't know enough about the current state of affairs, don't say anything - at least don't sound so certain. – simendsjo Mar 16 '12 at 15:09
  • @simendsjo Prooflinks, please - then i delete post. Ok? i'll be only really glad to know: waht D is already stable (no breaking changes), Tango was ported to D2, the rich IDE was created and so on. – Raxillan Mar 16 '12 at 15:24
  • @Raxillan: Tango has never been the standard library. The only language that only has a single version is a language that was dead on arrival. Several build systems support D. You should rather ask (to clear up your misconceptions) at http://forum.dlang.org/ – simendsjo Mar 16 '12 at 15:59
  • @simendsjo Ok-ok - i've deleted my post. How a C++-programmer I'd like D, really - but lack of information is bad helper on D'iving into D. See Qt documentation - it's excellent! P.S. What is most "official" development platform to D? i.e. compiler, std library, building system, and so on. This info helps to OP too. – Raxillan Mar 16 '12 at 16:48
  • @Raxillan: Yes, there is still missing a lot of documentation as D is not as mature as C++ or . The documentation (and standard library itself) for D2 is pretty good and improving by leaps every release. I've used D on linux and windows, and others are using it on osx, freebsd and probably other platforms. I'd say it's a much better experience on linux than windows at the moment, and will probably stay that way for some time. But D has gotten a lot better (more stable, libraries, docs etc), so it's ready for some serious testing - I'd wait for mission critical apps though – simendsjo Mar 16 '12 at 19:01