January 30
On Tuesday, 30 January 2024 at 00:41:02 UTC, Walter Bright wrote:
> D has the advantage of simple persistence. With enough persistence, you can chop down an oak tree with a cauliflower.

I would prefer not to cut down an oak tree with anything.

So while I don't like your metaphor, I do think you have a point. I have had the impression that the Zig guys are a bit making it up as they go along. I wonder how many, Andrew included, have written compilers before this one. I don't know the answer. But if this is their first, it's likely part of the explanation for the problems.

I'm quite sure that your long experience in compiler writing has had a very positive effect on DMD's internals.
January 30

On Monday, 29 January 2024 at 23:14:50 UTC, Hipreme wrote:

>

On Monday, 29 January 2024 at 20:51:19 UTC, Don Allen wrote:

>

On Monday, 29 January 2024 at 08:04:57 UTC, Per Nordlöw wrote:

>

[...]

He thinks they have bugs because the compiler is too slow? That is truly remarkable.

[...]

You should have stayed more than 5 seconds on the video.

And you should mind your manners.

He

>

literally said that "Because it takes too much time to fix them. If we could reduce that slice of compiling time to almost inexistent, we could spend more time fixing the bugs".

"The compiler is too damned slow. That's why. That's why we have bugs. It takes too long to fix them". QED

January 30

On Tuesday, 30 January 2024 at 01:37:29 UTC, Don Allen wrote:

>

On Monday, 29 January 2024 at 23:14:50 UTC, Hipreme wrote:

>

On Monday, 29 January 2024 at 20:51:19 UTC, Don Allen wrote:

>

On Monday, 29 January 2024 at 08:04:57 UTC, Per Nordlöw wrote:

>

[...]

He thinks they have bugs because the compiler is too slow? That is truly remarkable.

[...]

You should have stayed more than 5 seconds on the video.

And you should mind your manners.

He

>

literally said that "Because it takes too much time to fix them. If we could reduce that slice of compiling time to almost inexistent, we could spend more time fixing the bugs".

"The compiler is too damned slow. That's why. That's why we have bugs. It takes too long to fix them". QED

I happened to read it as Hipreme but the original's phrasing is, IMO, less than stellar. Shaky enough that I'd not make strong claims either way.

January 30

On Monday, 29 January 2024 at 20:51:19 UTC, Don Allen wrote:

>

On Monday, 29 January 2024 at 08:04:57 UTC, Per Nordlöw wrote:

>

I'm glad Andrew too has realized in what order to fix things - we all should consider performance-problems bugs.

See:

https://youtu.be/5eL_LcxwwHg?t=565

He thinks they have bugs because the compiler is too slow? That is truly remarkable.

So, I'm not too familiar with Zig, and haven't used Zig much. However, at least on this specific point, he is very right, and this is something we were able to measure at scale at Facebook.

The question can better be asked in the following form: if we want to reduce errors, do we slow down development speed, in such a way that we can be more careful to not introduce problems at every steps along the way, or do we speed things up, such as it is faster to fix bugs, and therefore more can be fixed.

The usual answer most would give in the software industry is that one needs to slow down and be more careful. But this is not what the data ended up showing. Quite the opposite in fact!

When it comes to Zig, I am not sure how much development is slowed down by the speed of the compiler itself, but if this is a significant part of the dev cycle, then one has to expect that making the compiler faster will creates an environment in which there are fewer bugs.

January 30
It would certainly slow me down if the edit-compile-debug loop of the compiler was longer than a few seconds.
January 30
On Tue, Jan 30, 2024 at 12:25:24PM +0000, deadalnix via Digitalmars-d wrote: [...]
> The question can better be asked in the following form: if we want to reduce errors, do we slow down development speed, in such a way that we can be more careful to not introduce problems at every steps along the way, or do we speed things up, such as it is faster to fix bugs, and therefore more can be fixed.
> 
> The usual answer most would give in the software industry is that one needs to slow down and be more careful. But this is not what the data ended up showing. Quite the opposite in fact!
[...]

My experience confirms this.  When your code-compile-test cycle is slow, you tend to spend more time to write more code / make more changes before compiling and running it.  It's simple practicality: making only few changes means more compile cycles, which means more time spent waiting.  Making more changes means less time spent waiting for the compile cycle.

But since more changes are made, there's more room for bugs.  And the more changes you make means the more combinations you need to test before you discover failing cases.  Due to combinatorial explosion, the chances of catching these cases decrease exponentially the longer the compile cycle is.

When the compile cycle is fast, the incentives shift the other way: you make less changes before compile + test, so you get faster feedback on any obvious bugs in your changes. So problems get caught early and get fixed before they accumulate.  Your mind is also fresher when it's only a small amount of changes -- you still remember the details of what's happening, so you can fix it faster and more accurately.  And since there are less combinations to test with each small change, you're more likely to find failing cases early.

tl;dr: DMD's fast compile times is a killer feature.  It's why I still use it in spite of its suboptimal codegen.


T

-- 
Let X be the set not defined by this sentence...
January 30
On Tuesday, 30 January 2024 at 18:33:45 UTC, H. S. Teoh wrote:
> [snip]
>
> tl;dr: DMD's fast compile times is a killer feature.  It's why I still use it in spite of its suboptimal codegen.
>
>
> T

That's also why version-ing unittests is good. It lets you just run the UTs that you need to run. Got a new feature? Put a unique version just for that and run tests on those.

It gets trickier when you're dealing with features that go across multiple modules and such, but nothing that's not do-able. You can also combine them hierarchically if needed.
January 30

On Monday, 29 January 2024 at 08:04:57 UTC, Per Nordlöw wrote:

>

I'm glad Andrew too has realized in what order to fix things - we all should consider performance-problems bugs.

See:

https://youtu.be/5eL_LcxwwHg?t=565

Honestly the speed of dmd is a miracle I take for granted too often. It's more than just a convenience, it contributes to a harmonious state of mind that I have no doubt improves the performance of my work and the motivation to continue it. I don't doubt at all that, across a long enough period of time, bugs could statistically accumulate more in an environment with a painfully long build process than in a comparatively faster one. Even if you're a diligent coder and you always "do the job right" and make the appropriate tests and so on, there's always a point where you're getting up for coffee breaks on every CTRL-B, turning away from the screen, walking into a different room and resetting your mental frame, leading to ideas getting lost in the carpet instead of remaining fresh in your mind.

January 30
On Tuesday, 30 January 2024 at 00:41:02 UTC, Walter Bright wrote:
> D has the advantage of simple persistence. With enough persistence, you can chop down an oak tree with a cauliflower.

Will you be livestreaming the next time you need to cut down a tree?
January 31

On Tuesday, 30 January 2024 at 17:12:56 UTC, Walter Bright wrote:

>

It would certainly slow me down if the edit-compile-debug loop of the compiler was longer than a few seconds.

Yes, of course it would. But would you attribute bugs accumulating at too fast a rate solely to "the compiler is too damned slow" and make a public announcement about this epiphany?

The Zig compiler, which I've used a fair amount, including the new self-hosted non-llvm version, is not as fast as DMD, but it's not that far off. It is nowhere near as slow as the Rust compiler or GHC. Neither the Rust project nor the GHC project is accumulating bugs at the rate the Zig project is.