4 ms·
Not only that. The DOM API and general browser APIs are designed with JS semantics in mind, and for JS. Just like the UNIX APIs are designed in C and expect to
by epidemian 2y ago
Not only that. The DOM API and general browser APIs are designed with JS semantics in mind, and for JS. Just like the UNIX APIs are designed in C and expect to be called from C.
So even if you get other languages working alright on browsers, they are always going to be second-class citizens IMO, because they are going to be interfacing with JS APIs.
I can't think of a way to avoid this TBH, other than designing a different API for the new language, at which point i think we'd be no longer talking about the web as we know it.
- andrewfromx 2y agook but I still don't understand why it's not a great idea for everyone to embrace WASM as it is today and write your frontend logic in go or rust EVEN if you have to use instantiateStreaming.
- epidemian 2y agoYou'd still need to interface with the JS APIs, wouldn't you? For example, an API like `Element.prototype.addEventListener(string, callback)` wouldn't make much sense in Rust, IDK about Go. Sure, you can make it work, but you'll always be rubbing against an API that was not designed for that language. Hell, addEventListener isn't even on the Element prototype, but on the EventTarget prototype, which Element.prototype inherits from. And that's something else that wouldn't make sense at all in Rust: prototypical inheritance. But it's part of the DOM API. It's part of the web. So we'd have to deal with it too, even if we switch to a new language. Does this make some sense? I feel like i'm repeating what's been said before in this comment chain, so maybe i'm missing something about what you're not understanding (:
- andrewfromx 2y agohttps://github.com/andrewarrow/homeducky/blob/main/browser/vote.go https://github.com/andrewarrow/homeducky/blob/main/browser/v... https://github.com/andrewarrow/homeducky/blob/main/browser/register.go https://github.com/andrewarrow/homeducky/blob/main/browser/r... https://github.com/andrewarrow/homeducky/blob/main/browser/timer.go https://github.com/andrewarrow/homeducky/blob/main/browser/t... https://www.youtube.com/watch?v=dxO94MvfRCg https://www.youtube.com/watch?v=dxO94MvfRCg here's example coding frontend in go. I think I've achieved with vote.go and register.go and timer.go above a nice way in Go to do Javascript things. I don't feel limited.