Java tops C as most popular language in developer index

M

Malcolm McLean

Now, if the Java gets turned into JavaScript, which is interpreted
by a browser .... I wouldn't know about that [*]. But I'm fairly
sure actual Java is not the performance disaster it was early on.

Java doesn't get turned into JavaScript - they're two very different
languages.

In any event, many browsers JIT JavaScript code these days.
Browsers will only run Java in applets, which have too many restrictions
on what they can do to be useful for anything much other than little
games or demos. (I'm sure there's an exceptional case somewhere).

Javascript on the other hand is a clumsy but highly flexible way of adding
interactivity to web pages, uploading data from users, and sending it
back to servers.
 
I

Ian Collins

Malcolm said:
Now, if the Java gets turned into JavaScript, which is interpreted
by a browser .... I wouldn't know about that [*]. But I'm fairly
sure actual Java is not the performance disaster it was early on.

Java doesn't get turned into JavaScript - they're two very different
languages.

In any event, many browsers JIT JavaScript code these days.
Browsers will only run Java in applets, which have too many restrictions
on what they can do to be useful for anything much other than little
games or demos. (I'm sure there's an exceptional case somewhere).

One common and useful use for Java applets is remote consoles. All the
server types I manage use a Java applet for their consoles.
Javascript on the other hand is a clumsy but highly flexible way of adding
interactivity to web pages, uploading data from users, and sending it
back to servers.

It's far from clumsy.
 
K

Keith Thompson

Robert Wessel said:
Now, if the Java gets turned into JavaScript, which is interpreted
by a browser .... I wouldn't know about that [*]. But I'm fairly
sure actual Java is not the performance disaster it was early on.

Java doesn't get turned into JavaScript - they're two very different
languages.

Not normally, but it can be:

http://en.wikipedia.org/wiki/Google_Web_Toolkit#Development_with_GWT

Just about any compiler translates some language into a very different
language.
 
L

Lynn McGuire

Robert said:
Now, if the Java gets turned into JavaScript, which is interpreted
by a browser .... I wouldn't know about that [*]. But I'm fairly
sure actual Java is not the performance disaster it was early on.


Java doesn't get turned into JavaScript - they're two very different
languages.

From an earlier post by Lynn:

"Fat Browser clients, such as google apps (gmail),
are written in Java and compiled down to Javascript."

Yes. Please see http://www.gwtproject.org/ to
understand how Google apps, specifically gmail,
works.

"The GWT SDK contains the Java API libraries,
compiler, and development server. It lets you
write client-side applications in Java and deploy
them as JavaScript."

Lynn
 
L

Lynn McGuire

Robert Wessel said:
Now, if the Java gets turned into JavaScript, which is interpreted
by a browser .... I wouldn't know about that [*]. But I'm fairly
sure actual Java is not the performance disaster it was early on.

Java doesn't get turned into JavaScript - they're two very different
languages.

Not normally, but it can be:

http://en.wikipedia.org/wiki/Google_Web_Toolkit#Development_with_GWT

Just about any compiler translates some language into a very different
language.
In any event, many browsers JIT JavaScript code these days.

It is my understanding that Google is working
on their own JIT file format nowadays so that
developers can release just an EXE equivalent
file for all platforms. Just Endian-ness comes
to mind with problems with this.

Lynn
 
L

Lynn McGuire

Robert Wessel wrote:
On 17 Aug 2013 20:48:21 GMT, (e-mail address removed)

Now, if the Java gets turned into JavaScript, which is interpreted
by a browser .... I wouldn't know about that [*]. But I'm fairly
sure actual Java is not the performance disaster it was early on.


Java doesn't get turned into JavaScript - they're two very different
languages.

From an earlier post by Lynn:

"Fat Browser clients, such as google apps (gmail),
are written in Java and compiled down to Javascript."

Yes. Please see http://www.gwtproject.org/ to
understand how Google apps, specifically gmail,
works.

"The GWT SDK contains the Java API libraries,
compiler, and development server. It lets you
write client-side applications in Java and deploy
them as JavaScript."


Interesting. Did not know that.

But I guess if the only hammer you have is JavaScript...

I guess this does explain the broad interest in JITs for JavaScript,
though. I never did quite understand that, since almost all examples
of JavaScript I've seen have been relatively small - sure, it would
help even then, but it didn't really seem like it would be that big a
win.

Just remembered that Google is trying to replace
Javscript with Dart:
http://en.wikipedia.org/wiki/Dart_(programming_language)

Here is the Javascript for Gmail (you will need
to view the page source to see it):

https://mail.google.com/_/mail-stat...qAMSAxbhf0rNz3tjPQ4p8t_y4P8QDGCKGKgHs4GQg/d=1

I would not call that a trivial amount of code.

Lynn
 
M

Malcolm McLean

On Mon, 19 Aug 2013 11:45:04 -0500, Lynn McGuire <[email protected]>

But I guess if the only hammer you have is JavaScript...

I guess this does explain the broad interest in JITs for JavaScript,
though. I never did quite understand that, since almost all examples
of JavaScript I've seen have been relatively small - sure, it would
help even then, but it didn't really seem like it would be that big a
win.
Javascript was originally designed for adding a few trivial interactive
features to html. It blossomed, with people producing libraries like
JQuery which are huge hunks of code.
However we're not yet at the stage where most people do heavy-duty
processing with Javascript. Whilst there might be lots of lines of
code, generally they're processing strings or putting up UI elements,
which a modern processor can slice through easily. They're not doing
high end graphics, signals processing, NP-complete problems, or other
things that soak up the cycles.
 
J

James Kuyper

On 08/19/2013 04:50 PM, Malcolm McLean wrote:
....
Javascript was originally designed for adding a few trivial interactive
features to html. It blossomed, with people producing libraries like
JQuery which are huge hunks of code.
However we're not yet at the stage where most people do heavy-duty
processing with Javascript. Whilst there might be lots of lines of
code, generally they're processing strings or putting up UI elements,
which a modern processor can slice through easily. They're not doing
high end graphics, signals processing, NP-complete problems, or other
things that soak up the cycles.

I guarantee you that, if you're right that people are not doing those
things with Javascript, it's probably only because they think it's not
suited to such uses - it's not because there's no one who would want to.
 
G

glen herrmannsfeldt

(snip)
Javascript was originally designed for adding a few trivial interactive
features to html. It blossomed, with people producing libraries like
JQuery which are huge hunks of code.
However we're not yet at the stage where most people do heavy-duty
processing with Javascript. Whilst there might be lots of lines of
code, generally they're processing strings or putting up UI elements,
which a modern processor can slice through easily. They're not doing
high end graphics, signals processing, NP-complete problems, or other
things that soak up the cycles.

I don't know that they are using Javascript, but whatever Facebook
uses it can be very slow. I usually logoff when I am not using it,
as otherwise it uses up all the CPU time on my system.

Maybe most don't do heavy-duty processing, but it only takes one.

-- glen
 
P

Phil Carmody

Lynn McGuire said:
Here is the Javascript for Gmail (you will need
to view the page source to see it):
https://mail.google.com/_/mail-stat...qAMSAxbhf0rNz3tjPQ4p8t_y4P8QDGCKGKgHs4GQg/d=1

I would not call that a trivial amount of code.

$ wget 'https://mail.google.com/_/mail-stat...AMSAxbhf0rNz\3tjPQ4p8t_y4P8QDGCKGKgHs4GQg/d=1'

--2013-08-20 11:40:54-- https://mail.google.com/_/mail-stat...AMSAxbhf0rNz\3tjPQ4p8t_y4P8QDGCKGKgHs4GQg/d=1
Resolving mail.google.com... 173.194.32.22, 173.194.32.21, 2a00:1450:400f:800::1016
Connecting to mail.google.com|173.194.32.22|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2013-08-20 11:40:54 ERROR 400: Bad Request.


$ w3m 'https://mail.google.com/_/mail-stat...AMSAxbhf0rNz\3tjPQ4p8t_y4P8QDGCKGKgHs4GQg/d=1'
"""
Google Error


Not Found

The requested URL was not found on this server.

"""


But I'm not a quitter!

$ elinks 'https://mail.google.com/_/mail-stat...AMSAxbhf0rNz\3tjPQ4p8t_y4P8QDGCKGKgHs4GQg/d=1' | more

"""
Google Error


Not Found

The requested URL was not found on this server.
"""

OK, I'm a quitter. 0 bytes of code. All perfectly readable.

Phil
 
P

Phil Carmody

James Kuyper said:
On 08/19/2013 04:50 PM, Malcolm McLean wrote:
...

I guarantee you that, if you're right that people are not doing those
things with Javascript, it's probably only because they think it's not
suited to such uses - it's not because there's no one who would want to.

