r/javascript • • Jun 08 '20

Deno plans to use JavaScript in internal code instead of TypeScript going forward

https://docs.google.com/document/d/1_WvwHl7BXUPmoiSeD8G83JmS8ypsTPqed4Btkqkn_-4/edit
400 Upvotes

230 comments sorted by

View all comments

Show parent comments

5

u/careseite [🐱😸].filter(😺 => 😺.❤️🐈).map(😺=> 😺.🤗 ? 😻 :😿) Jun 09 '20

https://www.reddit.com/r/javascript/comments/gz98sb/deno_plans_to_use_javascript_in_internal_code/ftfld92/

there've been made reasonable assumptions here that they are abusing TS to fit into what they think they need

code compile time in my experience hasn't be an issue, even on an old machine like mine. at my previous job, all we had was low end workstations where a tiny react-ts project took 2-3 minutes to compile. at home, its 2s and as I said, its an old machine.

obviously I dont expect them to be running on low end machines, because the whole things most likely running in some CI.

0

u/mort96 Jun 09 '20 edited Jun 09 '20

Why would a tiny react-ts project's compile times be relevant, when the issue in deno's experience is that typescript doesn't scale to their ~60k lines of typescript?

That link you sent tries to explain why they had trouble naming a class Header. It doesn't touch on Deno's code organization issues or their compile time issues.

3

u/careseite [🐱😸].filter(😺 => 😺.❤️🐈).map(😺=> 😺.🤗 ? 😻 :😿) Jun 09 '20

Why would a tiny react-ts project's compile times be relevant, when the issue is how deno's experience is that typescript doesn't scale to their ~60k lines of typescript?

Because it shows that TS compile time is directly related to machine speed

2

u/mort96 Jun 09 '20 edited Jun 09 '20

Obviously the speed of your machine determines how quickly your machine can perform a task. As you said, you wouldn't expect them to be running on low end machines; they presumably run on decent hardware, yet they experience that one incremental compile takes multiple minutes.

Compile times are determined by the quality of the compiler (one implemented in JavaScript might not be as fast as one implemented in C++, one which does a lot of unnecessary work on incremental compiles will make incremental compiles slower), the size of the code base, the speed of the machine doing the compile, and language design (some language features are more difficult to compile or type check or parse, meaning slower compile times, some language features are difficult to compile incrementally).

The Deno developers are probably using reasonable machines, so they can't practically speed up their builds a ton by just throwing orders of magnitude faster hardware at it. Their code base is probably about the size it needs to be to do what they want to do, so they can't just fix it by reducing their number of lines by an order of magnitude. That leaves factors related to the compiler implementation and the language design.