5 ms·
The Rust React Compiler is now native in Vite
- glouwbug 1mo ago[flagged]
- VertanaNinjai 1mo agoAs funny as this is I sometimes wonder about that crowd. Assuming the ecosystem at large flips and most software is now written in Rust what will the “rewrite it in Rust” crowd move to? Will they be satisfied for the most part or does it morph into “now rewrite in $latest_rust”?
- chmod775 1mo agoYou will always have someone say "you should rewrite it in x", but it's rare that something carves out so much ground on the Pareto front you'll get a crowd.
- wldcordeiro 1mo agoI think once you have it in Rust the next ask is using no "unsafe" code from that crowd.
- dhbradshaw 1mo agoI'd argue for moonbit -- faster compile times, almost as fast, smaller wasm artifacts and like lean can have proof of correctness built in.
- Svoka 1mo agowhat the point? Rewriting in Rust is not just a language change. Rust enforces designing systems in secure way to start with, not just memory safety. For me last nail into becoming part of the crowd was Embassy. Whole my life I wrote some ad-hoc C microcontroller stuff. But just learning Embassy I realized that it could've been done much more elegantly and securely. If you have a spare moment, I would watch videos in this channel, old to new: https://www.youtube.com/@therustybits/videos https://www.youtube.com/@therustybits/videos
- dhbradshaw 1mo agoI've been using rust since 2017 and still code in it professionally and am a fan. Moonbit is pretty cool too so I thought I'd mention it for other people who like cool things.
- ablob 1mo agoI think the crowd will split into those who just cared about it being rust and those who wanted some kind of leverage to tempt others into doing something. The former crowd will cease being, while the latter looks for something new to push. I believe that one does not need to be overly concerned here. As with most things you will never satisfy zealots so it is sufficient to reconsider every once in a while when the status quo changed enough to warrant the effort (i.e. the actual arguments change). It is always a choice to participate in these "culture wars" or whatever you want to call this. If you can stick to a decision you can limit the impact quite a bit, I've come to realize.
- anp 1mo agoI've never been someone to tell others to rewrite in Rust but I am a huge fan of the language and have in fact rewritten a lot of things in Rust. I'd be happy for another programming language to excite me as much as Rust has for the last 10 years, and then maybe I'd join that evangelism club instead :). Not sure how PL evolution is going to go in an era of coding agents though, very curious how that'll play out.
- MBCook 1mo agoMaybe they’ll go back to “year of the Linux desktop”
- steveklabnik 1mo agoBecause it became a meme virtually everyone who says this are actually joking and not serious. They'll move on to whatever the next meme is.
- twistedpalm 1mo agoAs funny as it is, it was removed by this miserable community :/
- prettycool 1mo ago[dead]
- adzm 1mo agoNo more babel in my compilation pipeline, yay!
- adzm 1mo agoUpdate: changed a pet project to use this instead of the babel approach. Literally just did the config changes in the article, no issues. Time from `npm run dev` to ready went from 6 to 2 seconds.
- Waterluvian 1mo agoIt’s just the best thing ever. Compiling at work took a minute for full builds with babel, and with rsbuild it now takes about 0.9 seconds.
- fishfasell 1mo agoRust is such an awesome language. The execution times are blazing fast.
- echelon 1mo agoI just wish Rust itself compiled faster. Serde, proc macros, it's all so slow. I'm going to start prototyping systems in Go, then porting them to Rust when they're more concrete. I feel as though the Rust code LLMs emit is generally higher quality than most other languages, perhaps due to the error handling being a chief concern of the language, but the iteration on making changes and running tests is so slow. Rust could grow into "the final language" if it wasn't so slow to compile. Assuming the WASM bridge also continues to improve.
- throw-the-towel 1mo agoLLMs being good with Rust makes sense, because the language itself gives you more safeguards than many others. What's good for the (human) gander is good for the (agent) goose.
- syspec 1mo agoDoes this work with reacts fancy new compiler that is meant to optimize away various hooks?
- ownagefool 1mo agoIf it wasn't obvious from the article, this is an implementation in the same thing in rust, ergo significantly faster. This was enabled, I presume, by the upstream react introducing code a rust version in source ( but they don't produce a standard binary last I checked )
- Onavo 1mo agoWhy does the Nextjs version of React compiler require a babel plugin when the vite version doesn't need it? Next.js is on SWC, not sure why they need a babel plugin.
- mexicocitinluez 1mo agoBecause it isn't supported by SWC yet.
- crypto137 1mo agoBecause next is the worsttttt
- Buoylog 1mo ago[flagged]
- vmsp 1mo agoOXC Transformers are amazingly faster than Babel. I'm building a framework (https://github.com/vmsp/flypath https://github.com/vmsp/flypath) for web, iOS and Android native development that's fully backed by OXC and Vite. Instead of transforming styles using Babel like StyleX, I just use OXC. Instead of Metro (React Native's bundler), which also uses Babel, it's just Vite. It's still very early but it's plenty, plenty fast.
- nwienert 1mo agoCool stuff. I'm moving One[stack.dev] onto pure rust now, and Tamagui v3 compiler will also is moving from Babel to Yuku which is quite interesting - from my testing it's more flexible and quite a bit faster than OXC.
- BretonForearm 1mo agoWhat's a react compiler? Not JS or TS?
- francislavoie 1mo agohttps://react.dev/learn/react-compiler/introduction https://react.dev/learn/react-compiler/introduction
- throw_m239339 1mo agoHand written React code is relatively slow when running so the React team made a React compiler to make it run faster. You might not see the difference with a toy app, but with a fairly large app, with a lot of IO it's a catastrophe if not compiled and optimized. It's the definition of overengineering IMHO. The problem is React at first place. Some other frameworks have in theory no compilation or optimization step while delivering constant performance as the app grows, like SolidJS. Since writing a compiler in JS also make compilation itself slow, then the React compiler was re-written in Rust... At the end of the day, React has a larger community and ecosystem so it's the industry "standard" for JS applications...
- pzmarzly 1mo agoWhy do people say SolidJS has no compilation? SolidJS 1.0 was already doing much more at transpilation time than just changing <h1> to h("h1"), and SolidJS 2.0 has a package called @solidjs/compiler: https://npmx.dev/package/@solidjs/compiler https://npmx.dev/package/@solidjs/compiler
- deleted 1mo ago[deleted]
- deleted 1mo ago[deleted]
- shikck200 1mo agoWebdev is the pinnacle of over engineering. And now with AI, it will get even worse. I think the web truly needs a reset.
- satvikpendem 1mo agoImproving speed is now overengineering apparently, but the same people would complain about how horrible web dev is if it weren't improved. Damned if you do, damned if you don't.
- throw_m239339 1mo agoBut bad performances stems from non compiler optimized React to begin with, its execution model when handwritten. Other frameworks don't necessarily take more effort to use and have better performances from the get go.
- satvikpendem 1mo agoA lot of them do have compilers too, like a couple of the most commonly cited React alternatives, Svelte and Solid, so I'm not sure why React specifically is singled out.
- rjzzleep 1mo agoIt's layers upon layers of indirection and then massive layers of optimization on top of it. What should happen is that we take the lessons that we learned from this current iteration of the web and desktop and turn it into a new generation while cutting out the crap we don't need.
- satvikpendem 1mo agoPeople are doing this already. Flutter is one example where it's compiled to Wasm. Other languages have Wasm web GUIs as well.
- onion2k 1mo ago
- pjmlp 1mo agoEventually we will be back to pre-node days, when compiled languages were the majority for JS tooling (C, C++, Java, C#,...), the yin yang of cool technology cycles.
- dzonga 1mo agorewrite it in rust might be a joke -- but damn most the massive improvements in dynamic language toolchains have come from the toolchains being rewritten in rust - Python, JS
- thephyber 1mo agoNow we rewrite the web in Rust WASM. /s But seriously, Python and JavaScript have reflection/introspection features. Once the investment was made to transcribe the entire language into a compiled language, the speed gains were obviously going to happen.
- pjmlp 1mo agoThey also exist in compiled languages without the performance impact of scripting languages.
- pjmlp 1mo agoThey are only surprising for anyone that never used any ahead of time compiled language since FORTRAN was introduced. The golden age of scripting languages being used for applications have setted us back a few decades.