frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

The C to Rust migration book

https://mainmatter.com/c-to-rust-migration-book/
22•LukeMathWalker•3h ago

Comments

b40d-48b2-979e•1h ago

    and cheadergen, Mainmatter's tool for the reverse direction
So this is just an ad blogpost for the company.
marcoow•16m ago
cheadergen is an open source tool that our Rust lead wrote – not sth. we sell or anything
matltc•1h ago
I've spent a good amount of time with C, nowhere near mastery though. Is it worth still writing C, or better off just learning Rust if my goal is to write embedded/systems code?
cryo32•1h ago
Depends exactly what you mean by embedded but Rust isn’t as common as people make it out to be there. In some aread it’s almost entirely unheard of. C will be king for a while yet. There’s a lot of Ada floating around too.
greenavocado•1h ago
Depends on if your embedded system has a nice toolchain for it and/or how much suffering you are willing to endure. Another consideration is if you have to collaborate with others. Most programmers don't know Rust.
pornel•1h ago
Technically, absolutely.

Whether it would suit you, depends if you can learn to like Rust's approach of moving more work to the type system. In Rust you do certain things the Rust's way, period. Programmers used to C being unopinionated about everything find that objectionable.

uecker•39m ago
C is a tool which requires expertise but then goes out of your way and let's you do things, and do things rather efficiently, with no overhead, and exactly how you want. If you want it to cut off your arm it will do this too. But if you want to abstract things away behind types, this can also be done too (and arguable should be done more often in C). Somebody should write a C to more modern and safe C migration book.
matltc•4m ago
> moving more work to the type system

Sounds right up my alley. Thanks to you (and other siblings) for the thoughtful replies.

Aurornis•50m ago
Rust is worth learning, but your C skills will continue to be useful for embedded for a long time. Rust support in the embedded world is still growing and you will find yourself going between Rust and C on most projects unless you can carefully pick your platform for Rust support up front.

Coming from C I don’t think you’ll find Rust too foreign, once you internalize how the ownership rules work. In my experience the formal rules of Rust overlap a lot with behaviors that are good practice in C/C++ anyway, but there are some complicated concepts that you need to wrap your head around before expressing them in Rust becomes second nature.

0x457•30m ago
> embedded/systems code?

Depends on platform for embedded. It not very pleasant to write rust if you have to think about binary size. For systems code - sure, use rust.

yablak•58m ago
One link deeper is the actual content; can we link there instead?

https://mainmatter.com/c-to-rust-migration-book/course/

tallesborges92•46m ago
Please do a skill
TaupeRanger•31m ago
"Use Claude"

[the end]

malisper•15m ago
I made a comment about this yesterday[0], but there's been a massive increase in people migrating from C to Rust due to LLMs.

In contrast to what the C to Rust migration book is recommending (using FFI to integrate Rust with C), I've found it much easier to start from scratch. I recently finished a project where I rewrote Postgres in Rust[1]. For context, Postgres is about one million lines of C code.

On one attempt, I tried using c2rust to convert Postgres into unsafe Rust code. That attempt succeeded in terms of getting working "Rust" code, but any attempt to change any piece to safe rust, would require thousands of changes across codebase. Even though I had working Rust code, I found it infeasible to get to working idiomatic Rust code.

Instead what I found to be more effective was starting a new codebase and rewrite each file from the Postgres codebase into Rust one at a time. This allowed me to guarantee that at all times the new codebase was idiomatic and simultaneously I could make one pass over the Postgres codebase to get working idiomatic Rust.

YMMV, but I found it way easier to generate a whole new codebase from scratch rather than incrementally rewrite an existing codebase.

[0] https://news.ycombinator.com/item?id=48738985#48739882

[1] https://github.com/malisper/pgrust

TazeTSchnitzel•4m ago
The “Table of Contents” in the article (https://mainmatter.com/c-to-rust-migration-book/) looks like the very basic stuff and not especially interesting, but then the headings in the book itself (https://mainmatter.com/c-to-rust-migration-book/course/) look much more in-depth and don't seem to map onto the supposed ToC. I think they're misusing that term? I guess it's aspirational too as the book isn't finished yet.

For first time, a cell built from scratch grows and divides

https://www.quantamagazine.org/for-the-first-time-a-cell-built-from-scratch-grows-and-divides-202...
296•defrost•2h ago•88 comments

How We Made IPFS Content Publishing 10x Faster

https://probelab.io/blog/optimistic-provide/
46•dennis-tra•1h ago•5 comments

Physical disc production ending in Jan 2028 for new games on PlayStation

https://blog.playstation.com/2026/07/01/physical-disc-production-ending-in-january-2028-for-new-g...
239•Tiberium•5h ago•294 comments

Box3D, an open source 3D physics engine

https://box2d.org/posts/2026/06/announcing-box3d/
213•makepanic•5h ago•39 comments

Ask HN: Who is hiring? (July 2026)

39•whoishiring•2h ago•63 comments

Monetization Gateway

https://blog.cloudflare.com/monetization-gateway/
105•soheilpro•3h ago•30 comments

Internal Combustion Engine

https://ciechanow.ski/internal-combustion-engine/
107•StefanBatory•4h ago•9 comments

Ask HN: Who wants to be hired? (July 2026)

31•whoishiring•2h ago•87 comments

Apple 'Hide My Email' Vulnerability Reveals Peoples' Real Email Addresses

https://easyoptouts.com/guides/apple-hide-my-email-is-leaking-email-addresses
47•sashk•6h ago•4 comments

Fixing a kubelet memory leak in Kubernetes 1.36

https://heyoncall.com/blog/fixing-kubernetes-kubelet-memory-leak
16•compumike•15h ago•3 comments

Launch HN: Parsewise (YC P25) – Reason Across Documents with an API

29•gergelycsegzi•3h ago•20 comments

Meta loses bid to dismiss US states' claims that FB, Instagram addict children

https://www.reuters.com/legal/government/meta-loses-bid-dismiss-us-states-claims-that-facebook-in...
92•tartoran•1h ago•18 comments

Sony Deletes 551 Movies PlayStation Owners Paid For

https://reclaimthenet.org/sony-deletes-551-studiocanal-movies-playstation-owners-paid-for
198•bilsbie•2h ago•99 comments

Manufact (YC S25) Is Hiring a Developer Advocate in SF

https://www.ycombinator.com/companies/manufact/jobs/4cyWd6S-developer-advocate-partnerships-devrel
1•luigipederzani•3h ago

Red Programming Language: Static linking support

https://www.red-lang.org/2026/06/static-linking-support.html
49•em-bee•1d ago•6 comments

Asahi Linux 7.1 Progress Report

https://asahilinux.org/2026/06/progress-report-7-1/
441•pantalaimon•7h ago•145 comments

1-Bit Pixel Art Emojis

https://hypertalking.com/2023/05/15/1-bit-pixel-art-emojis/
52•surprisetalk•6d ago•7 comments

Reduce GVisor Cold Starts with GPU Snapshotting

https://cerebrium.ai/blog/reducing-gpu-cold-starts-with-memory-snapshots-restoring-cuda-workloads...
20•jono_irwin•54m ago•5 comments

FFmpeg 9.1's new AAC encoder

https://hydrogenaudio.org/index.php/topic,129691.0.html
10•ledoge•3h ago•7 comments

Nintendo has raised its employees base salary by 10%

https://mynintendonews.com/2026/06/26/nintendo-has-raised-its-employees-base-salary-by-10/
383•_tk_•5h ago•198 comments

Newly discovered spider builds spring loaded snare to catch ants

https://phys.org/news/2026-06-newly-australian-ballista-spider-snare.html
204•chimpanzee•2d ago•44 comments

Ray Tracer in SQL

https://github.com/ClickHouse/RayTracer
26•kbumsik•2h ago•6 comments

Most arguments are about ego, not ideas

https://wangcong.org/2026-06-30-why-i-stopped-arguing-with-people.html
535•backlit4034•3h ago•415 comments

Show HN: GolemUI – The new paradigm for JavaScript forms

https://golemui.com
12•wtfdeveloper•2h ago•20 comments

Department of Commerce has lifted export controls on Claude Fable 5 and Mythos 5

https://twitter.com/AnthropicAI/status/2072106151890809341
870•Pragmata•17h ago•572 comments

Solid and Clean Code never felt solid or clean to me

https://devz.cl/posts/solid-never-felt-solid/
9•DanielVZ•1h ago•2 comments

Show HN: PMB – local memory for coding agents that shows if it is used

https://pmbai.dev
7•oleksiibond•2d ago•3 comments

ArXiv's Next Chapter

https://blog.arxiv.org/2026/06/30/arxivs-next-chapter/
244•subset•14h ago•77 comments

Obfuscation: Building the final boss of cryptography (Part I)

https://vitalik.eth.limo/general/2026/06/29/obfuscation1.html
66•fbrusch•2d ago•9 comments

A retrospective of my time on the internet

https://cleberg.net/blog/internet.html
233•felixdoerp•6h ago•237 comments