Better HN
topnewbestaskshowjobs
Log inSign up

rmthw

2 karma · joined Aug 9, 2020 (6y ago) · 4 submissions

Submissions

comment 6y ago · link · parent

Also, the ball has been in Typescript's court for a while to provide a fast, easy to use typecheck-only API that receives an AST and can be used by other tools that already have parsers.

If that existed, it would allow Typescript it to be embeddable, and Rome could use that.

People have been asking for it for half a decade.

comment 6y ago · link · parent

Better error messages, an error-recoverable parser, faster speed, consolidation into a single tool, additional ability to lint/pretty-print/minify/test instead of just transpiling and bundling, having zero dependencies, having a smaller codebase.

Maybe those things are not important for you, but they are for the Rome author and for many people in the community.

Also with brundolf's solution you can run the TSC typechecker (but not the transpiler/emitter) and Rome in parallel, making good use of modern multi-core processors. With Webpack+TSC you'll have to typecheck, transpile and bundle all in series. This might be very significant.

comment 6y ago · link · parent

> Are you suggesting that TS team is so incompetent or legacy burdened that their codebase is impossible to extend.

I'm not suggesting at all that they're incompetent, but you seem to be...

Typescript's goal was not extensibility in the way it would be needed for Rome to use it as its base. There is nothing wrong with that.

Also, it's not "incompetence" to write a codebase that is hard to extend or modify to do something in a completely different way. It's just a difference of priorities.

Of course it would be better to only have easily-modifiable codebases in the world, but this is not possible. Teams might have other conflicting goals.

Don't fool yourself into thinking that a good codebase has every single positive attribute in the world just because it's a good codebase, or because its authors are good coders.

Webpack was harder to modify than creating Rollup from scratch, GCC was harder to modify than it was to create LLVM from scratch, Linux is immeasurably harder to modify than Minix if you want it to do things it was not . But it doesn't mean that those codebases are worse or better.

--

> What use case of TS would you exclude to arrive at simpler code base ?

Why would I want to exclude any use case from Typescript? I actually mentioned Rome's raison d'être is to have more things than other transpilers.

It's a matter of architecture and early choices, of how the parser/ast/pretty-printer were implemented. Not really a matter of features we can remove.

comment 6y ago · link · parent

Why?

TS and Rome architectural goals are completely incompatible.

Writing a transpiler is not complicated at all, especially for someone who has written Babel in the past.

On the other hand, if you familiarise yourself with both TS's gigantic codebase and with Rome's goals, you'll quickly see that modifying TS would be much vaster undertaking than writing it from scratch.

Also if Rome were just an also-ran to replace ESLint/Webpack/Babel/etc, it would be ok to have a less-than-ideal starting point, but it's actually trying to do things differently: better error messages, recoverable parser errors, more fixable linter messages, being faster.

This is the exact case of something that should be written from scratch (or at least use something that makes it possible) rather than building on some another technology with completely incompatible goals.

Another example? It took several years for Webpack to achieve tree-shaking that was as good as Rollup first versions, even with more maintainers, more sponsorship and a lot of time. Why? Because Webpack's architecture was completely different.