January 31

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.

Uh..... what? A cauliflower? I've worked with cauliflower and I've worked with oak. I'm skeptical.

Is there a hyper-speed cauliflower launcher involved?

-Steve

January 31

On Tuesday, 30 January 2024 at 20:29:02 UTC, cc 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

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.

I see a lot of posts about the speed of dmd. I've been basically using ldc exclusively when I switched to mac M1, and, I haven't been very disappointed.

I'll say this, compiling my work project with dmd is 100x slower than compiling my personal projects with ldc.

I don't know if it's LLVM, is all I'm saying.

-Steve

January 31

On Wednesday, 31 January 2024 at 02:34:34 UTC, Steven Schveighoffer wrote:

>

On Tuesday, 30 January 2024 at 20:29:02 UTC, cc wrote:

>

[...]

I see a lot of posts about the speed of dmd. I've been basically using ldc exclusively when I switched to mac M1, and, I haven't been very disappointed.

I'll say this, compiling my work project with dmd is 100x slower than compiling my personal projects with ldc.

I don't know if it's LLVM, is all I'm saying.

-Steve

As dmd is x86_64, on Apple silicon it uses rosetta, so ldc which is aarch64 is faster as a compiler.

January 31

On Wednesday, 31 January 2024 at 01:24:35 UTC, Don Allen wrote:

>

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.

DMD version: DMD64 D Compiler v2.106.1 (linux x86_64)
Zig version: 0.12.0-dev.2341+92211135f [master] (linux x86_64)

both examples have:

void main(){}
pub fn main() void{}

Self-hosting compilers - peformance

$> hyperfine --warmup 5 'dmd -i hello.d' 'zig build-exe -fno-llvm -fno-lld hello.zig'
Benchmark 1: dmd -i hello.d
  Time (mean ± σ):     109.9 ms ±   1.6 ms    [User: 52.8 ms, System: 56.7 ms]
  Range (min … max):   108.1 ms … 114.3 ms    26 runs

Benchmark 2: zig build-exe -fno-llvm -fno-lld hello.zig
  Time (mean ± σ):     334.3 ms ±   3.5 ms    [User: 246.5 ms, System: 155.6 ms]
  Range (min … max):   329.1 ms … 342.2 ms    10 runs

Summary
  dmd -i hello.d ran
    3.04 ± 0.05 times faster than zig build-exe -fno-llvm -fno-lld hello.zig

Glossary flag:

  • -fno-llvm: replace llvm backend to zig backend [wip].
  • -fno-lld: replace llvm-lld (builtin) to zld (self-hosted zig linker).
January 31

On Wednesday, 31 January 2024 at 08:54:36 UTC, Paolo Invernizzi wrote:

>

On Wednesday, 31 January 2024 at 02:34:34 UTC, Steven Schveighoffer wrote:

>

On Tuesday, 30 January 2024 at 20:29:02 UTC, cc wrote:

>

[...]

I see a lot of posts about the speed of dmd. I've been basically using ldc exclusively when I switched to mac M1, and, I haven't been very disappointed.

I'll say this, compiling my work project with dmd is 100x slower than compiling my personal projects with ldc.

I don't know if it's LLVM, is all I'm saying.

As dmd is x86_64, on Apple silicon it uses rosetta, so ldc which is aarch64 is faster as a compiler.

Work project is built with dmd on x86_64 linux.

My point really is that LDC is comparable, and still lightyears ahead (in speed) of the likes of C++ and Rust. I don't know what Zig is planning to achieve by removing LLVM, but I am comfortable with the time taken so far. It helps to have 2 things to compare such that you can judge what the true benefit will be. I wonder if Zig has gone through that exercise, or is just undergoing this large upheaval on the hopes that it makes things much faster (Disclaimer, I'm reacting to posts here, I haven't watched the video).

In my experience, the thing that slows down compilation is the complexity of the code, especially when using templates/generative code. That is all front-end stuff. I'd rather we work on fixing that.

-Steve

1 2 3
Next ›   Last »