4

Do any browser vendors support the use of any scripting languages besides

  • text/javascript
  • text/vbscript (IE only)

for example:

  • text/lua
  • text/cs-script
  • text/php
  • text/tcl

If i wanted to use another scripting language in a browser:

<SCRIPT type="text/javascript">
   ...some JavaScript...
</SCRIPT>

<SCRIPT type="text/vbscript">
   ...some vbscript...
</SCRIPT>

<SCRIPT type="text/perl">
   ...some Perl Script...
</SCRIPT>

<SCRIPT type="text/php">
   ...some Php...
</SCRIPT>

<SCRIPT type="text/tcl">
   ...some Tcl...
</SCRIPT>

<SCRIPT type="text/lua">
   ...some Lua...
</SCRIPT>

<SCRIPT type="text/pascalscript">
   ...some PascalScript...
</SCRIPT>

<SCRIPT type="text/cs">
   ...some C#...
</SCRIPT>

could i?

Is there a way to register 3rd party scripting engines with any browser?

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219

6 Answers6

3

No. If you want to use a different language, your best bet is using something that compiles into JavaScript (eg Pyjamas for Python).

LaC
  • 12,624
  • 5
  • 39
  • 38
3

Technically, Internet Explorer can use any script language which provides an IActiveScript implementation, and I've seen implementations of both PERL (from ActiveState) and TCL running clientside in IE.

But to minitech's point, this isn't something that would work across browsers, and frankly it's a terrible idea in almost all circumstances.

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
EricLaw
  • 56,563
  • 7
  • 151
  • 196
2

There is now brython to run python 3 programs:

see www.brython.info

Impressive work!

seem work across many browsers (I don't have IE)

... still waiting for a perl port...

F. Hauri - Give Up GitHub
  • 64,122
  • 17
  • 116
  • 137
2

Google Chrome has a native code plugin, allowing the use of any language for which you have the correct plugin. For example, there is a Tcl implementation for it.

RHSeeger
  • 16,034
  • 7
  • 51
  • 41
1

There are what I consider hack-ish ways to do it which involves some kind of interpreter between the browser and the script language. Two examples of this are using SilverLight to interface with various dynamic languages, or JRuby to interface using Ruby script. Otherwise it has to get compiled to JS.

onteria_
  • 68,181
  • 7
  • 71
  • 64
0

No, there isn't. Not any portable way, at least, and not anything you should do.

Ry-
  • 218,210
  • 55
  • 464
  • 476