News for hackers. Stuff that matters.

alphaglosined

Re:DConf 2026 in London on Wednesday July 29, 2026 @05:23AM (#49095122)
I created the D version of the value type exceptions proposal.

In the end, it was DOA due to compiler architecture, so that was the end of that beautiful design.

I've had to accept result types is about as good as its going to get, all that is missing to make them nice is unwrapping support in if statements. Which I too have a proposal for and implemented it. But alas politics.

Re:Sir Tony Hoare has died on Wednesday March 11, 2026 @05:33PM (#47342292)
It is more widespread than you may realise.

That work contributes to static analysers' data flow analysis algorithms and is very widespread, even if it's in a limited capacity.

C#, gcc, clang, and even dmd, with my fast DFA engine, utilise it.

We can't all be using Astrée, far too expensive ;)

Re:I spent a year of my life making an ASN.1 compiler in D on Friday October 24, 2025 @03:28AM (#45691877)
Getting a web framework into the standard library is something I want to get working, along with a windowing library.

Currently we need to get a stackless coroutine into the language, actors for windowing event handling, reference counting and a better escape analysis story to make the experience really nice.

This work is not scheduled for PhobosV3 but a subset such as a web client with an event loop may be.

Lately I've been working on some exception handling improvements and start on the escape analysis DFA (but not on the escape analysis itself). So the work is progressing. Stackless coroutine proposal needs editing, but it is intended to be done at the start of next year for approval process.

Re:I spent a year of my life making an ASN.1 compiler in D on Friday October 24, 2025 @03:23AM (#45691842)
Indeed the GC is just a library with some helpful language hooks to make the experience nice.

If you understand how it's hooked into, it's very easy to work with. There is only one area of the language related to closure context creation that can be unexpected.

Re:I spent a year of my life making an ASN.1 compiler in D on Friday October 24, 2025 @03:17AM (#45691810)
Ldc like dmd ships lld and mingw import libraries and has for a few years now.

They both work out of the box without MSVC installed.

It's only ImportC feature that requires MSVC. The work required to get clang working in its place hasn't happened yet.

Re:I spent a year of my life making an ASN.1 compiler in D on Friday October 24, 2025 @01:26AM (#45691074)
The following statement originates from Adam Wilson who is heading the PhobosV3 project, and I will second it.

The issues you have are examples of known problems that PhobosV2 has suffered under. Coroutines, for instance we would like to have in language, a proposal (me, not Adam) have already made one, but it's sitting till next year. Naming and interfaces issues are a big part of what will change in PhobosV3.

Re:Programming in D: Tutorial and Reference on Friday April 25, 2025 @07:27PM (#43799436)
Are you talking about "Issue 24254 - LDC crash on Epyc Bergamo"?

That was fixed within the week, with a notification given that it had been sent to the reporter.

Re:qsort.h – Quicksort as a C macro (2019) on Sunday May 07, 2023 @04:08AM (#35849045)
LLVM can do an awful lot with SIMD that isn't visible in clang.

We have experienced this with LDC in D.

What I've been told is that LDC produces better IR than clang (I haven't compared, I only know that LDC is practically magical from both mine and other peoples experiments).

About the only thing I've seen that has problems with inlining is inline assembly. Intrinsics are fine (which you don't need thanks to vectorization being practically magical as long as you do some annotations like assert and get the memory layout right).

Re:qsort.h – Quicksort as a C macro (2019) on Sunday May 07, 2023 @04:00AM (#35848983)
About a year ago I had a look at a C compiler for 16bit computers, featured in disk form on I think Adrian's digital basement YT channel.

The compiler was very basic, nothing like you'd expect from a compiler even from the dragon book.

So simple and it was a production compiler too!

Sadly I can't remember the name of it to reference here.

Re:Safer Linux Kernel Modules Using the D Programming Language on Thursday January 05, 2023 @03:49PM (#34266332)
Memory safety is broken up into a bunch of different categories. It isn't just one feature.

Yes D uses the GC for lifetime issues currently, but it does not need it for doing bounds checking, escape analysis or preventing common issues surrounding pointers. All of which are very useful things to have with or without the GC.

Just those features alone would prevent some pretty big name issues that have cropped up in C code over the years.

Re:Why is D's garbage collection slower than GO's? on Sunday October 30, 2022 @04:06AM (#33392272)
I know of a third GC implementation, by Rainer. Which is concurrent on Windows via snapshotting (but not in druntime).

http://rainers.github.io/visuald/druntime/concurrentgc.html

Re:Ali Cehreli Introduces Dlang at Northeastern U on Wednesday October 12, 2022 @01:32AM (#33173246)
I'm one of the moderators on D's Discord server.

We do our best to ensure everyone feels welcome to join in. Of course none of us have social media training and are just doing our best.

If something is going down and we are not taking action it may be because we are not aware of it being problematic and are always open to hearing complaints as they come up!

Re:Adding Modules to C in 10 Lines of Code [pdf] on Monday June 27, 2022 @03:26PM (#31899535)
But only for structs.

We really need to get actual reference counting into the language to cover classes properly as well.

It has been on my todo list to write a DIP for this for a while now. ~rikki.

Re:Teaching D from Scratch: Is it a viable first language? on Wednesday December 29, 2021 @05:55PM (#29731212)
Unless you are touching something like threads or exceptions, you probably won't use classes unless it expresses your data best.

So yes, perfectly usable without OOP or classes.

Re:Driving with D on Tuesday June 01, 2021 @12:55PM (#27357616)
Audio plugins like VST.

He created dplug, a framework for audio plugins in D a pretty great feat!

Re:Driving with D on Tuesday June 01, 2021 @12:52PM (#27357549)
No it wouldn't be fair to say that.

Lots of stuff exist specifically to help with onboarding people into the community. Like the recent announcement of adding a C parser into the frontend.

Re:Driving with D on Tuesday June 01, 2021 @12:46PM (#27357438)
You are stuck with dropping to @trusted and calling the appropriate allocator API.

Following that you will want to check for null ext. to make it actually @safe in practice and not just typed as such.

Re:Want to call C from Python? Use D on Wednesday February 19, 2020 @11:39AM (#22367144)
It is provided by dmd as part of the download.

You can also get soft copies (i.e. mobi, pdf) and the docs as part of the d-apt repository for debian.

Depending on the nature of distribution it is probably just in a different package (or the package maintainer needs yelling at).

https://d-apt.sourceforge.io

Re:Using D to Create the World’s Fastest File System on Wednesday December 05, 2018 @06:30PM (#18613843)
Nah, -betterC gives you an advantage over C. It isn't meant to give you an advantage over languages like C++. Its in the name after all ;)
Re:Using D to Create the World’s Fastest File System on Wednesday December 05, 2018 @06:28PM (#18613827)
We are working on improving scope atm which is quite an improvement. Tieing exceptions into it too to remove allocations.
Re:Using D to Create the World’s Fastest File System on Wednesday December 05, 2018 @06:26PM (#18613813)
That was 9 years ago and the second is no longer maintained (for about 2 years at this point).
You see, before D ever existed, Walter wrote a C/C++ compiler professionally. That is why he would like to see C improved. He has just as much interest in seeing it improved as you or I do. In fact, I would say he has more reason as he has dedicated a good part of his life towards it...
This article was not created based upon theory.

It was created based upon real world experience having designed and implemented it in D. Where all of your concerns have not been discussed in the years following that article (it was already in the language for about 8 years at that point aka the start and has been solidly proven to work in the exact same context as it would have done in C).

In D at least, you can grab the pointer by a simple .ptr and for length .length. To get a specific element, it is as you would expect &f[i] all nice and straight forward. But what if you want to create an array from malloc? In D that is easy, just slice it! malloc(len)[0 .. len]. And free is just as you would expect from above, free(array.ptr);