Hacker News new | ask | show | jobs
by rafaelmn 953 days 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.
2 comments

It'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.
Makes me wonder if Prettier would be noticeably improved it it were migrated to TypeScript (first).
IIRC the maintainers are not currently open to migrating to TypeScript
It’s a great candidate for a rewrite buy why not Go, Zig, Ocaml, Haskell e. t. c.?
No matter what language they choose, someone will complain and ask "why X, why not Y or Z?"
Right 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.

familiarity. 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.