Hacker News new | ask | show | jobs
by WhereIsTheTruth 620 days ago
A language that is slow to compile can't be the future of anything

Waiting for your code to compile in order to be able to see how this new color looks, or this new font or this new title or this new game player speed feels, just is BAD, very BAD

You don't have to trust what i say

You can however trust facts

Here a real world example to verify that fact everyone can test at home

Clone this popular open source game written in Rust:

https://github.com/veloren/veloren

Compile it, `cargo build` easy

Insert "... an hour later .." meme

Nice, you got it to compile

Now change any value, just like a gamedev would do when he iterates on its game

Here for example, the strength of the lighting effect:

https://github.com/veloren/veloren/blob/master/server/src/cm...

Again, `cargo build`

Let us know, how long it took to compile on your machine

It took 17 seconds for me, 17!!! seconds!!!, just because i wanted to change the look of the lighting effect

Is this how you view the future of GPU/gamedev programming?

GPU/gamedev programming deserve better

Even gamers are sick of slow compilers

https://gameworldobserver.com/2023/04/07/shader-compilation-...

When fraudsters and propaganda takes over tech, that's what you get

7 comments

> Clone this popular open source game written in Rust:

> https://github.com/veloren/veloren

> Compile it, `cargo build` easy

> Insert "... an hour later .." meme

Download the repo - 15m

Cargo fetch - 6m

Cargo build - 4m34s

How did you get to 4hrs mark? I have 5900x with 3600MHz RAM on fast SSD and win10.

Am I the only one on HN that gets semi-normal build times in Rust? Are you all running compilers on i386 or something? Is this on HDD?

I don't know whether Rust will ever be the right language for GPU programming, however your take feels somewhat unfair.

Please remember there's a lot of optimizations put in the legacy compilers.

What makes you think Rust compile times won't improve?

Also anyone who has worked on a significantly large C++ code base will be really happy about 17 seconds iterative compile times.
It was 17 seconds for 1 shader file.

Iterative C++ compile times can be very fast if you know what are you doing, 17 seconds is very long unless you have link time optimizations on(which makes no sense for an iterative build).

As far as I can tell they didn't change a shader at all, they linked to code that looks like it runs on the CPU as part of the main binary not as a shader.
It does make me wonder what the next Language of the Moment will be that has everyone on HN salivating, hailing it as the replacement for all else.
Comments like yours have been expressed for _9 whole years_ since Rust 1.0 released in 2015. Not so Language of the "Moment" anymore, eh?
>Insert "... an hour later .." meme

The same meme is true for C++ projects, yet I don't see people screaming C++ propaganda when Unreal Engine uses it for development.

Come on now. You are the same thing you complain about.

>When fraudsters and propaganda takes over tech, that's what you get

?

> Clone this popular open source game written in Rust.

What does this have to do with Rust GPU? A game is compiling slowly, I get that but what is the connection?

I ran `cargo fetch` first to remove the downloading time out of the equation.

Ran on arch (AMD R7 7800X3D).

First build:

> cargo build 2574.91s user 79.89s system 1341% cpu 3:17.84 total

After change:

> cargo build 11.97s user 1.62s system 176% cpu 7.719 total

After another change, this time with --timings:

> cargo build --timings 12.00s user 1.60s system 176% cpu 7.722 total

Unit | Total | Codegen

    1. veloren-server v0.16.0  4.9s  3.7s (75%)

    2. veloren-voxygen v0.16.0  4.1s  2.0s (49%)
...
I have 5900X, and I got like 4m34s build time on Windows (which should be slower).

What memory are you using? Are you overclocking? Are you using SSD?

I directly cloned to /tmp. 64GB ddr5, No overclock.

edit: (also, the machine was recently rebooted and had very few processes running)

After i posted the comment i tested on a laptop running windows with wsl (i7-12850HX 16c 24t) and the first build was going above 8 minutes.

So is /tmp a ramdisk? I have 64GB DDR4, but overclocked to double Infinity Fabric timings i.e. 3600 Mhz (it might be different for DDR5/ Zen4-5).

I ran this on MSVC toolchain on windows. With like 43% memory taken by various Firefoxe and IntelliJ windows.

Either compilers REALLY love CORES, or the Memory speed is causing issue :/

EDIT: Windows compilation 8min took less time than Linux 45min?

Yes, in linux there is a file system type called tmpfs which is mapped to memory (most of the time iirc).

> Filesystem Size Used Avail Use% Mounted on

> tmpfs 31G 22M 31G 1% /tmp

Try running `cargo build --timings`, it creates a report about build times. My guess would be storage speed, i would not expect memory speed to be that much of an issue.

edit:

> Windows compilation 8min took less time than Linux 45min?

I dont think i understood this correctly, but in the case you are asking (for clarification) about my compile times, i got around 3m:18s on linux, and around >8 minutes on WSL.

> Try running `cargo build --timings`, it creates a report about build time

Yeah, I got a bit longer time now, after `cargo clean `. Here are the timings: https://html-preview.github.io/?url=https://gist.githubuserc...

It's still strange win 10 was faster to compile on a worse CPU and worse memory :/

Maybe WSL has some issues that MSVC toolchain doesn't.

> I dont think i understood this correctly, but in the case you are asking (for clarification) about my compile times

Yes. I was confused by its output, i.e. 2541.91s