4 ms·
A related point which has always bugged me... the html script tag has a type attribute. The only valid value, to this day, is "text/javascript". Why oh why has
by Russtopia 10y ago
A related point which has always bugged me... the html script tag has a type attribute. The only valid value, to this day, is "text/javascript".
Why oh why has no one written a runtime for the major browsers for others, say "text/python", "txt/golang", ... Anything other than javascript?
Once an alternative engine were in the major browsers they would hopefully take off as the world's hackers enhanced them.. and we could finally be freed from the shackles of a language designed in a weekend and bandaid-ed ever since.
- petercooper 10y agoPeople have. type="text/vbscript" probably got the most use, but it was only ever in IE. The W3C was gungho on TCL at one point and text/tcl was used there - notably, the HTML 4.01 spec gives an example of setting text/tcl as the default with <META http-equiv="Content-Script-Type" content="text/tcl"> The problem is getting multiple browsers to agree, and no real standard has emerged there. Even if one did, you're either relying on browser creators to include a runtime, or you have to patch one in, Flash-style. I think Google was trying to do this with Dart but failed. A modern workaround I've seen a few times is to write/compile an interpreter in JavaScript that looks for script tags with different types and runs them, but that leads to yet more JS bloat when loading pages.
- derefr 10y ago> Even if one did, you're either relying on browser creators to include a runtime, or you have to patch one in, Flash-style. This would actually be the perfect use-case for Google's Native Client, if other browsers would bother to support it. The arguments against webapp authors writing their app in NaCl are probably valid. But those arguments don't apply to the case where the "apps" are run times, there are only a common ones floating around, and people pull them in by URL in order to script against them. Interestingly, this would solve one additional pain-point: every script would have the particular ABI version of the runtime it was coded against "locked" into it, in the same sense as a Ruby/Node dependency-lock file. So the runtimes themselves could be in very heavy flux version-to-version, as long as they kept old ABI-lines around and patched with security-updates.
- epc 10y agoFor a very brief time, WebExplorer for OS/2 supported Rexx as a scripting language, but it was limited to OS/2 (which had a Rexx runtime builtin). I don't think it made it to WebExplorer for Windows (and became entirely moot when IBM killed WebExplorer in a deal with Netscape).
- pdkl95 10y ago> The only valid value, to this day, is "text/javascript". Other script types have been supported for a while. Some compile-to-javascript languages can be setup to use script tags in their language. For example, CoffeeScript can be setup[1] to compile <script type="text/coffeescript"> tags at runtime. Also, WebGL can load shaders[2] from script tags of type "x-shader/x-vertex" and "x-shader/x-fragment". [1] http://coffeescript.org/#scripts http://coffeescript.org/#scripts [2] see the source of http://mdn.github.io/webgl-examples/tutorial/sample3/ http://mdn.github.io/webgl-examples/tutorial/sample3/ for a basic example.
- deleted 10y ago[deleted]
- al2o3cr 10y agoThere was a some interest in something like that ("text/ruby" support via an applet + JRuby) a while back: http://almaer.com/blog/running-ruby-in-the-browser-via-script-typetextruby http://almaer.com/blog/running-ruby-in-the-browser-via-scrip... I remember hearing about it initially, but it doesn't appear to have gotten much traction.
- ptman 10y agoGrail seems to have supported python scripts http://grail.sourceforge.net/ http://grail.sourceforge.net/ https://en.wikipedia.org/wiki/Grail_(web_browser) https://en.wikipedia.org/wiki/Grail_(web_browser)