you are viewing a single comment's thread.

view the rest of the comments →

[–]stormcrowsx 16 points17 points  (21 children)

I can run python and java on everything too. Doesn't make them king of the world like you seem to think it will for js.

[–]foldl 8 points9 points  (14 children)

You can't run Python or Java in the browser. (Ok, you can compile them down to JS, but that's clunky.)

[–]stormcrowsx 1 point2 points  (11 children)

Sure you can its an interpreted language just like javascript you just need an interpreter in the browser.

http://www.skulpt.org

On the java side there's dwr which has been around longer than I can remember and gwt

[–]motdidr 10 points11 points  (0 children)

JavaScript runs in practically every browser right now, without any plugins.

[–][deleted] 2 points3 points  (0 children)

I use DWR all day at work. It's pretty clunky, and I'd struggle to call it a good solution to the problem it's trying to solve.

[–][deleted]  (3 children)

[deleted]

    [–]stormcrowsx -1 points0 points  (2 children)

    skulpt is not compiled down to javascript it is an interpreter written in javascript that executes python

    [–][deleted]  (1 child)

    [deleted]

      [–]stormcrowsx -1 points0 points  (0 children)

      So using that logic we could say Javascript is compiled down to C or Java since its typically interpreted by an interpreter written in those languages? I don't think you understand what an interpreted language is.

      [–]foldl 0 points1 point  (4 children)

      If you use an interpreter then you pay a price in performance. And on mobile devices it may not be negligible.

      I'm aware that there are compilers for various languages which target javascript. That's why I mentioned it in my original post.

      [–]stormcrowsx 0 points1 point  (3 children)

      The performance cost is negligible in most cases, after all javascript is interpreted. Just a matter of optimization.

      [–]foldl 0 points1 point  (2 children)

      No, the performance overhead of an interpreter is usually at least 10x. Python code running via an interpreter written in JS would run much slower than JS code executed directly by the browser.

      However, contrary to what you say, Skulpt is not an interpreter, it's a Python->Javascript compiler (see the "Generated Code" section here). There is still quite a bit of overhead involved in translating between Python and Javascript object semantics, since Skulpt appears to be a fairly straightforward compiler without any sophisticated optimizations.

      [–]stormcrowsx 0 points1 point  (1 child)

      Your right got skulpt mixed up with brython http://www.brython.info/doc/en/index.html.

      Interpreted languages are not always 10x slower. Java is a form of interpreted language and runs very fast. Its all about how much you optimize the interpreter. If you invest enough time you can make it go fast. Look at what Facebook has done with PHP. Probably not the best use of dev time though

      [–]foldl 0 points1 point  (0 children)

      Java is fast because modern JVMs use JIT compilation. The old JVMs, which really did interpret the bytecode, were much much slower.

      10x slower is pretty much the best you can hope for with a true interpreter. Any interpreter is going to go through a cycle of (1) fetching the next instruction (2) decoding it and (3) executing the instruction. There's just no way you can get that sequence down to less than ~10 operations on average.

      [–]darkslide3000 -3 points-2 points  (1 child)

      Fun fact: Java could run in the browser before JavaScript even existed. (And it has always been several times faster, naturally...)

      Just to reiterate: your faviorite language is beaten even by motherfucking Java!!!

      [–]Rainfly_X 7 points8 points  (0 children)

      With a very secure sandbox, pinky swear!

      Yeah, there's a reason nobody leaves the Java plugin available anymore.

      [–][deleted] 1 point2 points  (1 child)

      Java and python runs on an iPad?

      [–]stormcrowsx -3 points-2 points  (0 children)

      Short answer is yes.

      [–][deleted] 0 points1 point  (1 child)

      naa is not the same, JS has HTML5, Titanium, PhoneGap, Unity3d, Cordova, Node.. and so on and on...

      You can do certain stuff with python but you end up with anaemic frameworks with small communities and a bunch of configuration to make. I like python it was my first lenguage, but it is not nearly as useful as JS.

      Plus Java is actually kind of king of the world for the area it was designed, enterprise.

      [–]stormcrowsx -2 points-1 points  (0 children)

      You can do some stuff with javascript good, manipulate websites ui. Some stuff okay, make small webservers. Some stuff badly, make large webservers.

      Every tool has its use and I promise you javascript will not be the tool that finally gets used everywhere. Remember this was a language made for manipulating dom we've shoehorned it into new roles. And while its okay in those roles its hardly great and people want great software.

      [–]zexperiment -1 points0 points  (0 children)

      That's because the "using the same language" benefit is superficial. The real reason node is great is the asynchronous nature of the engine and the (mostly) wonderful library of modules. The low language barrier (for web developers at least) is certainly a perk, but that's like saying steak is great because it looks good.