Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programming in D for OpenBSD

Tags:

d

openbsd

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.

like image 808
John Jeffery Avatar asked Oct 09 '22 09:10

John Jeffery


1 Answers

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.

like image 159
Jonathan M Davis Avatar answered Oct 13 '22 11:10

Jonathan M Davis