dmd -run speed trends
Siarhei Siamashka
siarhei.siamashka at gmail.com
Sun Dec 10 08:45:29 UTC 2023
On Thursday, 7 December 2023 at 16:32:32 UTC, Witold Baryluk
wrote:
> Reference code:
>
> ```d
> #!/usr/bin/env -S dmd -run
> ```
This doesn't work nice from a read only directory:
```
$ pwd
/tmp/read_only_directory
$ ./test.d
Error: error writing file 'test.o'
$ rdmd test.d
John is 45 years old
Kate is 30 years old
3
9
15
xor
btc
mov
cli
afoo
```
But `rdmd` is much slower than `dmd -run`. As another possibly
better alternative, changing the boilerplate to the following
lines allows to use `dub` as a launcher:
```D
#!/usr/bin/env dub
/+dub.sdl:+/
```
The existence of the slow `rdmd` tool is a liability, because
some outsiders may judge D compilation speed based on `rdmd`
performance when comparing different programming languages.
More information about the Digitalmars-d
mailing list