5 ms·
The large "rewrite in language X" projects, I can't think of any that succeeded without the significant cost of time, effort and users. Maybe there's a survivo
by kristopolous 3y ago
The large "rewrite in language X" projects, I can't think of any that succeeded without the significant cost of time, effort and users.
Maybe there's a survivorship bias in that only the ones that go poorly people talk about?
- MrJohz 3y agoFish shell would be the big counterexample right now. C(++?) to Rust in about a year, IIRC. I believe they were still pushing out updates to the original codebase during that time, although I assume they could have done more if they weren't also rewriting.
- secondcoming 3y agoI'm not sure a shell comes anywhere close to the complexity of a modern fully fledged web server.
- callalex 3y agoWith all due respect, is there anything that relies on production grade, highly scalable fish shell scripts, and in an adversarial security context?
- MrJohz 3y agoWith all due respect, I don't think that was the question! ;)
- darylteo 3y agoLots of JS ecosystem is going to "rebuild in Rust" right now, ironically. JS has a different lifecycle though, I suppose. Everything gets rebuilt like 5-10 times more often than other on platforms.
- DrewRWx 3y agoEverything in JS gets rebuilt until they are no longer in JS.
- creatonez 3y agoThese rewrites are fantastic for performance of build tools, but add complexity and churn when the base language, usually Javascript or Typescript, was already memory safe anyways. I'm hesitant to depend on most of this newer tooling for a while when existing Javascript-based alternatives exist.
- margorczynski 3y agoNot having proper static typing (and weak typing on top of that) in any medium-large project I think adds much more problems and complexity. JS is simply a bad language design-wise with TS being an improvement but still having the original sins of JS in it.
- solatic 3y agoPerformance is key. The performance differential of biome compared to prettier or eslint, for any monorepo of decent size, is a few orders of magnitude, for tools that should ideally be run on every file save.
- kristopolous 3y agoI'd have to be pretty carefully persuaded that someone who wrote infrastructure tools in JS makes decent design decisions.
- tukantje 3y agoPeople use the tools they have. When you want to build an infrastructure tool, you won't (or shouldn't) start with "how to write rust". Getting to the finish line matters more than using the absolute best fit so to speak. Same goes for orgs that have a lot of JS talent but no Rust for example.
- kristopolous 3y agoIt's not an advocacy for rust but a fairly introductory level shell script would likely be a very sophisticated JavaScript program. I've seen such efforts and they tend to be extremely complicated and not really doing much. I don't assume rational agency but instead that many people make poor decisions.
- everforward 3y agoIf they add Typescript and primarily stick to wrappers around C libraries and calling out to other binaries it could be okay. The core language is okay enough, not my favorite but it works. It's the surrounding ecosystem that's a pain. I would have to think really hard if someone asked me if I'd rather have all the infra scripts written in Perl or TS. TS is more likely to break, but easier to read and fix. The odds of Perl breaking are slim, but it is a fucking nightmare to fix. I'm pretty sure I'd rather have Perl than JS, though. JS without a type system is rough, to me at least.
- pjmlp 3y agoWhile I don't see a sense in doing that versus managed compiled languages, as it isn't a kernel driver or game engine performance level, eventually I will get an excuse to use Rust at work exactly because of those rewrites.
- jasode 3y ago>The large "rewrite in language X" projects, [...] significant cost of time, effort and users. Well... if you're pre-qualifying the hypothetical rewrite with "large", that already means we take as a given it will require significant time & effort. (Unless there's a sufficiently smart automatic transpiler tool like a future ChatGPT-v17.) There have been some successful big rewrites. Google rewrote the web crawlers from Java to C++. They also rewrote the search results front page from Java to C++. Microsoft rewrote C# compiler from C++ to C#. Go rewrote the compiler from C to Go. In any case, for curiosity... I ran the CLOC tool to count lines-of-code in the main NGINX repo ./src/* subdir. A project to convert ~165k of C to Rust is small enough to be doable by a small team. "Small" being 1 or 2 developers. (I'm not recommending they rewrite in Rust but just comparing the scope of the work to the resources.) Semi-related footnote is Cloudflare replaced NGINX with in-house Pingora and that was written in Rust: https://hn.algolia.com/?q=pingora https://hn.algolia.com/?q=pingora ----------------------------------------------------------------------------------- Language files blank comment code ----------------------------------------------------------------------------------- C 256 54041 6165 153818 C/C++ Header 134 4810 1077 10041 Perl 2 45 18 112 SKILL 3 24 0 99 Bourne Shell 1 30 5 78 make 1 9 0 21 C++ 1 9 3 19 Windows Resource File 1 3 2 1 ----------------------------------------------------------------------------------- SUM: 399 58971 7270 164189 -----------------------------------------------------------------------------------
- SoothingSorbet 3y agoIt of course depends on what you mean by "large", but one obvious case is rsvg.
- __s 3y agoI'm not sure which ones have gone poorly I guess you'd consider librsvg in the poorly bucket, whereas its maintainer considers it a success. I think there's a distinction to be had between "maintainer lead RIIR" & "rando RIIR" https://lwn.net/Articles/771355 https://lwn.net/Articles/771355 https://viruta.org/librsvg-rust-and-non-mainstream-architectures.html https://viruta.org/librsvg-rust-and-non-mainstream-architect...