JavaScript In Space - James Webb Telescope
Written by Mike James   
Wednesday, 24 August 2022

JavaScript is the main way to automate a webpage, but who would have thought that NASA would pick it as a way to get scientists to plan their observations.

The James Web telescope has already delivered enough stunning images to win popular approval and it is even making astrophysicists reconsider if the big bang ever actually happened, although the jury is not only still out on that one and is are likely to be out for some time. This is good science!

From the software point of view the James Webb is also interesting. Space software tends to lag behind anything cutting edge that is available at the time of deployment. The reason is, of course, the length of time most projects take and a reluctance to adopt anything that might not be stable. I was surprised to discover that the Webb's software is based on Rational Rose Real-time (RRT) and JavaScript.

Rational Rose is a name I haven't heard in a long time. It was a UML-based code generator. You basically created a UML (Unified Modeling Language) graphical model, defined lots of properties and it generated the code. This is how it is being used for the James Webb:

"...using RRT, a set of standard task interface ports to which every task conforms that allows it to send command packets, receive telemetry packets, receive internal table values for task configuration, receive system time information, perform file operations, use centrally managed timers, and respond to check-in requests to verify that each task is still running."

The approach using RRT was very popular back in the 1990s and using separate tasks is the basis of ROS (Robot Operating System) and still popular in many other hardware systems. IBM may well have moved on from RRT, but clearly NASA doesn't have the luxury of simply abandoning software it has spent so much money on getting to the L2 point.

Where things take a turn for the slightly unusual is in the choice of how to orchestrate the services provided by RRT - JavaScript.

"The primary command source in normal operations is the Script Processor Task (SP), which runs scripts written in JavaScript upon receiving a command to do so. The script execution is performed by a JavaScript engine running as separate task that supports ten concurrent JavaScripts running independently of each other. A set of extensions to the JavaScript language have been implemented that provide the interface to SP, which in turn can access ISIM FSW services through the standard task interface ports. Also, to provide communication between independently running JavaScripts, there are extensions that can set and retrieve the values of shared parameters. "

I don't know about you, but I find the use of "JavaScripts" a bit disconcerting - as if they really were scripts...


The JavaScript is to be written by scientists and technicians - is this a good choice? I thought scientists only spoke Fortran or perhaps Python if they are too young to know any better. 

"The fact that the OSS is written in JavaScript and stored on-board as text files is significant because this gives the operations personnel greater visibility, control and flexibility over the telescope operations. As they learn the ramifications and subtleties of operating the instruments, they can modify the JavaScripts and, after thorough testing in a ground facility, they can simply replace an onboard file to make the change. The JavaScripts are written using the terminology of the user’s domain of commands and telemetry"

The whole system is event-driven by design and this makes JavaScript a good choice as it has been event-driven since it really was nothing more than a script. Even so, event-driven systems, and asynchronous systems in general, aren't renowned for being reliable or easy to debug.  The JavaScript is most likely implemented using ScriptEase, a now defunct interpreter designed to be integrated with a C/C++ program. It may well have seemed like a good choice back in 2000, cutting edge even, but not a good choice today.

I suppose the real payoff is that the users can go home and report, probably with a big supressed chuckle,  that they had a good day at work writing JavaScript for a Webb site...




More Information

Status of the James Webb Space Telescope Integrated Science Instrument Module System

Related Articles

The State Of JavaScript 2021

How Is JavaScript Doing?

JavaScript inherits the earth

JavaScript - is the new Basic!

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.



SynapseML Now .NET Compatible

Microsoft has updated SynapseML, its open-source library for creating massively scalable machine learning (ML) pipelines. The update consists of a new set of .NET APIs for massively scalable machine l [ ... ]

Learn To Protect Your APIs By Hacking Them

A free course from security expert Corey Ball will teach you all the techniques necessary to hack your APIs.The ultimate goal is to learn how to protect them by first identifying any undiscovered vuln [ ... ]

More News





or email your comment to:






Last Updated ( Wednesday, 24 August 2022 )