Hacker Newsnew | past | comments | ask | show | jobs | submit | erminpour's commentslogin

Jack Welch's legacy

"We are rewriting the mold linker in Rust and adding linker script support so that mold can link essentially anything GNU ld can, including kernels and embedded programs."

Legitimate question, why not just use GNU ld? Does link time take so long that it requires a complete rewrite?


GNU ld is indeed extremely slow, it is a very old codebase that isn't designed for modern systems, and it doesn't do any real work in parallel. GNU ld can be 2-10x slower than LLVM lld on real projects, and then mold is again ~5-10x faster that lld. The creator of mold is also the original creator of LLVM lld.

Traditionally the link time was a single-threaded step at the end of compilation, and it scaled very poorly. While compilation is embarrassingly parallel and has continued to scale. So link time was becoming a significant bottleneck, especially with incremental compilation. When you want to iterate on a large project, with GNU ld you might have to wait several minutes of link time on every dev build.


"...it doesn't do any real work in parallel." I think this is the biggest selling point.

Although, "with GNU ld you might have to wait several minutes of link time on every dev build." Meh, I might prefer to wait a few minutes and stick with something I know works.

"The creator of mold is also the original creator of LLVM lld" That's cool, why not implement these features in LLVM lld? Why not implement them in GNU ld? Is it a gatekeeping thing? Parallel ld would be very useful.

Also, why Rust?


No, it's not a gatekeeping thing. You're coming at this with negative assumptions, so I don't think I can try to convince you. If you hate Rust and want something conservative, then use lld. It has some parallelism, but it's fairly coarse and still has single-threaded bottlenecks. It would have needed a pretty major re-architecture to modernize it.

As for trying to do that in BFD, patches welcome. Or maybe not welcome, I'm not sure the maintainers are really looking for a major redesign of GNU ld. But either way I'm not volunteering, it's much easier to start fresh than try to carve out and replace the entire guts of this old thing.


"You're coming at this with negative assumptions" not so much negative as skeptical. Everyone is pushing Rust and full rewrites, I'm still not convinced.

"But either way I'm not volunteering, it's much easier to start fresh than try to carve out and replace the entire guts of this old thing."

Fair enough :D


"I think this is long overdue, given that many large programs have already adopted mold. It has been used in production for years."

That's not a good reason to replace GNU ld with mold, I'm still skeptical about rewriting EVERYTHING in Rust. What's the real reasoning? Who's pushing this so much?


Yay, I guess? It's impressive that AI can build something like this, but do you really understand how all the components work?

AI is really good an taking what we already know and producing something that works, but what about new innovations?

With all that said, this is still pretty cool.


Yes, I'm old now and have learned all the foundational computer and hardware engineering topics the hard way over 30 years. I've earned my AI tokens of freedom. :)


Probably also learned some stuff making this that you wouldn't have learned if you never made it.


AI code increases productivity and reduces understanding.

If it is a project like this, that's cool. If you are deploying the safety control system on a power plant, you had better have a damn good understanding!


"If we want more systems software to benefit from memory safety, we need better ways to reduce the cost and risk of migration."

What about using CHERI or Memory Tagging? Rewriting an established and mature codebase seems like the wrong approach.

This seems less like "We want to prevent memory errors." and more like "We hate C, we want Rust."


These technologies are cool and good and useful but they do something different than Rust: they catch problems at runtime and mitigate the bad effects, rather than preventing them at compile time.


CHERI doesn't exist (Morello isn't available) and memory tagging is not a thing on most processors (especially not server or embedded which are where most Linux runs). Apple's MIE needs Asahi to reach M5 which won't happen for some years, and ARM servers are still quite new.

Meanwhile, Rust structurally enforces memory safety. It's simply a better option than C in many cases -- C needs closer scrutiny, more third-party static and dynamic analysis, conventions differ much more wildly, far more expertise is required, the bar to safe contribution is much higher, code review is more difficult, I could go on and on but there are reasons to prefer Rust and it's not just cargo culting. Memory safety is a huge reason to want Rust, but also the type system, monomorphized generics, traits, the great first-party package manager and build system, better developer experience, clearer semantics, ... I could go on.

That said, there are also downsides to Rust, like hard reliance on LLVM, bad support for embedded or proprietary platforms, bad compile times, less flexibility in what is accepted by the borrow checker, more runtime checks and panics for safety, fragmented ecosystem, some basic things are "unstable", some semantics like pointer provenance still haven't been worked out after over a decade, semantics of borrowing are still in flux as well, bad interoperability with C++, etc.

Then there's the fanbase which can be absolutely insufferable, and show such zealotry that many people are turned away from Rust before even getting to honestly consider it, just because the fans can be so rabid.


I can image the moment Sir William Jones realized Sanskrit and Latin had a common origin. "Wait a minute...these can't all be coincidences." It's pretty mid-blowing.


My daughters are growing up bilingual in Persian and English. Totally fascinating to find the cognates; many are surprisingly close still (daughter/dokhtar, star/setare, cow/gav). It’s fun feeling like I could communicate basic ideas to a proto Indo European speaker based on those really distant cognates.


It gets complicated by the preponderance of French loan words, although they tend to be for newer concepts such as car, elevator, etc.

There do also seem to be some genuine coincidences, such as sock it/saket, both being a somewhat forceful way to tell someone to be quiet.

But yes, Persian people and culture in particular has fascinated me due to the ancient, but not prehistoric, traces of a shared identity with Europeans, in contrast with its neighbors. It’s not something that gets a lot of attention in popular culture


The romance languages are closer to the indo Iranian ones than the Germanic languages from what I understand.


Apparently -tamo is a superlative, and 'gautama' means 'the one who has the most cows'.

There are reconstructed languages loosely based on proto Indo European. https://en.wikipedia.org/wiki/Sambahsa ## https://en.wikipedia.org/wiki/Atlantean_language ## https://en.wikipedia.org/wiki/Uropi


English: God gave us teeth; God will give us bread.

Lithuanian: Dievas davė dantis; Dievas duos duonos.

Sanskrit: Devas adadat datas; Devas dat dhanas.


And a fun extra one is that Lithuanian "gobti" is cognate with English "give"!


Another cool one, Svet in Russian and Schwet in Hindi, both meaning white/light and both being in names (Svetlana, Shweta)


I'm learning Spanish now after studying French and while I'm not fluent at all in Hindi or Marathi which I sometimes heard my family speaking growing up, the cognates are fascinating. The numbers are the most obvious. But even words like 'tu' (you) are the same in all the languages. Same with English and me as the first person.

Not to mention the verbs. Truly wild stuff to think no one noticed.


People noticed. They just didn’t come up with a theory of a common ancestor language. Or, in some cases, they assumed other European languages were originally heavily debased forms of Latin/Greek.


For a French, Spanish is not a particularly easy language. Italian is much closer to French, and easier to learn.


Even Computer Science graduates are having a hard time.


"Is That a Bad Thing?"

Is that a serious question? During the great Depression 48% of young adults were living with their parents.


Agreed, I wasn't crazy about the page headline either: "Moving Back Home After College? All Your Friends Are Doing It."


Thankless? People are straight up hostile!


This used to be called "Programming by Coincidence".


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: