frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Port React Compiler to Rust

https://github.com/react/react/pull/36173
47•boudra•1h ago

Comments

Trung0246•1h ago
Curious but can we use lean4 as port target instead of Rust?
jon-wood•1h ago
I'm sure its technically possible, you might need to provide a bit more context if you expect anyone to change course here and port it to a programming language approximately no one has heard of rather than Rust though. What makes you think that would be a good idea?
koito17•54m ago
> approximately no one has heard of

Just cause it isn't used for webshit doesn't mean "approximately no one" has heard of it.

Lean is pretty much the most popular language mathematicians use today for computer-assisted proofs. More mature audiences may know about Rocq, Isabelle, etc., but Lean was already popular enough for a few people I know to have written their PhD theses on it about a decade ago.

I think GP is joking about a port to Lean because that would at least produce a formally verifiable output.

HeavyStorm•45m ago
Oh, PhDs, you're right, that's not approximately no one... It's probably approximately one.

I like Lean (and more generally dependent types) but ffs Lean has a very, very small userbase for a project like this. GGP would have to really justifyv the benefits for such a switch.

bhy•16m ago
I don’t think lean4 compiled code is as efficient as rust. For verification purposes, there are some tools allowing formal verification of rust code.
willsmith72•1h ago
Are people actually using the react compiler?

Haven't heard about since ages ago when it was extremely slow

paavohtl•47m ago
We have used React Compiler in production for a large ecom / media website for about a year. Performance has been fine overall, and we haven't ran into any major bugs attributable to it in that time.
molf•33m ago
Yes absolutely.

It's brilliant: all useMemo and useCallback can be removed and you get the same runtime performance and then some, at the cost of only a slight increase in code size.

A small downside at the moment is the build time. This change will hopefully help address that because it will no longer depend on babel.

voidUpdate•1h ago
What is the react compiler written in currently?
LoganDark•53m ago
Uh, TypeScript?
iammrpayments•48m ago
I think they use something called “flow” last time I’ve checked, it’s like typescript but when I went to visit the website with more information it was so slow it crashed my browser.
LoganDark•44m ago
You may be right. I think Flow was a predecessor to TypeScript.

I just checked out Flow and woah. First-class syntax sugar for React. Maybe cool. (If it doesn't break catastrophically in a sane build system like Vite)

__jonas•35m ago
Are you sure? The React compiler is a fairly new addition to React, Flow is Facebook's old alternative to Typescript, but Typescript won the ecosystem in terms of broad adoption in the end. I think Flow is barely used today, I would be really surprised if they choose it for a new tool, even for a Facebook project.

You may be thinking about React itself, not the new compiler? I'm sure there must be some flow in there still from back in the day.

voidUpdate•25m ago
Isnt the benefit of rust that it's memory safe? Is typescript not?
ramon156•57m ago
I think it's fine to experiment, just communicate with your users and make sure its opt-in.

Seems like they kind of did that? The thread seems like people already were waiting on this, so that's positive.

LoganDark•53m ago
Why are they porting the Babel-isms? They should be using Oxc tooling directly, not hanging onto JavaScript parsers, IMHO -- isn't the benefit of porting to Rust that you can use fast native code?

It seems backwards that they are freezing the Babel AST into the interoperability contract and only using the more efficient native representations in an isolated fashion -- shouldn't it be the other way around?

molf•26m ago
OXC is not the only consumer, so using the OXC AST wouldn't particularly make sense? I thought it was pretty well explained in the PR:

> Note that the conversion from any AST into our HIR is complex, and we can only maintain one version. Hence we've aligned on using a Babel-like AST as our public API. Another key point is that we don't yet implement our own scope analysis (since the TS version of the compiler relied on Babel's scope analysis), so for now we require that the scope data be serialized. It's a denormalized graph, and some metadata has to be stored to associate nodes with scopes. We're open to feedback about the AST and scope representation - we iterated a bit just to get things to work, but it can be more optimal.

LoganDark•24m ago
I saw, I just don't understand the rationale for picking Babel over OXC or something else as the interchange format -- other than "we were already doing it this way". After all, you know what they say about temporary solutions.
molf•22m ago
So isn't not changing more sensible than changing to an arbitrary alternative?

The current developers surely are more familiar with the Babel representation than OXC, so why switch?

AbuAssar•29m ago
now we need to port angular compiler to rust!
Surac•21m ago
<something> rewrite to rust using AI sound like meme now.
giancarlostoro•6m ago
Speaks volumes to the strengths of the language, also speaks volumes that LLMs lift the barrier of entry for Rust programming, the borrow checker woes can be offloaded to the model, you focus on all the other programming logic.

Whats funny is I had been using Rust more with Claude because of this, and before Anthropic did their rewrite of Bun I tried a Rust rewrite of a C# project I had laying around (.NET 3.5 from back in 2008) it wasnt perfect but its nearly there now, mostly for fun, and I did it because for a little while I realized LLMs can be useful for more serious refactors, and figured it might be good for a language rewrite. Sure enough.

I think rewriting tooling that takes text and transforms it in a language like Rust is fine for JS projects, so is Go, which is why TypeScript is migrating to Go. The “free” optimized speed increases are worth it, at the temporary cost of dealing with the migration for a year or two, which with LLMs trims down the initial work into a week effort it seems? Wild.

LoganDark•22m ago
The benefit of Rust over TypeScript is that Rust is faster.

TypeScript is memory-safe, but you can't really control where the memory comes from. In Rust you have structs, traits, references and all sorts of things to control both your memory usage and your memory efficiency, and you just don't really get that in TypeScript. Plus, in Rust it's a lot easier to utilize multithreading -- JS is notoriously tedious to parallelize (message-passing between workers is a bit annoying compared to structured concurrency in Rust)

bandrami•18m ago
I think the benefit of rust here is that it's not hosted whereas typescript is
LoganDark
•
17m ago
What I mean is, if you're going to rewrite it in Rust, why rewrite Babel rather than leaning on the existing ecosystem. I know they're not actually rewriting Babel, just reusing the semantic layout of its AST, but it's feeling a bit like the MediaWiki parser situation to me (roughly "if we started from scratch today, we wouldn't choose to have it this way, but we started a different way before, and it's been a difficult path to get to where we want to be"). Maybe that's a fairly remote analogy but it feels similar.

Mercedes‑Benz starts large‑scale production of electric axial flux motor

https://media.mercedes-benz.com/en/article/bebac2af-acdc-465a-9538-adb0bf3d8ccf
122•raffael_de•3h ago•55 comments

macOS Container Machines

https://github.com/apple/container/blob/main/docs/container-machine.md
808•timsneath•10h ago•292 comments

Claude Fable 5

https://www.anthropic.com/news/claude-fable-5-mythos-5
2271•Philpax•18h ago•1761 comments

Port React Compiler to Rust

https://github.com/react/react/pull/36173
48•boudra•1h ago•27 comments

Upcoming breaking changes for npm v12

https://github.blog/changelog/2026-06-09-upcoming-breaking-changes-for-npm-v12/
385•plasma•14h ago•153 comments

AWS Bedrock to require sharing data with Anthropic for Mythos and future models

86•TomAnthony•2h ago•31 comments

Rich Sutton on AI creativity and discovery

https://twitter.com/RichardSSutton/status/2061216087744946656
129•yimby•8h ago•65 comments

Reviving Papers with Code

https://paperswithcode.co/
34•nielz_r•2d ago•6 comments

German ruling declares Google liable for false answers in AI Overviews

https://the-decoder.com/landmark-german-ruling-declares-googles-ai-overviews-are-googles-own-word...
604•ahlCVA•9h ago•349 comments

RIP software hackathons. Long live the hardware hackathon

https://blog.oscars.dev/posts/rip-software-hackathons-long-live-the-hardware-hackathon/
187•ozcap•12h ago•85 comments

Vibe coding my way to a healthy family: Introducing Gamow Labs

https://www.ddmckinnon.com/2026/06/09/vibe-coding-my-way-to-a-healthy-family-introducing-gamow-labs/
135•dmckinno•7h ago•62 comments

Ultrafast machine learning on FPGAs via Kolmogorov-Arnold Networks

https://aarushgupta.io/posts/kan-fpga/
234•ag2718•15h ago•34 comments

What it feels like to work with Mythos

https://www.oneusefulthing.org/p/what-it-feels-like-to-work-with-mythos
291•swolpers•17h ago•244 comments

Magnetoelectric antennas could transform how underwater robots talk

https://newatlas.com/engineering/magnetoelectric-antennas-submarine-robots-communications/
9•breve•3d ago•3 comments

Surprise, Pay $1000

https://forestwalk.ai/blog/surprise-blacksmith-costs/
180•apike•13h ago•68 comments

The oldest surviving animated feature film at 100

https://www.bbc.com/culture/article/20260603-how-a-26-year-old-german-woman-made-the-worlds-oldes...
116•1659447091•3d ago•15 comments

I Thought I Knew How Electrolysis Worked [video]

https://www.youtube.com/watch?v=eq7fR9ISuCw
35•tambourine_man•4d ago•2 comments

Show HN: macOS menu bar gauges for your Claude Code quota

https://github.com/grzegorz-raczek-unit8/claude-quota
3•grzracz•1h ago•0 comments

More Molly Guards

https://unsung.aresluna.org/more-molly-guards/
136•zdw•3d ago•15 comments

OpenCV 5 Is Here: The Biggest Leap in Years for Computer Vision

https://opencv.org/opencv-5/
769•ternaus•4d ago•139 comments

If Claude Fable stops helping you, you'll never know

https://jonready.com/blog/posts/claude-fable5-is-allowed-to-sabotage-your-app-if-youre-a-competit...
840•mips_avatar•13h ago•410 comments

Lies we tell ourselves about email addresses

https://gitpush--force.com/commits/2026/06/lies-we-tell-ourselves-about-email/
123•theanonymousone•1d ago•119 comments

Premature Optimization Is Fun Sometimes

https://invlpg.com/posts/2025-06-19-premature-optimization.html
37•throawayonthe•2d ago•11 comments

CEOs who think AI replaces their employees are just bad CEOs

https://www.techdirt.com/2026/06/09/ceos-who-think-ai-replaces-their-employees-are-just-bad-ceos/
690•speckx•16h ago•252 comments

Grit: Rewriting Git in Rust with agents

https://blog.gitbutler.com/true-grit
148•cbrewster•15h ago•222 comments

European sentiments towards the US hit an all-time low

https://ecfr.eu/publication/home-alone-europeans-are-ready-to-defend-themselves/
65•marcyb5st•2h ago•42 comments

A giant star may have destroyed itself in one of the rarest explosions

https://phys.org/news/2026-05-giant-star-destroyed-universe-rarest.html
189•wglb•1d ago•29 comments

Computer Lessons

https://technicshistory.com/2026/06/06/computer-lessons/
16•cfmcdonald•1d ago•0 comments

Test-case reducers are underappreciated debugging tools

https://tratt.net/laurie/blog/2026/test_case_reducers_are_underappreciated_debugging_tools.html
126•ltratt•23h ago•15 comments

Making Graphics Like it's 1993

https://staniks.github.io/articles/catlantean-3d-blog-1/
875•sklopec•1d ago•147 comments