August 21, 2020
On Friday, 21 August 2020 at 11:42:51 UTC, Mike James wrote:
> It compiled so fast at a demonstration to customers they thought it was broke...

That was me using D1 again after a while, it is virtually instant even for medium size programs.

For my little webassembly demo I made a couple weeks ago, when you do the "try it yourself" thing, it actually runs ldc on the input and sends the output to the browser right there. No caching or anything fancy... but since it compiles in 40 ms you probably barely notice.
August 21, 2020
On Friday, 21 August 2020 at 12:14:35 UTC, Adam D. Ruppe wrote:
> For my little webassembly demo I made a couple weeks ago, when you do the "try it yourself" thing, it actually runs ldc on the input and sends the output to the browser right there. No caching or anything fancy... but since it compiles in 40 ms you probably barely notice.

How big is that program?

Are you saying ldc's webassembly backend is much faster than its native (x86) backend?
August 21, 2020
On Friday, 21 August 2020 at 11:36:51 UTC, Per Nordlöw wrote:

> Well it's only a matter of having the time to add it.

Fair enough. I would have guessed that the reference compiler is the most commonly used and it's famous for being fast, most likley faster than DMD. Therefore I would expect anyone that compare compile time speed would pick the reference compiler first, not gccgo.

> What's the easiest way to install the reference/official toolchain on Ubuntu?

For the latest version, download the binaries from here: https://golang.org/dl/. Otherwise install the "golang" package using the package manager.

--
/Jacob Carlborg


August 21, 2020
On Friday, 21 August 2020 at 12:51:29 UTC, Per Nordlöw wrote:
> How big is that program?

Small, < 1000 lines, it is a little tetris game.

> Are you saying ldc's webassembly backend is much faster than its native (x86) backend?

No, the difference is probably because my custom druntime and stdlib are more minimal.

D as a language remains fast, but the stdlib has gotten slower to compile as time goes on.
August 21, 2020
On Friday, 21 August 2020 at 14:37:35 UTC, Jacob Carlborg wrote:
> For the latest version, download the binaries from here: https://golang.org/dl/. Otherwise install the "golang" package using the package manager.
>
> --
> /Jacob Carlborg

According to https://github.com/golang/go/wiki/Ubuntu

sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go

will get you the Go 1.15 on Ubuntu 20.04.
August 21, 2020
On Friday, 21 August 2020 at 14:37:35 UTC, Jacob Carlborg wrote:
> For the latest version, download the binaries from here: https://golang.org/dl/. Otherwise install the "golang" package using the package manager.
>
> --
> /Jacob Carlborg

I update compiler-benchmark with support for the reference go compiler. I'll update the numbers now. It will take a while. In the meanwhile you can evaluate it yourself using, for instance,

./benchmark --languages=D,Go --function-count=200 --function-depth=450 --run-count=1

DMD is still far ahead of Go aswell; about 2.5x faster on check and 10x faster on build for my contrived example.

I also added a script

    ./install-compilers.sh

you can use to install most of the compilers I use in my tests on Ubuntu 20.04.
August 21, 2020
On Friday, 21 August 2020 at 23:08:05 UTC, Per Nordlöw wrote:
> I also added a script
>     ./install-compilers.sh

Renamed it the more verbose

    ./install-compilers-on-ubuntu-20.04.sh
August 21, 2020
On Friday, 21 August 2020 at 23:08:05 UTC, Per Nordlöw wrote:
> ./benchmark --languages=D,Go --function-count=200 --function-depth=450 --run-count=1
>
> DMD is still far ahead of Go aswell; about 2.5x faster on check and 10x faster on build for my contrived example.

Here's the prel. Markdown-formatted table with ref Go compiler version 1.15 added:

| Lang-uage | Oper-ation | Temp-lated | Time [s/fn] | Slowdown vs [Best] | Version | Exec |
| :---: | :---: | --- | :---: | :---: | :---: | :---: |
| D | Check | No | 0.634 | 1.0 [D] | v2.093.1-538-ge9c22d712 | `dmd` |
| D | Check | No | 0.691 | 1.1 [D] | 1.23.0 | `ldmd2` |
| D | Check | Yes | 1.600 | 2.5 [D] | v2.093.1-538-ge9c22d712 | `dmd` |
| D | Check | Yes | 1.647 | 2.6 [D] | 1.23.0 | `ldmd2` |
| D | Build | No | 1.518 | 1.0 [D] | v2.093.1-538-ge9c22d712 | `dmd` |
| D | Build | No | 17.536 | 11.6 [D] | 1.23.0 | `ldmd2` |
| D | Build | Yes | 2.696 | 1.8 [D] | v2.093.1-538-ge9c22d712 | `dmd` |
| D | Build | Yes | 18.178 | 12.0 [D] | 1.23.0 | `ldmd2` |
| Go | Check | No | 1.554 | 2.5 [D] | 1.15 | `gotype` |
| Go | Check | No | 2.232 | 3.5 [D] | 9.3.0 | `gccgo-9` |
| Go | Check | No | 2.244 | 3.5 [D] | 10.2.0 | `gccgo-10` |
| Go | Build | No | 13.717 | 9.0 [D] | 1.15 | `go` |
| Go | Build | No | 53.743 | 35.4 [D] | 9.3.0 | `gccgo-9` |
| Go | Build | No | 57.711 | 38.0 [D] | 10.2.0 | `gccgo-10` |

August 23, 2020
On Thursday, 20 August 2020 at 23:57:09 UTC, oddp wrote:
> Same goes for good old ada. It has blazing fast compilation times in conjunction with gcc-gnat,

Nope. I just added support for it in compiler-benchmark. It is crazy slow:

    ./benchmark --languages=D,Ada --function-count=20 --function-depth=450 --run-count=1

gives

| Lang-uage | Oper-ation | Temp-lated | Time [s/fn] | Slowdown vs [Best] | Version | Exec |
| :---: | :---: | --- | :---: | :---: | :---: | :---: |
| D | Build | No | 0.150 | 1.0 [D] | v2.093.1-541-ge54c041a4 | `dmd` |
| Ada | Build | No | 9.031 | 60.2 [D] | 10.2.0 | `gnat-10` |

August 23, 2020
On Sunday, 23 August 2020 at 00:06:02 UTC, Per Nordlöw wrote:
> On Thursday, 20 August 2020 at 23:57:09 UTC, oddp wrote:
>> Same goes for good old ada. It has blazing fast compilation times in conjunction with gcc-gnat,
>
> Nope. I just added support for it in compiler-benchmark. It is crazy slow:
>
>     ./benchmark --languages=D,Ada --function-count=20 --function-depth=450 --run-count=1
>
> gives
>
> | Lang-uage | Oper-ation | Temp-lated | Time [s/fn] | Slowdown vs [Best] | Version | Exec |
> | :---: | :---: | --- | :---: | :---: | :---: | :---: |
> | D | Build | No | 0.150 | 1.0 [D] | v2.093.1-541-ge54c041a4 | `dmd` |
> | Ada | Build | No | 9.031 | 60.2 [D] | 10.2.0 | `gnat-10` |

Correction, should be

| Lang-uage | Oper-ation | Temp-lated | Time [s/fn] | Slowdown vs [Best] | Version | Exec |
| :---: | :---: | --- | :---: | :---: | :---: | :---: |
| D | Build | No | 0.163 | 1.0 [D] | v2.093.1-541-ge54c041a4 | `dmd` |
| Ada | Build | No | 1.596 | 9.8 [D] | 10.2.0 | `gnat-10` |

Builds are 10x slower than D.