4 ms·
> the JWST runs javascript What?! I'd like to know more about this. Does it have GC? I just can't fathom that being the case...
by deelowe 4y ago
> the JWST runs javascript
What?! I'd like to know more about this. Does it have GC? I just can't fathom that being the case...
- lifthrasiir 4y agoSee [1] (HN discussion: [2]). According to the paper [3] it looks like that it does have a GC and its resource usage is limited by other means. [1] https://www.theverge.com/2022/8/18/23206110/james-webb-space-telescope-javascript-jwst-instrument-control https://www.theverge.com/2022/8/18/23206110/james-webb-space... [2] https://news.ycombinator.com/item?id=32519918 https://news.ycombinator.com/item?id=32519918 [3] https://www.jwst.nasa.gov/resources/ISIMmanuscript.pdf#page=17 https://www.jwst.nasa.gov/resources/ISIMmanuscript.pdf#page=...
- acchow 4y ago> If you’re still worried, do note that the Space Telescope Science Institute’s document mentions that the script processor itself is written in C++ So they decided on Javascript back in 2006 and it uses an interpreter/runtime written in C++. Which runtime is this?
- deelowe 4y agoWow. Thanks!
- dotnet00 4y agoIts scripting engine for running commands sent from the ground is based on Javascript. So all the important stuff is done in native code, but the orders are taken in JS.
- nequo 4y agoIn an earlier era, NASA also sent Lisp to Mars.[1] And my understanding is that they sent it with GC. [1] https://corecursive.com/lisp-in-space-with-ron-garret/ https://corecursive.com/lisp-in-space-with-ron-garret/
- brucehoult 4y agoI can't fathom deploying anything critical WITHOUT GC. It's far too easy with malloc/free to make errors such as replacing a pointer with a pointer to another object and forgetting to free the original, freeing something that is still referred to somewhere else and then the other place using it and corrupting any new object allocated in that space, or freeing something that has already been freed, again potentially corrupting a new object reusing that memory. None of those is possible with GC. The only problem GC is subject to is allocating more data than you have physical memory for, and that is equally as much a problem with malloc/free so GC is no worse for that error, and better for the others.
- deleted 4y ago[deleted]
- gwd 4y ago> The only problem GC is subject to is allocating more data than you have physical memory for... On the contrary, the big issue with the GC is what happens when the actual collection happens. There's an apocryphal story about a research team that was making a table-tennis playing robot; but every 5 minutes the robot would randomly pause; in then end they discovered it was the Java garbage collector pausing the entire thing to run. Much less apocryphal, and more recently, Discord rewrote one of their services from Golang to Rust specifically because of the garbage collector [1]. Yes, misusing pointers is a potential problem; but when you're talking about situations where precise timing of maneuvering thrusters or stepper motors can make or break your mission, a garbage collector is arguably a much bigger problem if you don't have a way to make it predictable. [1] https://discord.com/blog/why-discord-is-switching-from-go-to-rust https://discord.com/blog/why-discord-is-switching-from-go-to...
- cestith 4y agoThere are predictable garbage collectors, though. Not every GC is a stop-the-world type. A good reference-counting system with the ability to weak-reference a variable can be pretty predictable and avoid loops as just one example.
- 4y ago