@jarkko turns out “zero-cost abstraction” means “compile time cost abstraction”
For me it’s the linking that takes forever too. Even using lto and lld.
@jarkko I know this is maybe a bit of shitposting but do you think the resource usage is a fundamental property of the work the compiler _needs_ to perform to satisfy the language requirements, or is this something that profiling the compiler and reworking it to do less could change if more time was spent on compiler performance rather than language features or application performance? It's probably not a deal breaker today because the hardware exists and isn't ludicrously expensive ($10k+)
@jarkko Luckily the amount of programs compiled in Rust must be insignificant to the number of prompts given to ChatGPT.
@jarkko Rust may use a lot of energy at compile time, but it makes up for that by using much less energy at runtime in production:
https://thenewstack.io/which-programming-languages-use-the-least-electricity/
@jarkko damn, I knew I didn't write that well but couldn't quickly think of something better. I was thinking about how much power is affordable for $1-3k (Dell, Apple) vs the old days where $10k+ workstations (SGI, Sun) were necessary for some workloads like software dev, video editing/broadcasting, CAD, which are do-able with something you can purchase retail, if at the top end of the spectrum.
What I was really interested in was insight on whether the performance is fixable or fundamental?
@jarkko although your point could be taken that Rust is currently a rich man's, first world language for wealthy corporations and less accessible to independent individuals and new comers without the backing of money for multi-thousand dollar workstations. A refurb Thinkpad pulled from e-waste isn't going to cut it, iiuc
@jarkko I thought it was all about the Pentiums, baby https://youtube.com/watch?v=qpMvS1Q1sos
@jarkko yes, sorry about the confusion, in my head there is a line where below $10k is low/average/high-end computing, and above $10k is ridiculous computing unobtainable outside specialist industry, not available to even well-funded hobbiests and amateurs. Old SGI was in the unobtanium zone until it was obsolete on the secondary market, now it's a fun hobby to see how far back you can go and still support a modern full featured experience.
@jarkko Compilation is always the busiest phase, but you can tweak the options to ease it out.
You talk about programming the kernel in C on a laptop, back in the days I fried my laps doing this on my shitty old laptop just as much as compiling my big Rust project
Pretty sure you can just adapt the configuration to your settings
@jarkko Haha no worries, in any case that is a very valid critic on Rust !
Being a programmer in Rust, that's a tradeoff you need to make if you want to benefit from the language, it's up to the dev to choose !
@jarkko or - hear me out. Your employer's code could be improved.
@jarkko this lacks a smiley, because this is definitely cheeky and sarcastic ; but I've also worked on many professional projects where compilation time improvements are never a goal, so it grows boundlessly until someone looks at it and cuts it by an order of magnitude.