I look to the stars, and I see semicolons.
Image: NASA, ESA, CSA, and STScI

Javascript, the programming language that web developers and users alike hate to complain about, had a hand in delivering the stunning images that the James Webb Space Telescope has been beamed back to Earth. I don't mean that in a sarcastic way, like that the website NASA hosts them on uses Javascript. One of humanity's finest scientific achievements is largely controlled by Javascript files. There is a software development kit from 2002.

The software for the ISIM is controlled by the script processor task, which runs scripts written in Javascript upon receiving a command. The actual code that turns those Javascript into actions can run 10 of them at the same time.

The script processor is what really executes the tasks, but it gets instructions on what to do from the JavaScripts.
Diagram: NASA

The Space Telescope Science Institute's Ilana Dashevsky and Vicki Balzano wrote a paper about how to maximize efficiency and minimize ground systems. Scientists on the ground can tell the JWST to run certain tasks because of the pre-written script it has. The script processor will then be able to reach out to other applications and systems based on what the script calls for. When a manager is given a list of tasks and given the power to delegate them out to their team, it is similar to what the JWST is doing.

The JavaScripts are just a part of the puzzle, but they’re an important one.
Diagram: NASA

The script that controls the process of taking pictures through the telescope is still very important. NASA says it's the heart of the telescope.

It seems odd that the script is written in a language that's been around for a long time. Almost two decades ago, the latest update to ScriptEase was released. When the software controlling some of the JWST's most vital instruments came out, there were people who couldn't vote.

The knowledge has been floating around on the internet for a long time, but it still surprised a few of us here at The Verge. It seems odd that a piece of scientific equipment would be controlled by a technology that is not particularly strong.

The project has been in the works since 1989 and the software is older than that. The telescope was only two years old when construction began in 2004. It is not particularly old, given that spaceships are powered by tried and true technology instead of the latest and greatest. When launch day rolls around, things that had to be locked in early on can seem out of date because of how long the project takes to get off the ground.

According to ResearchGate, the documents that describe the JWST's Javascript system were written in 2006 but were not published until 2011. There is a version published in 2010 that cites papers from 2011. It is possible that NASA could have changed the system since then, but it seems like a huge undertaking. NASA didn't reply to The Verge's request for comment, but they mention "event-driven science operations" in the documents.

The knowledge base says that it can hold between 58.6 and 65 gigabytes of actual scientific data. I forgot to mention that. The telescope's solid state drive has the same capacity as the one used in the original MacBook Air.

We are not here to discuss the storage. Why Javascript is the big question at the moment. NASA is famous among some programmers for its strict programming guidelines, but what's the point of going with web-like script instead.

According to NASA, this way of doing things gives operations personnel greater visibility, control and flexibility over the telescope operations, allowing them to change the script as they learn the ramifications and nuances of operating the instruments. If NASA needs to make changes to a bunch of files that are written in a human-readable format, they can just open up a text editor and do a bunch of testing on the ground. If you wanted to make changes to the program, you would have to recompile it.

A “simplified” diagram of the architecture from the Maximizing Efficiency paper.
Image: Space Telescope Science Institute

The document from the Space Telescope Science Institute states that the script processor is written in the type of language you would want to use on a spaceship. It is obviously working. No matter what type of code was used to generate them, the pictures are amazing. Next time you curse the modern web for being so slow and wish that someone would just blast javascript into space, you can remember that NASA has done that.