3 ms·
You haven’t made any arguments about why Javascript isn’t good for building UIs there. Here’s mine for why it is: - first class functions (callback style is a
by davedx 6y ago
You haven’t made any arguments about why Javascript isn’t good for building UIs there. Here’s mine for why it is:
- first class functions (callback style is a good fit for UI programming)
- async/await and single threaded - many components of UIs are async by nature, Javascript supports you well here while keeping things simple with its single threaded model
- vertex-four 6y agoThere's... a large number of languages with both of those features.
- scotty79 6y agoCould you name few better than js?
- vertex-four 6y agoIn the context of writing reliable software for a spacecraft? Pretty much anything with a reasonable type system, for a start. Maybe C#, or some reasonable subset of C++20, or Rust. Maybe Reason or OCaml.
- errantspark 6y agoI mean very clearly the good people at SpaceX have heard of these languages and decided against it. I think JS and Chromium are the best UI kit I can think of in terms of man hours to get X done. If you're careful the only thing I've ever had issues with is latency, but in space if you're in a situation where missing a frame or two is important you're already beyond fucked.
- zeroc8 6y agoFrom my experience, Qt/QML is way better for things like that. I mean, the UI does not need to be responsive, does it? Maybe they couldn't afford the Qt license.
- davedx 6y agoMany people are using TypeScript these days, it works very well. I like C# and Rust too. I've built UI's in C++ and MFC/OpenGL/DirectX. It remains my fairly strong opinion that JavaScript is well suited to UI development.
- heavyset_go 6y agoSharing the UI thread with logic is something to be mitigated when building UIs, it's not a feature.
- davedx 6y agoIn theory, maybe. In practice, your UI thread very rarely has to do the kind of heavy lifting that would block it so badly you actually have problems. I have encountered this -- for example parsing very large incoming JSON payloads -- but very rarely. And if you really need to mitigate it, there are webworkers.