Hacker News new | past | comments | ask | show | jobs | submit login
A working D compiler on OpenBSD (briancallahan.net)
126 points by todsacerdoti 4 months ago | hide | past | favorite | 13 comments



I'm sorry I can't help but comment how awesome DLang is. Please promote this more on here. Wish I had the time to write open source projects around it, as I simply love this language. I'll reiterate it would benefit from a nice set of webassembly packages - the syntax is easy to pick up for anyone familiar with web languages, and it feels natural that DLang could dominate wasm libraries.



and my approach is to do a minimal custom lib

http://dpldocs.info/this-week-in-d/Blog.Posted_2020_08_10.ht...


From the article, it's interesting to note that D utilizes Thread-Local Storage (TLS) by default and that OpenBSD does not has support for the feature [1].

[1]https://www.oreilly.com/library/view/the-linux-programming/9...


Note that you can use D without TLS on scenarii that don't support it. TLS is a need of (parts of) the D runtime, which you can avoid if need be. This is painful, yet doable.


The older D compilers would emulate TLS for platforms that didn't support it, like the older Mac OS. That code is still in there somewhere.


He is using exactly that already.


D is just a wonderful language, with a super fast compiler and amazing feature set.

I only wish it had better debugging support.


Is D's value proposition that it's a better successor of C than C++? Because that's what it seems like to me from a quick read of the website.

But it also seems like D is not suitable for a lot of things that C++ is, like embedded applications. Also, it doesn't seem like support for Android and iOS is very good at the moment. So for portability, C++ is still the only choice.

D does seem really nice though, like a modern high level language, but with support for custom memory management, low-level system APIs, and even ABI compatibility with C. But I'm hesitant to build anything with it because as much as I loathe working in C++, it's still the safest bet by far.

Also, Swift seems like it has similar goals, but with Apple's full support behind it.


> But it also seems like D is not suitable for a lot of things that C++ is, like embedded applications

Not sure where you got this idea, as being usable for embedded programming is explicitly one of D's design goals. You can use D anywhere you use C++, and it is a much nicer language to boot!

> Also, it doesn't seem like support for Android and iOS is very good at the moment

I can't comment on this. There is support for both platforms IIRC, but I haven't tried writing apps for either in D.

> But I'm hesitant to build anything with it because as much as I loathe working in C++, it's still the safest bet by far.

I'm not sure what you mean by "safe" here. D has been around for over 20 years and isn't going anywhere anytime soon. The main difference from C++ is that the community is smaller, and it's a bit harder to get a job writing D (but not that much harder nowadays; there are a lot of people working for companies like Symmetry Investments, writing D every day).

> Also, Swift seems like it has similar goals, but with Apple's full support behind it.

Swift also seems like a very nice language, and I would probably be using it if D didn't exist. That being said, its metaprogramming capabilities are woefully underpowered to D's. From my experience, only the Lisp family of languages beat D in this area.


The one reason I've not done anything with OpenBSD is the lack of a D compiler. Maybe now I'll give OpenBSD a try.


what im really hoping for is extended attributes support again. i use them for a file tagging system i made (https://gitlab.com/finnoleary/koios) and dont really want to be on a computer without that


Well done, Dr. Callahan!




Applications are open for YC Winter 2022

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: