logoalt Hacker News

Port React Compiler to Rust

97 pointsby boudratoday at 9:19 AM78 commentsview on HN

Comments

arcadialeaktoday at 12:25 PM

It's quite frightening to see how an enormous 120KLOC pull request gets merged at once with very little public discussion or coverage by the devs after just 3 months (which IMO is very little time in relation to the amount of code). There used to be extensive RFCs and series of conference talks long preceding changes this big, e.g. React Fiber.

I support wholeheartedly the move to AOT-compiled languages but it looks like paying off the cognitive debt is going to be brutal on whichever team gets to maintain it in the long run.

show 1 reply
molftoday at 11:20 AM

After bun [1] this is another high-profile project that was ported to Rust by extensively using LLMs.

Very curious to see how these rewrites play out. Is the LLM foundation solid enough to build upon and iterate on? Or does this cause projects to become unmaintainable because no person understands the implementation anymore?

[1]: https://news.ycombinator.com/item?id=48132488

show 2 replies
pjmlptoday at 11:56 AM

I love it starts with the usual hand waving,

> This is an experimental, work-in-progress port of React Compiler to Rust. ...

And then gets merged.

So after the craziness to use node on the backend, we are back to using compiled languages to compile Javascript assets and Web resources, just like Java and .NET were doing in the 2000's, however since it is Go and Rust it is cool, not the boring languages grandpas were using on their heyday.

show 2 replies
jchwtoday at 12:25 PM

If this works and passes all of the tests, then it seems like a done deal to me. LLMs are just too good at doing ports where they have a rigorous automated test suite or oracle to compare against. They're oddly bad at following instructions like "port this mechanically, exactly" - worse than a human for sure - but they seem to do a great job of sitting there and comparing results to find bugs for hours and hours. It's hard for me to imagine a world where they aren't used to assist ports, not just writing them but especially refining them.

I suspect this won't have as big of a shit storm as the Bun port in part just due to the input/output nature of the React compiler.

That said, while I use React still, I still have never tried the React compiler... So I have no idea how important this is. But you know, very few people are ever upset over faster iteration cycles or CI builds.

olalondetoday at 12:26 PM

Interesting how LLMs are possibly putting an end to the era where we were increasingly trading off machine performance for developer productivity.

mohsen1today at 11:42 AM

Shameless plug. I'm writing a TypeScript checker in Rust. It's not a port. I made this with a different architecture that hopefully once is done will be proven to be a better set of trade-off

https://github.com/tsz-org/tsz

willsmith72today at 9:57 AM

Are people actually using the react compiler?

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

show 6 replies
Suractoday at 10:41 AM

<something> rewrite to rust using AI sound like meme now.

show 2 replies
bingemakertoday at 12:26 PM

I'm curious how reviews happen for such huge PRs (120k lines). Do reviewers sit and go through all these changes over days?

show 2 replies
ramon156today at 10:06 AM

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.

bhoustontoday at 11:46 AM

So the port makes sense logically but how easy it is to contribute new features to it? Does the complex memory model (arena) impose complexity?

show 2 replies
Trung0246today at 9:46 AM

Curious but can we use lean4 as port target instead of Rust?

show 3 replies
voidUpdatetoday at 9:59 AM

What is the react compiler written in currently?

show 1 reply
LoganDarktoday at 10:10 AM

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?

show 1 reply
AbuAssartoday at 10:34 AM

now we need to port angular compiler to rust!

show 2 replies