3 ms·
It is explained in the article, but not very clearly: > The JWST isn’t running a web browser where JavaScript directly controls the Mid-Infrared Instrument — i
by dpedu 4y ago
It is explained in the article, but not very clearly:
> The JWST isn’t running a web browser where JavaScript directly controls the Mid-Infrared Instrument — it’s more like when a manager is given a list of tasks (in this example, the JavaScripts) to do and delegates them out to their team.
The way I interpret this is that JavaScript programs are used to coordinate missions - meaning, in the script, it is specified what instruments to use and how to configure them. Maybe even a `for` loop to sweep an instrument across a range.
But the instruments themselves don't run JavaScript. Since it's a simple language (at least, compared to the embedded languages the instruments actually run) it presumably makes it easy and safe to configure the satellite. Think of it more as a configuration file written in JavaScript.
You could compare this to video games written in C++ that expose to the user a Lua scripting engine such as World of Warcraft or Garry's Mod.
This comment links to a paper with more info: https://news.ycombinator.com/item?id=19738151 https://news.ycombinator.com/item?id=19738151
> ScriptEase JavaScript allows for a modular design flow, where on-board scripts call lower-level scripts that are defined as functions.
> The script interpreter is run by the flight software, which is written in C++. The flight software operates the spacecraft and the science instruments.
> The flight software will execute
the command sent by the calling on-board script and
return telemetry, which will be evaluated in real-time by
that on-board script. The calling script will then send
status information to a higher-level on-board script,
which contains the logic to skip forward in the
observing plan in response to certain events
- bmitc 4y agoNone of that explains why JavaScript.
- brent_noorda 4y agoBecause JavaScript happened to be the language we at Nombas implemented in our "robust and predictable" engine. If a, e.g., python or TcL engine were as solid at the time for a can't-fail embedded engine, they could have happily used that.
- bmitc 4y agoThanks for replying! I looked on your website, where there’s more information. Half of my question was surprise, because I would have thought something like Common Lisp, Erlang, Chez Scheme, Guile Scheme, Chicken Scheme would have been interesting choices. Despite being compiled they have various support for interpreters, embedding, and live update / hot reload of code. The other half was curiosity because I just didn’t know why JavaScript would be chosen and would like to know. (Hence my question.) You should post here as your own post about the project. That would be interesting. And congratulations on having some code running on JWST. It’s gotta be uniquely thrilling.