Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Your programming language in a browser (i.e. Javascript)?

Is it possible to write a plugin that would allow client-side scripting to be done on the browser in a non-Javascript language (take your pick - TCL, Rebol, Perl, Ruby, Python, Lisp, etc)?

To clarify, I am NOT talking about browser plugins which allow "applets" for particular languages to run in the browser - I know that's been done. I'm asking whether one can use another language besides Javascript (or whatever else has been done) for the HTML scripting through use of a plugin or other means? I'm talking about [insert your language] between the <script>...</script> tags.

My guess is this hasn't been done. If so, is it because it's just plain difficult/impossible?

Thanks.

like image 849
Ultranewb Avatar asked Nov 15 '22 02:11

Ultranewb


1 Answers

For your own browser, doable. For anything you want to place on a public website, it would need wide-spread adoption first, so: no, impossible. You have to stick with JavaScript.

You could compile your language down to JavaScript if that works for your scenario, just like Google's Web Toolkit does. Or write an interpreter for it in JavaScript.

like image 187
Thilo Avatar answered Dec 17 '22 12:12

Thilo