7 ms·
It's both amusing and absurd that what was practically intended as Java's little helper, JavaScript, has grown up to be this thing that might actually replace J
by astrodust 10y ago
It's both amusing and absurd that what was practically intended as Java's little helper, JavaScript, has grown up to be this thing that might actually replace Java entirely.
How long until there's a really good JVM written in JavaScript of some form and embedded Java apps end up running in JavaScript for performance and security reasons?
It'll be even more ridiculous and hilarious if the "j" in "jruby" ends up meaning "JavaScript".
- greenhouse_gas 10y agoIt would be interesting to recompile the old applet plugin as WebAssembly - it should be both secure (well, as secure as WebAssembly ever will be) and fast.
- astrodust 10y agoI seriously can't wait for a Flash in JavaScript so that all those old Flash games don't get shuttled off to the dustbin of history, never to be enjoyed again. I do not want to ever have to update Flash again. Ever.
- greenhouse_gas 10y agoThat's a dead Mozilla project called Shumway
- batmansmk 10y agoJava and Javascript are related like Car and Carpet are similar. There was no historical connection between Java and JavaScript beyond renting the brand "Java" from Sun to make the language more credible.
- astrodust 10y agoYes and no. In practice JavaScript was sometimes the thing that detected if Java was present and kicked off a Java applet. It also handled roll-overs before CSS was a thing, doing mundane stuff by comparison to what a full Java app could do. It was intended to be complementary.
- zeveb 10y agoWell, it's possible that if it hadn't been for Java JavaScript might have had a decent, parens-based syntax. I still wonder what might have been if Eich had been allowed to write the Scheme system he had been hired to do. While I'm not a fan of Scheme by any means, it is approximately 281,757,423,024,353 better than JavaScript. And Scheme's a great little language for implementing other languages. Imagine, we could have had transpiling years ahead of time. We might be using S-expressions instead of JSON. Heck, we might even have moved to an S-expression syntax for HTML & CSS by now. Imagine, one syntax for everything (thanks to https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_inner_html https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_... & https://www.w3schools.com/css/css_howto.asp https://www.w3schools.com/css/css_howto.asp for the examples): (html (head (title "Example") (style (body (background-color linen)) (h1 (color maroon) (margin-left (px 40))))) (body (h1 "What can JavaScript do?") (p (@ (id "demo")) "JavaScript can " (em "change") " HTML content.") (button (@ (type "button") (onclick (set! (inner-html (get-element-by-id document "demo")) "Hello JavaScript!"))) "Click me!"))) The world could have been so much better.
- nessus42 10y agoI'm a HUGE fan of Scheme. And of Lisp, in general. But having seen in the "real world" how so many people are so adverse to Lisp's beautiful syntax, I'm pretty confident that JavaScript would never have caught on if it looked like Lisp rather than like C.
- zeveb 10y agoThey wouldn't have had a choice, though, just as folks don't have a choice with JavaScript. I imagine that folks would have cottoned on to the advantage pretty quickly. And those that didn't … I guess they could have always become telephone cleaners or something:-)
- brlewis 10y agoPure Scheme would not be sufficient. You need at least DOM-handling libraries. And if those libraries were poorly designed, then people wouldn't cotton onto the advantage quickly. Look at DSSSL.
- dragonwriter 10y ago> It's both amusing and absurd that what was practically intended as Java's little helper, JavaScript, has grown up to be this thing that might actually replace Java entirely. I though JS was named to piggyback on Java's popularity, not because it was actually intended to complement Java.
- sandyarmstrong 10y ago"That’s right. It was all within six months from May till December (1995) that it was Mocha and then LiveScript. And then in early December, Netscape and Sun did a license agreement and it became JavaScript. And the idea was to make it a complementary scripting language to go with Java, with the compiled language." http://www.infoworld.com/article/2653798/application-development/javascript-creator-ponders-past--future.html http://www.infoworld.com/article/2653798/application-develop...
- amorphid 10y agoUntil JavaScript offers a robust concurrency abstraction, I don't see it completely replacing anything that is used for that purpose.
- voxic11 10y agoAsync/await and promises are quite good concurrency abstractions.
- brlewis 10y agoBased on the comment you're replying to I infer that you think Java offers a robust concurrency abstraction. I disagree. In moving to the single-threaded async style of JS concurrency, the hardest part for me has been to rid myself of the ugly habit I acquired from Java's threading model, i.e. asking myself at each line of code, what happens if my thread gets preempted here?
- dominotw 10y ago>has grown up to be this thing that might actually replace Java entirely. Java is just a language that runs on JVM, there have been many many attempts to replace it with languages brand new ( scala), existing languages ( jruby) including javascript( nashorn/ringojs ect), but no language has even come close to dethroning it. Its unlikely that javascript will replace it just because jvm is rewritten in java script.
- lanna 10y ago> Its unlikely that javascript will replace it just because jvm is rewritten in java script. that is not what oc meant. he is talking about runtime env, not source language
- andrewbinstock 10y ago>How long until there's a really good JVM written in JavaScript of some form and embedded Java apps end up running in JavaScript for performance and security reasons? Much of the JVM is written in C++ (From the docs: "There are nearly 1500 C/C++ header and source files, comprising almost 250,000 lines of code.")
- nessus42 10y ago> How long until there's a really good JVM written in JavaScript of some form and embedded Java apps end up running in JavaScript for performance and security reasons? That's an amusing idea. But it's extremely unlikely for the same reason that you are unlikely to see C++ rewritten in JavaScript. It's possible, however, that over time, more and more languages might target JavaScript, rather than the JVM or the native hardware. For instance, I program in Scala for a living. The main platform for Scala is the JVM, but there's also Scala.js, which targets JavaScript. And in fact, we now write most of our "JavaScript" in Scala, rather than in JavaScript. I suppose that someday there might be a version of Java that targets JavaScript, and then your dream might come true. Oh wait... it already happened! It's called GWT and it's been around for a decade.