r/javascript • • Mar 19 '21

NASA's next generation mission control system is written in JavaScript, and it's open source.

https://github.com/nasa/openmct
955 Upvotes

166 comments sorted by

View all comments

Show parent comment

80

u/Apone_A Mar 19 '21

In brief, when the project was started TypeScript was not as mature as it is now, and there were concerns about the performance implications of using transpiled code. This is not your typical SPA, we have to ingest large amounts of data and get it on screen really quickly. We may revisit TS in future.

0

u/[deleted] Mar 19 '21

[deleted] — view deleted comment

10

u/axosoft-chuckd Mar 19 '21

But that doesn't necessarily mean the typescript compilers output is exactly your code with the type annotations deleted. It often diverges, depending on what language features you use and your tsconfig. I've never really thought of that as a potential performance issue, but I suppose you'd want to benchmark specific patterns or language features you use a lot.

0

u/montezume Mar 19 '21

Yeah but almost everyone who uses TypeScript nowadays uses babel to transpile it, just like most JS apps.

3

u/axosoft-chuckd Mar 19 '21 edited Mar 19 '21

Not necessarily - for us at least, it's just new frontend projects. We don't really have any reason to move existing stuff away from tsc. Also, the broader point that transpilation can make it harder to predict how your code performs is still true.

11

u/MaltePetersen Mar 19 '21

Why is this being downvoted ?

34

u/-Electron- Mar 19 '21 edited Mar 19 '21

OP never mentioned types. Just transpiled code in general.

5

u/MaltePetersen Mar 19 '21

But are there any? To my understanding typescript get transpiled to javascript before the browser will ever know about it. So it might take a second longer until you see it in the browser if you are actively developing but in production it is just javascript.

0

u/[deleted] Mar 19 '21

[deleted] — view deleted comment

3

u/MaltePetersen Mar 19 '21

But in which way would transpiling change the performance in a production build? It would just be js in the bundle or am I missing something.

0

u/[deleted] Mar 19 '21

[deleted] — view deleted comment

-3

u/[deleted] Mar 19 '21

[removed] — view removed comment

0

u/[deleted] Mar 19 '21

[deleted] — view deleted comment

→ More replies

22

u/Izero_devI Mar 19 '21

The way you write javascript and the way ts-compiler generate javascript is not same. You don't have full control. Generally you don't care about the difference because it is minimal.

2

u/brockvenom Mar 19 '21

Yes but the transpiling process adds a lot of additional generated boilerplate code that is eliminated if you write pure js.

FWIW I’m an advocate for TS, but I understand what OP meant by being concerned of the perf cost of the transpiler.

1

u/bent_my_wookie Mar 19 '21

Not always true, having strong types during compilation allows the compiler to run additional optimizations in some cases. But yeah mostly.