4 ms·
TBH 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
by rafaelmn 3y ago
TBH 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.
- yawboakye 3y agofamiliarity. and rust seems to be winning the war for web development tooling, at the moment. zig (by way of bun) may make a good stand if bun were to produce such tools too, as standalone. it’s a high barrier if bun has to be adopted wholesale in order to have a pretty printer.