5 ms·
Why not a language that has types, perhaps C or Rust? Even if they use TypeScript then still why not go something more lower level?
by kreetx 8y ago
Why not a language that has types, perhaps C or Rust? Even if they use TypeScript then still why not go something more lower level?
- zaarn 8y agoTypeScript didn't exist when the decision on the language was made. And nobody will launch anything into space that didn't see a decade of testing and then it still needs to be integrated into a craft that will launch 10 yrs in the future. They wanted a scripting language, likely to make updating stuff around the craft easier, it's high level control so low level languages don't make that much sense. You'll likely see Rust and other modern languages in about 15 years or so flying into space.
- jvanderbot 8y agoC++ finally made it. You're probably right about 2 decades for Rust .... mho.
- tropo 8y agoJython dates to January 17, 2001. The spacecraft would just have the JVM of course.
- jvanderbot 8y agoSequences are often a markup language, and are (necessarily) interpreted on board.
- hliyan 8y agoSomehow I don't think /node_modules will fit.
- Rebelgecko 8y agoRust and Typescript didn't exist when this decision was made. The 2MB size limit would also take some engineering effort to workaround for both of those languages.
- z3t4 8y agoJavaScript is very safe. You probably have it enabled in your web browser. Meaning a overflow/out of bounds could give any website control of your PC. In this regard JavaScript is very strongly typed. It's also relative fast, fast to write, and easy to understand. It has a relative small memory footprint, and the payload (JS text file) is small compared to for example a statically linked binary. So if you are willing to give up some performance in order to write safe and easily maintainable code fast, then JavaScript is good, if performance is priority you are better off with a systems language. If you are targeting tiny 1$ CPU's you still need to write in assembly (or maybe C). which however doesn't make sense for a satellite that you only make 1-2 copies of, besides reducing weight.
- kreetx 8y agoThere are languages (sometimes a subset of an existing language, like C) where you can prove for a program that it has no bugs, or that it can function in a real-time context (i.e stays reactive to some frame rate at all situations). This is useful for very expensive hardware that you can't go and service later on. JavaScript can easily explode at run time, while these other languages won't even compile. JavaScript is small, but then again - you need to ship the interpreter. Not sure about maintainability either - static typing really helps with that. The safety you mention is that js runs in a sandbox (and e.g can't wipe your hard drive), but this is a feature of browsers, not the language itself. All in all I find it hard to believe they wrote any critical parts in js, and I'd also guess it's possible to replace the currently deployed scripts should they fail.
- z3t4 8y agoJavaScript types are very strict, and are checked at runtime, compared to at compile time. So you are less likely to get some random off by one bug in JavaScript then say C, which causes a bit flip somewhere and makes the rocket engines turn on, or what not. JavaScript "exploding" at runtime is great, it's much better then to continuing poisoning the state making weird stuff happen. JavaScript is however paying the price in performance, where a statically typed language can have 10x better performance.