9 ms·
The James Webb Space Telescope Runs JavaScript, Apparently
- S0und 4y agoBit offtopic but I'm interested because I've never seen the answer. Does JWST's imaging censors are 20 years old tech, or the team could used a modern sensor that fits the 20+ years old design specification?
- Bilal_io 4y agoI don't think this answers your question directly, but you can learn more about the camera and sensors used in this link https://www.nasa.gov/mission_pages/webb/instruments/index.html https://www.nasa.gov/mission_pages/webb/instruments/index.ht...
- LeanderK 4y agoEven more offtopic: I would be interested in how it's handled in general. So for long-running projects (10-15years)...do they redo outdated parts? Wait until the last minute and don't plan "obviously useless" parts in advance? For example big construction projects that are in a limbo for some years, have they already detailed plans entirely on outdated equipment (from security to elevators) or just kept em blank? There's a big construction project near me where the architect was chosen 20 yers ago and now the costs explode, i was thinking whether this is a cause (outdated plans because one didn't follow through immediately).
- kelchm 4y agoTangential (and not my area of expertise), but I do know that the Ingenuity helicopter uses an off-the-shelf Snapdragon 801 SoC. As I understand it that is very unusual for any projects like this, let alone something like the JWST. https://en.wikipedia.org/wiki/Ingenuity_(helicopter)#Design https://en.wikipedia.org/wiki/Ingenuity_(helicopter)#Design
- Brian_K_White 4y agoIt has always been a specific goal of the Mars rovers since the very first one, to use a faster/cheaper design and production process than traditional Nasa projects. In essense, using more off the shelf parts for the Mars rovers is part of the science experiment.
- dandelany 4y agoThis was true of the first rover (Pathfinder ‘97) but really hasn’t been true of rovers since then. Ingenuity was an exception re: COTS parts since it was experimental. Pathfinder cost <$300M. “Better cheaper faster” became Discovery class missions, “capped” at $500M. Curiosity and Perseverance cost about $2.5B each. Not in the same category.
- mch82 4y agoNASA has teams of engineers focused on supply chain and reliability. Supply Chain Risk Management, https://sma.nasa.gov/sma-disciplines/supply-chain-risk-management https://sma.nasa.gov/sma-disciplines/supply-chain-risk-manag... “NASA’s Reliability and Maintainability (R&M) program ensures that the systems within NASA’s spaceflight programs and projects perform as required throughout their life cycles to satisfy mission objectives.” https://sma.nasa.gov/sma-disciplines/reliability-and-maintainability https://sma.nasa.gov/sma-disciplines/reliability-and-maintai...
- jpalawaga 4y agothe imaging equipment that goes into space is definitely state of the art, though the requirements for it would have been locked for some time. It's not like the JWST folks said "we're going to fly a canon 5D!" and then were 20 years out of date when the JWST flew. Pretty much all of the sensors are built from scratch, using very advanced/specialized techniques. Given that the tech is all custom, including some stuff that probably had to be invented or otherwise figured out to begin with, it's hard to say the "tech is old," given it's just now flying. In other ways, some of it looks old: one of JWST's main sensors images at 1024x1024. There might be other constraints at play here—how much data you get per pixel is directly related to your telescope's angular resolution and sensitivity of sensor. Here's a page that discusses the JWST's sensors: https://webb.nasa.gov/content/about/innovations/infrared.html https://webb.nasa.gov/content/about/innovations/infrared.htm... The journal article linked at the bottom of that page is also quite interesting as it talks about the science of the sensor technology and also the background of astronomer's requirements too. You can find it easily on google with a `filetype:pdf` filter.
- bXVsbGVy 4y agoChanging the sensors would make it very hard to evaluate under the very strict condition they were tested. The system integration would be very hard. The sensors on JWST have are outdated and do have some issues. For instance, some of the microshutter on NIRSpec are stuck (they knew before launching). The MIRI has some image artifacts due manufacturing techniques. The sensors were bespoke, even nowadays, we can't get sensors like the on on JSWT off the shelf. There isn't much use case for most of them outside space telescope. But we could do better with today technology.
- pavlov 4y agoIf there has to be a scripting runtime on a device that sits at a Lagrange point, I’d much rather have it be JavaScript than e.g. Python or Ruby. JS runtimes are so widely used that they’re extremely well debugged and very fast. The language standard library is tiny, which means much less surface for bugs compared to the hulking default dependency monstrosities of those other languages. As long as you don’t use anything from the Node or web browser ecosystems, JavaScript is a great embedded scripting language. (Of course everything goes to hell if you bring in node_modules or try to support the bad APIs from browsers.)
- codethief 4y ago> As long as you don’t use anything from the Node or web browser ecosystems So what are you using then?
- campbel 4y agoYou can write custom JS bindings for C++ with V8. So you could expose some functionality that way and then implement routines in JS.
- pavlov 4y agoEither custom embedding in a native app (JavaScriptCore or V8 directly, or a runtime wrapper abstraction like FB's JSI), or plain Node with extreme prejudice against anything from the npm pits of hell.
- mftb 4y agoJS, particularly in the era discussed here, only came with a small number of standard objects. The Host was expected to provide a series of Host Objects. In a browser these might be things like Window, Document and XMLHttpRequest. Scanning the linked article on the JWST it seems these might be things like Command and Telemetry, that would be written in C++, and then scripted in JS.
- BeefWellington 4y agoHaving worked on an embedded script engine that was JS-based at the time, this is exactly what we were doing. Basically the script host (C++ code) offered up specific sets of available objects to the engine that you could interact with and essentially trigger the C++ functionality from, passing in data, and such. It wasn't a fantastic experience at the time but luckily for us the stakes were pretty low as we were working on interactive mall map kiosk devices.
- dhsysusbsjsi 4y agoJWST dependent on leftpad is simultaneously funny and terrifying ! https://xkcd.com/2347/ https://xkcd.com/2347/
- jhugo 4y agoThis is likely running JS in the same way that some embedded GSM modules "run Python". It uses the language syntax and semantics, but uses a different, small runtime with very limited features. Probably there are some host objects (like Window in the browser world — likely stuff like Camera) and JS is just used as a convenient language to write the logic in. Which is all to say it's really far removed from left-pad and the rest of the npm cluster**.
- bmitc 4y agoNo real mention of why. So, why?
- rob74 4y agoBecause JavaScript is a really widespread scripting language, so it's very well suited for this task?
- bhedgeoser 4y agoWhy not? They aren't using npm, so security/stability isn't an issue. I guess it was either lua or js, and the devs didn't like 1 based indexing.
- sph 4y agoThey had delays, a rapidly looming deadline and not enough personnel, so NASA had to resort to hiring React developers.
- bhaak 4y agoAs nobody reads TFA these days, I have to supply the money quotes myself. > I mean that the actual telescope, arguably one of humanity’s finest scientific achievements, is largely controlled by JavaScript files. Oh, and it’s based on a software development kit from 2002. > According to Nombas’ (now-defunct) website, the latest update to ScriptEase 5.00e was released in January 2003 > next time you’re cursing the modern web for being so slow and wishing that someone would just blast JavaScript into space, you can remember that NASA has, in fact, done that.
- mftb 4y agoI read it, and all that quote illustrates is that the author doesn't know a great deal about NASA's development process. ScriptEase is not large, and purchasing it 17 years ago means that they had plenty of time to fully vet it individually, write their Host Objects and then another 15 years or so to test it. If you're curious about how NASA develops software - https://www.fastcompany.com/28121/they-write-right-stuff https://www.fastcompany.com/28121/they-write-right-stuff
- bhaak 4y agoFor a low level view, as how the code actually should look like, I found the JPL C coding guidelines very useful. It had an effect on me on how I wrote C after reading it. Here's a github hosted version https://github.com/stanislaw/awesome-safety-critical/blob/master/Backup/JPL_Coding_Standard_C.pdf https://github.com/stanislaw/awesome-safety-critical/blob/ma...
- prewett 4y ago> 23. Place #else, #elif, and #endif in the same file as the matching #if or #ifdef. Oh my. I bet that one has an interesting history! That thought has never even crossed my mind, and I did some fun stuff like include a header twice with different definitions to get a C++ mixin.
- mftb 4y agoI am interested, ty.
- cstross 4y agoI got to visit the control centre while it was under construction back in 2016 (I think: I was one of the guests at an SF convention, hence the special group tour). One factoid that stuck with me was they also considered micro-Python, but Javascript won because it supported floats. They were looking for an embeddable scripting language that astronomers could reasonably be expected to learn or already use for directing observations, so it had to be compact, very popular or ubiquitous, expected to remain so throughout the working life of the telescope, and easy to learn. (It was to be used not by CS grads but by astronomers.) It's a cut-down subset of the language and bolted down to prevent idiots installing random packages off the internet on an irreplaceable $10Bn instrument.
- Evidlo 4y agoAs far as I'm aware, JS was chosen long before Micropython or node existed.
- skybrian 4y agoIs there a document describing the language subset they picked?
- cstross 4y agoNot sure (but probably yes): I seem to recall ECMAScript was mentioned, not sure what version number.
- cxr 4y agoA superset of ECMA-262, 3rd edition (1999). <https://brent-noorda.com/nombas/us/devspace/manual/c/html/TH_416.htm https://brent-noorda.com/nombas/us/devspace/manual/c/html/TH...> (full docs: <https://brent-noorda.com/nombas/us/devspace/manual/c/html/index.htm https://brent-noorda.com/nombas/us/devspace/manual/c/html/in...>) Moar: - <https://arc.aiaa.org/doi/pdf/10.2514/6.2006-5747 https://arc.aiaa.org/doi/pdf/10.2514/6.2006-5747> - <https://brent-noorda.com/nombas/history/HistoryOfNombas.html#h.y24aqk4pftn8 https://brent-noorda.com/nombas/history/HistoryOfNombas.html...>
- 4y ago
- orbital-decay 4y agoThis isn't as crazy as you think, it makes sense for scientific spacecraft which are intended to be controlled by non-engineers. Hubble Space Telescope can also be controlled with a custom DSL directly by researchers, with the only difference being the sandbox location - it's compiled and verified on Earth before being sent to the spacecraft. With JWST, they wanted to modernize things and make scripting more accessible. Of course now the variant they use (ScriptEase) is two decades old already.
- 5350-uiop-1130 4y agoI somehow feel personally validated that they decided to use JavaScript as it was in 2002. I feel there is a lesson here...perhaps this is what you do when money isn't your incentive.
- deleted 4y ago[deleted]
- _wdab 4y agoAs inane as this sounds, it just hit me that the JWST is some 5 light seconds away. And for some reason, that boggled the mind, that we do these things.
- lacasito25 4y agoConttary to plenty of people, I love javascript. Having programmed 5 years in it makes me value and love golang much more. And it's always nice to have your competitor startups running js and lose time with console log debugging and handling SPA complexity.
- SunboX 4y agoconsole log debugging? I guess you never seriously wrote something in JavaScript. I learned many programming languages during my 15 years in this job. The Chrome / V8 Dev "Tools" are a dream to many devs. Even those who work with Visual Studio Pro. (not VS Code, thought)
- cwilkes 4y agoDev 1: I wouldn’t touch JavaScript with a ten foot pole. Dev 2: hold my beer
- TheAceOfHearts 4y agoWould it be possible to get some examples of these scripts?
- brent_noorda 4y agoI just updated our "Nombas doesn't exist anymore" page, for readers of this nice and mostly-accurate article, with a little more background on why I think NASA chose it (tl;dr "robust and predictable"). <http://brent-noorda.com/nombas/us/index.htm http://brent-noorda.com/nombas/us/index.htm> BTW, it just occurred to me after writing that that one of the first customers to ever license our software, over the dozen years we were in business, used it to control a camera, while possibly our last customer (NASA) also used it to control a (much bigger) camera. JavaScript: it's a language for taking pictures.
- xNeil 4y agoThis is awesome! How does it feel to have contributed to a massive advancement in space exploration? Did you develop ScriptEase with this use case in mind (cameras)? Why did ScriptEase development stop? Do you think ScriptEase would be useful in cameras today?
- brent_noorda 4y agoThank. Yes, it feels very satisfying having it finally be deployed and operational, like a big sigh of relieve after holding in a small bit of breath (one alveoli's worth) for 20 years. ScriptEase started when I began working alone on a project, instead of with big teams, and needed a faster program paradigm so that I alone could be as productive as a big team. It turned out to be generic enough that it was useful for a lot of types of projects, not just mine (which was to be an infinite backup product) or cameras (nothing on my mind at the time at all) but pretty much any software who's core libraries needed easy modification--also turned out to be useful in web browers, although I didn't know it at the time, because I didn't know there was such as thing yet as browsers or the web. The development stopped because by early 2000 times were really changing--people were getting less into paying for software libraries and more into getting free stuff; but it was 9/11 that really killed it, because our customers stopped paying us (because their customers stopped paying them, and so on). The final nail in the coffin was a big snowstorm on the day someone offered to acquihire us and move us to California where we'd never have to shovel snow again. Finally, ScriptEase itself would have too many legal troubles being used by anyone, but I do believe just about everything needs a script language so it can be altered and customized and personalized and applied to infinite new purposes (and not a new one invented every week, just something boring and stable). If I were to revive something from ScriptEase, I've often thought it should be the ideas behind the test environment around it. Where everything that can go wrong will go wrong and it must still survive.
- notjustanymike 4y agoDon't use document.querySelectorAll unless you're prepared to wait a while...
- pleb_nz 4y agoNo JWST != JWT