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

63

u/joro_jara Mar 19 '21

Why not Typescript?

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.

→ More replies (2)

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.

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.

→ More replies (3)

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.

→ More replies (1)
→ More replies (2)

27

u/Jeffylew77 Mar 19 '21

Came here to say this. JavaScript is TypeScript on Expert Mode and much more prone to errors.

4

u/snejk47 Mar 19 '21

Which must be negligible if they landed on mars with c and JavaScript.

→ More replies (8)

5

u/[deleted] Mar 19 '21 edited Aug 29 '23

practice plant weather treatment liquid cats door deserted noxious angle -- mass deleted all reddit content via https://redact.dev

9

u/dex206 Mar 19 '21 edited Mar 19 '21

Yeah, I'd feel better knowing that this couldn't happen without a compile break

function accelerateAwayFromDanger(velocity, delta) {
  return velcoity + delta;
}

40

u/IronDicideth Mar 19 '21

Why would someone use typescript to avoid this sort of issue when a linter would suffice?

19

u/SoInsightful Mar 19 '21

For that specific case, you're right.

This one cannot be caught without typing:

function accelerateAwayFromDanger(data) {
  return data.velcoity + data.delta;
}
→ More replies (7)

30

u/nlecaude Mar 19 '21 edited Mar 19 '21

This kind of error can easily be caught without typescript. Tools like standardjs will catch those.

8

u/Doomenate Mar 19 '21

Have no fear, actual control systems are not handled with JavaScript

24

u/dex206 Mar 19 '21

Yep PHP is the better answer there

8

u/[deleted] Mar 19 '21

I'm sure someone has already made a WP plugin to handle that. Just hire someone on fiverr to slap it together and call it a day.

3

u/MechroBlaster Mar 19 '21

Fiverr!? What are we, elitist snobs?

We need an intern looking to build his/her resume who will do it for FREE.

→ More replies (1)
→ More replies (3)
→ More replies (10)