Some browsers do expose an API allowing these things, but my point is more
that I'm not convinced they provide anything that allows someone to add in
support for other languages that is useful in anyway beyond simple toys.
Regarding Python in the browser, this site has some useful info:
https://wiki.python.org/moin/WebBrowserProgramming

I'm wondering as to _why_ you even want to run scripts in another language
client-side. Any such language would (assuming the browser support API also
sandboxes it's code) be limited to only effecting changes in the browser
environment, so there isn't really any utility to using another language
over javascript. If you want to be able to run scripts that do other things
outside of that sandbox (such as a script that runs an application on the
user's computer and displays it's output in the browser), then there are a
whole bunch of security implications there which need to be considered.


On 25 October 2013 14:26, Ralph Corderoy <ra...@inputplus.co.uk> wrote:

> Hi Terry,
>
> > Terry Coles wrote:
> > > I understand that all browsers speak Javascript,
>
> Except those that don't, e.g. lynx(1).  :-)
>
> > > so a page containing js, just gets executed.  What if the script is
> > > written in PERL, PHP or even TCL or Python?  Presumably the page
> > > includes a mime type, but how does the browser know what package to
> > > use to execute the code.
>
> Well, the browser has a list of MIME types and how to handle them for
> other things, e.g. audio formats.  You can edit it to use external
> programs, for example.
>
> But are you getting confused between code that's shipped as part of, or
> referenced by, a HTML web page and code that responds to a HTTP request
> from a browser on the server?  That back-end code can be written in
> anything and the browser doesn't know or care.
>
> Andrew Montgomery-Hurrell wrote:
> > Most browsers just fail if you use any language other than javascript.
>
> There's a version of Chromium that supports Dart natively AIUI.  For
> other browsers, you load some Javascript that can handle the Dart.
>
>
> https://www.dartlang.org/docs/tutorials/connect-dart-html/#about-html-code
>
>     <script type="application/dart" src="mini.dart"></script>
>     <script src="packages/browser/dart.js></script>
>
> > I'm not entirely sure browsers even expose a useful enough API to be
> > able to develop a useful plugin to do that.
>
> I think they do?  I've vague recollections of being able to add a Python
> interpreter to Internet Explorer some years ago when web scripting
> languages first made an appearance.
>
> Cheers, Ralph.
>
> --
> Next meeting:  Bournemouth, Tuesday, 2013-11-05 20:00
> Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
> New thread on mailing list:  mailto:dorset@mailman.lug.org.uk
> How to Report Bugs Effectively:  http://goo.gl/4Xue
>



-- 
Andrew Montgomery-Hurrell
Professional Geek
Blog: http://darkliquid.co.uk
Twitter: http://twitter.com/darkliquid
Fiction: http://www.protagonize.com/author/darkliquid
-- 
Next meeting:  Bournemouth, Tuesday, 2013-11-05 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread on mailing list:  mailto:dorset@mailman.lug.org.uk
How to Report Bugs Effectively:  http://goo.gl/4Xue

Reply via email to