4 ms·
I write JS professionally, and I can't fathom why they would use it on something so important and correctness-critical. Can you shed some light on that? Edit:
by _bxg1 8y ago
I write JS professionally, and I can't fathom why they would use it on something so important and correctness-critical. Can you shed some light on that?
Edit: Thinking about it, I have read that Lisp was used for early NASA missions because of its ability to be rewritten in-place, which JS mostly shares. Still, JS has so many weird quirks and so easily throws exceptions. And it can't be very fast at processing images. Maybe it's only used for high-level control logic?
- ChristianBundy 8y ago> And it can't be very fast at processing images. Why not?
- _bxg1 8y agoBecause it's a very a CPU-intensive task? It's all relative, but in 2003 JS was one of the worst languages you could possibly use for that. Of course it's moot if they aren't actually planning to use it for that side of things.
- semicolon_storm 8y agoSpeed can vary from interpreter to interpreter. I haven't seen any benchmarks of this interpreter, so we don't know how fast it may be. Maybe their JS interpreter applies some restrictions to the language that greatly speeds it up?
- mathgladiator 8y agoOr has special primitives for CPU intensive tasks.
- vardump 8y agoI very much doubt they JIT anything, because of the associated fault risk. So it's going to be an interpreter implementation. That means inner loops will run rather slowly. It could still use image processing library, sure. I doubt NASA wants to do much image processing on-board in the first place. Mostly just lossless compression and maybe some thumbnailing, if they can't download everything.
- jvanderbot 8y agoIt's used for sequencing. Think game scripting, except for a machine. The instruments / data handling is not in JS. None of the key functionality runs on a virtual machine or interpreter (I'd stake a lot on that). But, for instructions that must be human readable and machine readable, which are uploaded from ground stations, you sometimes want a scripting language like LUA or JS.
- rcxdude 8y agoFrom what I understand of satellites and rovers, the only parts which are totally critical to get right are the modem, power to the modem, and bootloader. Almost everything else can be adjusted if a fault occurs (and they often are).
- dfrage 8y agoThat works if you have a low data rate, last ditch omnidirectional antenna fall back. Otherwise for deep space satellites you've got to run quite a bit of stuff to get and perhaps keep the antenna pointed at a transmitter, which for a satellite includes station keeping functionality.
- z3t4 8y agoImagine FTP-ing into the telescope to change some JS-files live, then just "refresh" and see what happens. They are probably using a simulator, and run tests before deploying the JS code. The tooling around JavaScript has come a long way, with type checkers, static analysis, code coverage, debugging, etc. The language itself is also very safe (hey, we are executing trustless JS in the browser). What do you mean by weird quirks ? The only thing that still annoys me are float's.
- _bxg1 8y ago> What do you mean by weird quirks ? - undefined vs null vs empty - the pile of weirdness that is == - the other pile of weirdness that is implicit truthiness/falsyness - NaN's many fun qualities https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat
- z3t4 8y agoOhh yeh, I think the equality table is just something you have to learn, like a chemist learn the periodic table. I make use of null==undefined a lot and prefer it over thruthy/falsy. I try to avoid NaN but sometimes use isNaN(nr)