frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Building the Rust Compiler with GCC

https://fractalfir.github.io/generated_html/cg_gcc_bootstrap.html
111•todsacerdoti•6h ago

Comments

dwheeler•4h ago
It may not seem like it, but this is impressive progress. Getting a compiler to bootstrap at all is an accomplishment, especially for Rust since that depends on so many things working. Once it can reliably bootstrap, a lot of performance-improving steps can begin. Congrats!
aswanson•3h ago
I just started playing with rust again today. Godspeed.
Cogito•3h ago
Really great read.

Someone mentioned recently that the slowness of rustc is in large part due to llvm. I know that is probably orthogonal to the work here, but I do like the idea of building the compiler with different toolchains, and that there may be follow on effects down the line.

torstenvl•56m ago
It's slow because the borrow checker is NP complete. LLVM may or may not generate slower code than GCC would for rustc, but I doubt it's anywhere close to the primary cause of the lack of snappy.
almostgotcaught•44m ago
You're wrong it's been debunked that the borrow checker is any appreciable part of the compile time - Steve Klabnik actually verified it on here somewhere.

Edit: found it

https://news.ycombinator.com/item?id=44391240

JoshTriplett•54m ago
Depends on the workload, but yes, codegen is a huge part of the total compilation time.

That said, that doesn't mean LLVM is always where the fixes need to be. For instance, one reason rustc spends a lot of time in LLVM is that rustc feeds more code to LLVM than it should, and relies on the LLVM optimizer to improve it. Over time, we're getting better about how much code we throw at LLVM, and that's providing performance improvements.

saagarjha•2h ago
> Normally, debuing the compiler is fairly straightforward: it is more or less a run of the mill executable.

> In the bootstrap process, the entire thing becomes way more complex. You see, rustc is not invoked directly. The bootstrap script calls a wrapper around the compiler.

> Running that wrapped rustc is not easy to run either: it requires a whole lot of complex, environment flags to be set.

> All that is to say: I don’t know how to debug the Rust compiler. I am 99.9 % sure there is an easy way to do this, documented somewhere I did not think to look. After I post this, somebody will tell me "oh, you just need to do X".

> Still, at the time of writing, I did not know how to do this.

> So, can we attach gdb to the running process? Nope, it crashes way to quickly for that.

It's kind of funny how often this problem crops up and the variety of tricks I have in my back to deal with it. Sometimes I patch the script to invoke gdb --args [the original command] instead, but this is only really worthwhile if it's a simple shell script and also I can track where stdin/stdout are going. Otherwise I might patch the code to sleep a bit before actually running anything to give me a chance to attach GDB. On some platforms you can get notified of process execs and sometimes even intercept that (e.g. as an EDR solution) and sometimes I will use that to suspend the process before it gets a chance to launch. But I kind of wish there was a better way to do this in general…LLDB has a "wait for launch" flag but it just spins in a loop waiting for new processes and it can't catch anything that dies too early.

o11c•2h ago
Other ideas:

* Run the whole tree of processes under `gdb` with `set detach-on-fork off`.

* LD_PRELOAD a library that inserts the sleeps for you, maybe on startup or maybe on signal/exit.

Ideally, we'd have some kind of infrastructure to name and identify particular processes recursively.

jcranmer•2h ago
I have a LD_PRELOAD library that hooks SIGSEGV into spawning gdb on the process using the best guess for the process's terminal (which currently isn't very smart because I haven't yet needed to debug processes that do a lot of stdio redirection).
dtgriscom•1h ago
I love vicarious engineering.

The First Time I Was Almost Fired from Apple

https://www.engineersneedart.com/blog/almostfired/almostfired.html
83•chmaynard•2d ago•23 comments

Bitchat – A decentralized messaging app that works over Bluetooth mesh networks

https://github.com/jackjackbits/bitchat
156•ananddtyagi•4h ago•77 comments

Intel's Lion Cove P-Core and Gaming Workloads

https://chipsandcheese.com/p/intels-lion-cove-p-core-and-gaming
109•zdw•5h ago•0 comments

Nobody has a personality anymore: we are products with labels

https://www.freyaindia.co.uk/p/nobody-has-a-personality-anymore
251•drankl•5h ago•185 comments

Jane Street barred from Indian markets as regulator freezes $566 million

