Conversation

Jarkko Sakkinen

Edited 1 month ago
Having used Rust professionally for a while I can say that it is programming language that literally requires latest desktop CPU from AMD or Intel, or to be fully lean something like ThreadRipper. Minimum RAM is rather 64GB than 32GB.

I guess this is progress when a programming language has higher spec requirements than any of the AAA games I'm aware of ;-) No wonder they call Zed as "multi-player editor".

My work Thinkpad melts with Rust and my own M2 Mac Mini Pro (12 cores, 32 GB RAM) can just barely keep up in phase.

PS. I wonder how much compiling Rust code has an effect to the climate change annually ;-) With a Threadripper I could almost literally warm up my house just by compiling Rust.

#Rust #rustlang
6
1
6

@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.

2
0
0

@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+)

1
0
0

@jarkko Luckily the amount of programs compiled in Rust must be insignificant to the number of prompts given to ChatGPT.

0
0
0

@be_far

Isn't LTO "optimizations being done at link time", not "optimizing the time it takes to link"?

@jarkko

0
0
0
@be_far Yeah, this was good point actually. If I use sccache compilation is only few percent of the total build and linking takes > 90% even with the fancy mold linker is used...
0
0
0
@raven667 I don't want to spend 10k to use a fucking text editor if I'm totally honest with you :-)

My M2 Pro was the best specs version with about 3k price. That should still in 2024 perfectly good development machine. And it is neither too environment friendly to upgrade your hardware constantly only to write code...

That 3k was MOST I've ever paid for a computer.
1
0
1
@raven667 Also programming connects straight to giving equal opportunity to various groups of people. Most people cannot afford $10 k computer but most can afford e.g. laptop, which you can e.g. use to hack kernel with C ;-)

So yeah this is really a huge downside in Rust from my point of view, which cannot be ignored...
1
0
0

@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/

0
0
0

@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?

2
0
1

@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

1
0
1
@raven667 Damn, if I ever make a rap music video, instead of throwing dollar bills, I'll be writing Rust in that with a computer having the most expensive 12k ThreadRipper CPU ;---) Not very likely but now I have a plan!
1
0
0
@raven667 My career in mainstream hiphop is on hold on tho until 9xxx threadrippers are out...
2
0
0
@raven667 Also, I think your points are fair :-) Not necessarily disagreeing.

Zed has been BTW a great help browsing large projects. I don't know how its LSP engine is exactly implemented but it is probably caching the JSON data somehow. It can show immediately errors, warnings etc based on data and then it refreshes that. E.g. with my Thinkpad it helps a lot :-)
0
0
0
@raven667 BTW, I got confused with your 10 k comment because SGI workstation cost more like 50k-100k. Today expensive workstation would cost 10k-20k :-) So in that sense also high end is more affordable than ever.
1
0
0

@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.

1
0
1
@raven667 yeah, so no apologies needed. I think you got the post right, I was not 100% dead serious with the post in the first place :-) Sometimes you need to do posts like this just for ranting and blow some steam out of your system... Especially on stuff that you need confront at your work on daily basis...
0
0
1

@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 mastodon_oops

Pretty sure you can just adapt the configuration to your settings

1
0
1
@litchipi Yeah, actually it is the linking that is nasty given the build artifacts that Rust makes but yeah you have a point :-) This was mostly just my stupid ranting that helps me to get over the work day stress, that's the weight of this nonsense really :-)

This goes to non-scientific speculation at best but I'd figure that over the time more innovation will be done for the linking phase as you could probably take advantage (in caching) of the heuristics of the linking phase (blobs build a huge static blob) perhaps... Perhaps even doing some of the compiler backend work specifically targeted to Rust.
1
0
0

@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 !

0
0
0

@jarkko or - hear me out. Your employer's code could be improved.

1
0
1

@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.

1
0
0
@Aissen yeah that is what I'm doing small iteration at a time :-) i've read my joel on software in the distant past https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/

non taken! and my rants neither should be taken too seriously. i'm basically and idiot trying to find idiomatic patterns :-)
0
0
1