I suspect the reason Malcolm dropped into my killfile was the inordinate
amount of bollocks he comes up with, and this is a good example. Just
find a modern HTML5-based phone, and look at the source code of some of
the web-apps. In particular look for ones that are quick ports of pre-
HTML5 apps.

Why do you think that so much effort has been put into optimising
Javascript interpreters/compilers in the last half-decade? It's because
people are doing stupid amounts (and that's not "stupid" being used
for emphasis, it's "stupid" as in "stupid") of computational heavy
lifting in JavaScript. All the JIT work has been absolutely necessary.

Phil
 
N

Noob

Malcolm said:
However we're not yet at the stage where most people do heavy-duty
processing with Javascript. Whilst there might be lots of lines of
code, generally they're processing strings or putting up UI elements,
which a modern processor can slice through easily. They're not doing
high end graphics, signals processing, NP-complete problems, or other
things that soak up the cycles.

Is that a fact?

http://js1k.com/2013-spring/demos

cf.
http://js1k.com/2013-spring/demo/1451
http://js1k.com/2013-spring/demo/1459
 
L

Lynn McGuire

On 8/18/2013 10:40 PM, Ian Collins wrote:
Robert Wessel wrote:
On 17 Aug 2013 20:48:21 GMT, (e-mail address removed)

Now, if the Java gets turned into JavaScript, which is interpreted
by a browser .... I wouldn't know about that [*]. But I'm fairly
sure actual Java is not the performance disaster it was early on.


Java doesn't get turned into JavaScript - they're two very different
languages.

From an earlier post by Lynn:

"Fat Browser clients, such as google apps (gmail),
are written in Java and compiled down to Javascript."

Yes. Please see http://www.gwtproject.org/ to
understand how Google apps, specifically gmail,
works.

"The GWT SDK contains the Java API libraries,
compiler, and development server. It lets you
write client-side applications in Java and deploy
them as JavaScript."


Interesting. Did not know that.

But I guess if the only hammer you have is JavaScript...

I guess this does explain the broad interest in JITs for JavaScript,
though. I never did quite understand that, since almost all examples
of JavaScript I've seen have been relatively small - sure, it would
help even then, but it didn't really seem like it would be that big a
win.

Just remembered that Google is trying to replace
Javscript with Dart:
http://en.wikipedia.org/wiki/Dart_(programming_language)

Here is the Javascript for Gmail (you will need
to view the page source to see it):

https://mail.google.com/_/mail-stat...qAMSAxbhf0rNz3tjPQ4p8t_y4P8QDGCKGKgHs4GQg/d=1

I would not call that a trivial amount of code.


No, clearly not (although that was my point: with something like a
Java program compiled to JavaScript you'd likely end up with
non-trivial codebases).

But.... Yikes... Gotta love generated code...

That is obfuscated code.

Lynn
 
M

Malcolm McLean

Those are 1980s style little procedural graphics routines, remarkably written
in less than 1K of Javascript. They are very clever, but most of them aren't
especially processor intensive. Life for example requires only 8 additions and
a coupe of comparisons per cell per step.
Most of cycles will be spent in rasterising. Whilst it's possible to write
rasterising code in Javascript, typically this isn't done. Javascript calls
graphics routines that are written in another language, typically C.
 
P

Phil Carmody

Something seems to have mangled the URL for you somewhere along the

Bloody emacs!
way. About 33 characters from the end, your copies have an inserted
"%5C". Lynn's original worked for me (although I just copied it and
pasted it into Chrome).

Oh my god, that's awesome. The best thing is that it doesn't seem to be
uglified (obfuscated), just minified. So in theory it could be returned
to a fairly readable form quite easily. But that's a heck of a lot of
javascript. I wonder how much of it does client-side validation that
needs to be (but isn't necessarily) done at the server too?

Phil
 
P

Phil Carmody

That is obfuscated code.

It only looks minified to me, not obfuscated. Sure, minimal-length
variable and functions names are a trivial obfuscation, but that's
not the primary goal, simply shrinking the source is.

Phil
 
L

Lynn McGuire

Bloody emacs!


Oh my god, that's awesome. The best thing is that it doesn't seem to be
uglified (obfuscated), just minified. So in theory it could be returned
to a fairly readable form quite easily. But that's a heck of a lot of
javascript. I wonder how much of it does client-side validation that
needs to be (but isn't necessarily) done at the server too?

Phil

I'm betting that most of it is user
interface code, probably GWT.

Lynn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,076
Messages
2,570,565
Members
47,200
Latest member
Vanessa98N

Latest Threads

Top