Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wp-plugin-hostgator domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/scienrds/scienceandnerds/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the ol-scrapes domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/scienrds/scienceandnerds/wp-includes/functions.php on line 6114

Warning: Cannot modify header information - headers already sent by (output started at /home4/scienrds/scienceandnerds/wp-includes/functions.php:6114) in /home4/scienrds/scienceandnerds/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/scienrds/scienceandnerds/wp-includes/functions.php:6114) in /home4/scienrds/scienceandnerds/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/scienrds/scienceandnerds/wp-includes/functions.php:6114) in /home4/scienrds/scienceandnerds/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/scienrds/scienceandnerds/wp-includes/functions.php:6114) in /home4/scienrds/scienceandnerds/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/scienrds/scienceandnerds/wp-includes/functions.php:6114) in /home4/scienrds/scienceandnerds/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/scienrds/scienceandnerds/wp-includes/functions.php:6114) in /home4/scienrds/scienceandnerds/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/scienrds/scienceandnerds/wp-includes/functions.php:6114) in /home4/scienrds/scienceandnerds/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/scienrds/scienceandnerds/wp-includes/functions.php:6114) in /home4/scienrds/scienceandnerds/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":12709,"date":"2022-08-19T14:42:48","date_gmt":"2022-08-19T14:42:48","guid":{"rendered":"https:\/\/scienceandnerds.com\/2022\/08\/19\/the-james-webb-space-telescope-runs-javascript-apparently\/"},"modified":"2022-08-19T14:42:49","modified_gmt":"2022-08-19T14:42:49","slug":"the-james-webb-space-telescope-runs-javascript-apparently","status":"publish","type":"post","link":"https:\/\/scienceandnerds.com\/2022\/08\/19\/the-james-webb-space-telescope-runs-javascript-apparently\/","title":{"rendered":"The James Webb Space Telescope runs JavaScript, apparently"},"content":{"rendered":"

Source: https:\/\/www.theverge.com\/2022\/8\/18\/23206110\/james-webb-space-telescope-javascript-jwst-instrument-control<\/a>
\n
<\/br><\/code><\/p>\n

\n

It turns out that JavaScript, the programming language that web developers and users alike love to complain about<\/a>, had a hand in delivering the stunning images<\/a> that the James Webb Space Telescope has been beaming back to Earth. And no, I don\u2019t mean that in some snarky way, like that the website NASA hosts them on<\/a> uses JavaScript (it does). I mean that the actual telescope, arguably one of humanity\u2019s finest scientific achievements, is largely controlled by JavaScript files. Oh, and it\u2019s based on a software development kit from 2002.<\/p>\n

According to a manuscript<\/a> (PDF) for the JWST\u2019s Integrated Science Instrument Module (or ISIM), the software for the ISIM is controlled by \u201cthe Script Processor Task (SP), which runs scripts written in JavaScript upon receiving a command to do so.\u201d The actual code in charge of turning those JavaScripts (NASA\u2019s phrasing, not mine) into actions can run 10 of them at once. <\/p>\n

\n <\/p>\n

<\/p>\n\"\"<\/p>\n

<\/source><\/picture>\n

<\/span><\/p>\n

<\/span><\/p>\n

The script processor is what really executes the tasks, but it gets instructions on what to do from the JavaScripts.<\/em><\/figcaption>Diagram: NASA<\/cite><\/p>\n

<\/span><\/p>\n<\/figure>\n

The manuscript and the paper<\/a> (pdf) \u201cJWST: Maximizing efficiency and minimizing ground systems,\u201d written by the Space Telescope Science Institute\u2019s Ilana Dashevsky and Vicki Balzano, describe this process in great detail, but I\u2019ll oversimplify a bit to save you the pages of reading. The JWST has a bunch of these pre-written scripts for doing specific tasks, and scientists on the ground can tell it to run those tasks. When they do, those JavaScripts will be interpreted by a program called the script processor, which will then reach out to the other applications and systems that it needs to based on what the script calls for. The JWST isn\u2019t running a web browser where JavaScript directly controls the Mid-Infrared Instrument \u2014 it\u2019s 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.<\/p>\n

\n <\/p>\n

<\/p>\n\"\"<\/p>\n

<\/source><\/picture>\n

<\/span><\/p>\n

<\/span><\/p>\n

The JavaScripts are just a part of the puzzle, but they\u2019re an important one.<\/em><\/figcaption>Diagram: NASA<\/cite><\/p>\n

<\/span><\/p>\n<\/figure>\n

The JavaScripts are still very<\/em> important, though \u2014 the ISIM is the collection of instruments that actually take the pictures through the telescope, and the scripts control that process. NASA calls it<\/a> \u201cthe heart of the James Webb Space Telescope.\u201d <\/p>\n

