4 ms·
Why does everything need to be written in rust these days?
by zImPatrick 3y ago
Why does everything need to be written in rust these days?
- ramon156 3y agoAs a rust dev I'm just as perplexed. I've seen preprocessors and stuff like tailwind being rewritten in Rust aswell. Why though (
- mtsr 3y agoSome dev workflow tools really benefit from being very fast. And parsing and ast building and the like are actually things that rust is quite good for. That doesn’t mean it couldn’t be done in other languages, but it’s a weighing of trade-offs. And of course, groups of people, such as developers on socials, are quite sensitive to popularity.
- vsnf 3y ago> And parsing and ast building and the like are actually things that rust is quite good for. Having built a compiler and typechecker in Rust, I don't know if I'd say that it was "quite good" for it. Going back, I'd still do it again, but it wasn't exactly a cakewalk. Rust's lifetime rules and visceral hatred of referential structs did not make my life easy at all. I definitely took the easy way out with a lot of string copies too.
- dbrgn 3y agoJust as an example: Our eslint checks take 2 minutes to complete. Improving this would considerably improve developer productivity.
- fullspectrumdev 3y agoIf it speeds up a build/CI pipeline it’s a worthwhile investment for a lot of folks
- RamblingCTO 3y agoYou can get a big speedbump with go without introducing the overhead of object lifecycle management.
- xnorswap 3y agoYour sentence is confusing; a speedbump is designed to slow you down.
- RamblingCTO 3y agoHaha, you're right. I meant speed bump. As a German I'm used to chaining words together.
- xnorswap 3y agoIt wasn't the chaining that was an issue: https://en.wikipedia.org/wiki/Speed_bump https://en.wikipedia.org/wiki/Speed_bump . Perhaps "speed boost" would be a better alternative for your intended meaning.
- jamincan 3y agoInterestingly "bump in speed" would be fine, but "speed bump", means the exact opposite.
- deleted 3y ago[deleted]
- jasonjmcghee 3y agoIt isn’t in this context. “got a speed bump” vs “hit a speed bump”
- crabmusket 3y agoThen rewrite Prettier in Go and I'm sure people will use it :)
- biorach 3y ago> I've seen preprocessors and stuff like tailwind being rewritten in Rust aswell. Why though a) speed. On large codebases each preprocessor (and there may be many) can take a long time b) Rust has several features which make it quite suitable for writing pasrers and suchlike
- Tade0 3y agoAs a (nominally) front-end developer the RIIR movement's energy is similar to how the front-end community approaches things. Overall Rust and its community have many traits that make them very approachable to people not expected to know anything about systems programming, namely: -Package manager with a familiar philosophy behind it (and not the sort of hell you have to deal with setting up a C++ development environment). -Outputs WASM without much bureaucracy and advertises it. -Friendly compiler messages. I don't recall seeing "perhaps" in a compiler error message before. The people designing Rust put much effort into making the language as approachable as possible and that's the net effect. That is not to say this is going to be necessarily successful, but so far the enthusiasm is there.
- civilitty 3y agoCrab people [1] [1] https://en.wikipedia.org/wiki/Crab_People https://en.wikipedia.org/wiki/Crab_People
- eyeris 3y agoThe swc project reimplemented some of the js build toolchain in rust which led to some great speed ups. I’d imagine that this call for rewriting prettier is inspired by swc Not sure if updating prettier will benefit as much as transpilation. [0] https://swc.rs/docs/benchmarks https://swc.rs/docs/benchmarks
- pjmlp 3y agoAny AOT compiled language will do, but only Rust will give extra hacker credo points.
- rafaelmn 3y agoTBH this sounds like a great candidate for rewrite - likely millions of hours of runtime/hour. Prettier is written on a platform with a history of such rewrites getting 10x perf increases. The only alternative that comes to mind is Go but I'm not that offended by Rust choice - has pros and cons.
- tubthumper8 3y agoIt's not just speed, but also correctness. A quick search in the Prettier repo shows plenty of issues for "undefined is not a function", "cannot read property X of undefined/null", and other such errors that are avoidable in a language with a good type system.
- adiabatty 3y agoMakes me wonder if Prettier would be noticeably improved it it were migrated to TypeScript (first).
- tubthumper8 3y agoIIRC the maintainers are not currently open to migrating to TypeScript
- citrin_ru 3y agoIt’s a great candidate for a rewrite buy why not Go, Zig, Ocaml, Haskell e. t. c.?
- zaxomi 3y agoNo matter what language they choose, someone will complain and ask "why X, why not Y or Z?"
- giraffe_lady 3y agoRight which is part of why dictating the implementation language up front as part of the bounty is a mistake. They should have put the bounty on the speedup factor they're looking for and let it sort itself out. My not-completely-naive guess is an expert optimizer can get the improvement they're looking for with only small parts or maybe even none of it rewritten in another language.
- darthrupert 3y agoBecause everything is written in nodejs.
- johnisgood 3y agoIt is a sad moment for me, because I have more difficulties understanding Rust than Haskell, and believe me, Haskell is very difficult already. I know C, Lua, OCaml, Go, and the like, but Rust? Not really. What I hate the most is reference implementations being in Rust instead of C. C is almost like a pseudo-code.
- yoav 3y agoCan you pls rewrite your comment in rust.