https://www.cnbc.com/2025/07/04/indian-regulator-bars-us-trading-firm-jane-street-from-accessing-securities-market.html
331•bwfan123•14h ago•186 comments

Show HN: I wrote a "web OS" based on the Apple Lisa's UI, with 1-bit graphics

https://alpha.lisagui.com/
283•ayaros•9h ago•96 comments

Building the Rust Compiler with GCC

https://fractalfir.github.io/generated_html/cg_gcc_bootstrap.html
111•todsacerdoti•6h ago•10 comments

Web3 Onboarding Was a Flop – and Thank Goodness

https://tomhadley.link/blog/web3-onboarding-flop
12•solumos•1h ago•19 comments

Southern Ocean Circulation Reversed

https://iefworld.org/SMOCreversal2025
4•crymer11•45m ago•0 comments

Ziglings: Learn Zig by fixing broken programs

https://codeberg.org/ziglings/exercises
4•todsacerdoti•22m ago•0 comments

There's a COMPUTER inside my DS flashcart [video]

https://www.youtube.com/watch?v=uq0pJmd7GAA
41•surprisetalk•4h ago•5 comments

Data on AI-related Show HN posts

https://ryanfarley.co/ai-show-hn-data/
249•rfarley04•2d ago•140 comments

I extracted the safety filters from Apple Intelligence models

https://github.com/BlueFalconHD/apple_generative_model_safety_decrypted
292•BlueFalconHD•8h ago•185 comments

Crypto 101 – Introductory course on cryptography

https://www.crypto101.io/
60•pona-a•7h ago•2 comments

Opencode: AI coding agent, built for the terminal

https://github.com/sst/opencode
151•indigodaddy•10h ago•34 comments

Get the location of the ISS using DNS

https://shkspr.mobi/blog/2025/07/get-the-location-of-the-iss-using-dns/
269•8organicbits•15h ago•76 comments

Functions Are Vectors (2023)

https://thenumb.at/Functions-are-Vectors/
167•azeemba•12h ago•81 comments

I don't think AGI is right around the corner

https://www.dwarkesh.com/p/timelines-june-2025
205•mooreds•7h ago•230 comments

Centaur: A Controversial Leap Towards Simulating Human Cognition

https://insidescientific.com/centaur-a-controversial-leap-towards-simulating-human-cognition/
20•CharlesW•5h ago•8 comments

Backlog.md – Markdown‑native Task Manager and Kanban visualizer for any Git repo

https://github.com/MrLesk/Backlog.md
102•mrlesk•8h ago•20 comments

Why Austin Is Falling Out of Favor for Tech Workers

https://www.wsj.com/podcasts/tech-news-briefing/why-austin-is-falling-out-of-favor-for-tech-workers/8bc9e026-76ef-46c8-933e-ec6901b3eb38
17•CharlesW•43m ago•5 comments

America has two labor markets now

https://www.axios.com/2025/07/06/unemployment-job-market-education-health-care
28•ryan_j_naughton•1h ago•14 comments

Lessons from creating my first text adventure

https://entropicthoughts.com/lessons-from-creating-first-text-adventure
37•kqr•2d ago•5 comments

The Private Agent Memory Fallacy

https://blog.getzep.com/the-ai-memory-wallet-fallacy/
4•roseway4•2d ago•0 comments

Show HN: A Language Server Implementation for SystemD Unit Files

https://github.com/JFryy/systemd-lsp
7•arandomhuman•3h ago•0 comments

Corrected UTF-8 (2022)

https://www.owlfolio.org/development/corrected-utf-8/
47•RGBCube•3d ago•39 comments

Metriport (YC S22) is hiring engineers to improve healthcare data exchange

https://www.ycombinator.com/companies/metriport/jobs/Rn2Je8M-software-engineer
1•dgoncharov•11h ago

Swedish Campground: "There are too many Apples on the screen!"

https://www.folklore.org/Swedish_Campground.html
53•CharlesW•4h ago•10 comments

Hannah Cairo: 17-year-old teen refutes a math conjecture proposed 40 years ago

https://english.elpais.com/science-tech/2025-07-01/a-17-year-old-teen-refutes-a-mathematical-conjecture-proposed-40-years-ago.html
377•leephillips•12h ago•86 comments

Thesis: Interesting work is less amenable to the use of AI

https://remark.ing/rob/rob/Thesis-interesting-work-ie
13•koch•7h ago•1 comments