It seems a bit odd, then, that it uses such an old technology; according to Dashevsky and Balzano, the language the scripts are written in is called Nombas ScriptEase 5.00e. According to Nombas\u2019 (now-defunct<\/a>) website<\/a>, the latest update to ScriptEase 5.00e was released in January 2003 \u2014 yes, almost two decades ago. There are people who can vote who weren\u2019t born when the software controlling some of the JWST\u2019s most vital instruments came out.<\/p>\n

This knowledge has been bubbling up on the internet in Hacker News<\/a> and Twitter<\/a> threads for years, but it still surprised quite a few of us here at The Verge<\/em> once it actually clicked. At first blush, it just seems odd that such a vital (not to mention expensive<\/a>) piece of scientific equipment would be controlled by a very old version of a technology that\u2019s not particularly known for being robust.<\/p>\n

After thinking about it for a second, though, the software\u2019s age makes a bit more sense \u2014 while the JWST was launched in late 2021, the project has been in the works since 1989. When construction on the telescope started in 2004<\/a>, ScriptEase 5 would\u2019ve only been around two years old, having launched in 2002<\/a>. That\u2019s actually not particularly old, given that spacecraft are often powered by tried-and-true technology<\/a> instead of the latest and greatest. Because of how long projects like the JWST take to (literally<\/a>) get off the ground, things that had to be locked in early on can seem out of date by more conventional standards when launch day rolls around.<\/p>\n

It\u2019s worth noting that, like the project itself, these documents that describe the JWST\u2019s JavaScript system are pretty old; the one written by Dashevsky and Balzano is undated but came out in 2006, according to ResearchGate<\/a>, and the ISIM manuscript is from 2011. (There does appear to have been a version published in 2010<\/a>, but the one I read cites papers published in 2011.) It\u2019s always possible that NASA could\u2019ve changed the scripting system since then, but that seems like a pretty big undertaking that would\u2019ve been mentioned somewhere. Also, while NASA didn\u2019t reply to The Verge\u2019s<\/em> request for comment, this JWST documentation page<\/a> published in 2017 mentions \u201cevent-driven science operations,\u201d which is pretty much exactly how the documents describe the JavaScript-based system. <\/p>\n

This knowledge base, by the way, also contains a few more details on the telescope\u2019s 68 GB SSD<\/a>, saying that it can hold somewhere between 58.8 and 65 gigabytes of actual scientific data. Wait, did I forget to mention that? Yes, this telescope\u2019s solid state drive has around the same capacity as the one that was available in the original 2008 MacBook Air<\/a>. <\/p>\n

Anyways<\/em>, we\u2019re not here to talk about the JWST\u2019s storage. I feel like the big question at this point is why Javascript<\/em>? Sure, there\u2019s probably a bit more angst about the language now than there was in the time when the project\u2019s engineers were selecting tech for the project, but NASA is famous among some programmers for its strict programming guidelines<\/a> \u2014 what\u2019s the point of going with web-like scripts instead of more traditional code?<\/p>\n

Well, NASA\u2019s document says that this way of doing things gives \u201coperations personnel greater visibility, control and flexibility over the telescope operations,\u201d letting them easily change the scripts \u201cas they learn the ramifications and subtleties of operating the instruments.\u201d Basically, NASA\u2019s working with a bunch of files that are written in a somewhat human-readable format \u2014 if they need to make changes, they can just open up a text editor, do a bunch<\/em> of testing on the ground, then send the updated file to the JWST. It\u2019s certainly easier (and therefore likely less error-prone) than if every program was written in arcane code that you\u2019d have to recompile if you wanted to make changes.<\/p>\n

\n <\/p>\n

<\/p>\n\"\"<\/p>\n

<\/source><\/picture>\n

<\/span><\/p>\n

<\/span><\/p>\n

A \u201csimplified\u201d diagram of the architecture from the Maximizing Efficiency paper.<\/em><\/figcaption>Image: Space Telescope Science Institute<\/cite><\/p>\n

<\/span><\/p>\n<\/figure>\n

If you\u2019re still worried, do note that the Space Telescope Science Institute\u2019s document mentions that the script processor itself is written in C++, which is<\/em> known for being… well, the type of language you\u2019d want to use if you were programming a spacecraft. And it\u2019s obviously working, right? The pictures are incredible, no matter what kind of code was run to generate them. It is, however, a fun piece of trivia \u2014 next time you\u2019re cursing the modern web<\/a> for being so slow and wishing that someone would just blast JavaScript into space, you can remember that NASA has, in fact, done that.<\/p>\n