4 ms·
Why should the browser contain a specific scripting language, like JavaScript, and not ActiveScript for example?
by rebolek 1y ago
Why should the browser contain a specific scripting language, like JavaScript, and not ActiveScript for example?
- krapp 1y agoIt's a consequence of javascript being "good enough." Originally, the goal was for the web to support multiple languages (I think one prototype of the <script> tag had a "type=text/tcl") and IE supported VBScript for a while. But at the end of the day, you only really need one, and the type attribute was phased out of the script tag entirely, and Javascript won.
- IgorPartola 1y agohttps://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/... It is actively used today.
- krapp 1y agoFair enough. Its use to denote other scripting languages was phased out.
- IgorPartola 1y agoYou can still use it that way you just would either have a browser extension or a JavaScript file read the contents and use it. Here is a 2017 Stack Overflow thread for example: https://stackoverflow.com/questions/14015899/embed-typescript-code-in-an-html-document https://stackoverflow.com/questions/14015899/embed-typescrip...
- joquarky 1y agoBTW, over a third of court case management software in the US is run on VBScript hosted in IE7 compatibility mode.
- xnx 1y agoI suspect you might know this, but Internet Explorer 3 supported JavaScript (JScript) and VBScript in 1996.
- codedokode 1y agoThe browser could use Java or .NET bytecode interpreter - in this case it doesn't need to have a compiler and you can use any language - but in this case you won't be able to see a script's source code.
- const_cast 1y agoYou already effectively can't see a scripts source code because we compile, minify, and obfuscate JS these days. Because the performance characteristics are so poor. Actually, most of the time C# decompiles nicer from CLR bytecode than esoterically built JS.