4 ms·
Because all of the languages supported by the browser have to interact with the DOM. DOM memory management is incredibly tricky: it will not do to just have "an
by pcwalton 10y ago
Because all of the languages supported by the browser have to interact with the DOM. DOM memory management is incredibly tricky: it will not do to just have "an agreed upon format" to exchange data between such languages. You need all the languages to participate in a single garbage collection regime and to have semantics for interoperability at the object level between all of them, which is a very difficult problem.
Even getting interoperability between JS and C++—what the browsers do to implement the DOM—has been exceptionally difficult, with innumerable security vulnerabilities resulting from this.
- inputcoffee 10y agoWhen I said "agreed upon format" I was thinking of something like JSON to talking to the server. I didn't think of various tabs on a browser having to interact. You probably know more about how the browser works than I do, but I think I see what you're saying. Suppose we implemented a browser that can allows front ends coded in RUST. In my mind, the browser just gives the RUST app its own tab, with its own memory and so forth. I am not proposing mixing up languages for the a given front end, or for components within an application or anything. Not because I think that would be wrong, but because I haven't thought it through.