The JavaScript Juggernaut Rolls On
JThaddeus writes "An article in TechWorld Australia summarizes the latest opinions on JavaScript from ThoughtWorks: 'There is no end in sight to the rise of JavaScript... "I think JavaScript has been seen as a serious language for the last two or three years; I think now increasingly we're seeing JavaScript as a platform," said Sam Newman, ThoughtWorks' Global Innovation Lead.' The article touches on new additions to JavaScript tools, techniques, and languages built on JavaScript. As the fuller report (PDF) says, 'The ecosystem around JavaScript as a serious application platform continues to evolve. Many interesting new tools for testing, building, and managing dependencies in both server- and client-side JavaScript applications have emerged recently.'"
Great... more single-core-hogging fun ahead...
I just started on a web project that is heavily javascript (even though it's an ASP.Net app). It feels like I stepped back in time 10 years. I'd have code not execute. Why? Some error somewhere in the code that was ignored. I had a typo on a property set somewhere else. No error. Why? Because javascript created a new property with the typo and set *that*. And every change requires me to run the app to see if it works, because I don't have a compiler to check the basics out ahead of time. And then, because I'm debugging an app in one window, when I'd open a new one to read the news, I'd hit other, non-ignored errors on those pages (advertisements) because 90% of commercial pages these days have error-laden javascript because people rarely check for error conditions. Horrible language.
The last time that was tried, it was called Java applets, and Oracle's incompetence at keeping its virtual machine secure led to browsers blocking Java applets by default.
Arguably, it should have been Python, which is a better language. But Python has a problem. Python's little tin god, Guido von Rossum, is in love with his own implementation, CPython. CPython is a naive interpreter. (A "naive interpreter" is one which does the specified operations in the specified order, with little optimization across operations.) In CPython, everything is a dictionary and a lot of time is spent doing lookups. This allows everything to be dynamic. In Python, one thread can patch objects in another thread while both are running. Objects can gain or lose elements on the fly. Even running code can be "monkey-patched".
The price paid for that excessive dynamism is that a Python compiler is hard to write, and an optimizing Python compiler can't optiimize much. Google tried in-house to make Python faster, and their "Unladed Swallow" failed humililatingly. (A different group at Google then developed Go, aimed at the same problem of producing something good for server-side processing.) The PyPy crowd has tried, hard, to make an optimizing Python compiler, and with an incredible amount of complexity under the hood, has made considerable progress, but not enough that PyPy is used much in production.
Pascal went down for a similar reason. Wirth was in love with his elegant recursive-descent compiler. But it didn't optimize, couldn't handle separate compilation, and had no way to handle errors other than aborting. Python seems to be headed for similar irrelevance. It hasn't even been able to replace Perl, which ought to be as marginal as "awk" by now.
Why don't browsers come with a generic scripting engine
They do, it's called JavaScript.
LLVM IR? Here you go
Your other request inverted, compile CIL to JS: jsil.org
Why are some developers obsessed with performance? The user probably isn't. They don't care whether something loads 2 seconds quicker
I thought loading faster was the difference between the user staying on a document and the user hitting the Back button to return to someone else's document. Web search engines have recognized this and have started to penalize slow-loading documents.
They don't always make it: Many do not make it at all. Survivor bias and all that.
JavaScript thrived because the alternatives were arguably far worse. Java applets were terrible. ActiveX a platform specific disaster. Flash is heavy. JavaScript allowed you to do the very minor things most web developers wanted at the time without having to turn your website into a plugin that disregarded base web technologies.
Yes, the language design is pretty silly. The function declaration syntax is silly. It tries to look like a member of the Algol tree, but its internals behave more like Lisp. The automatic type conversion system is the source of many jokes. But it still beat it competition at the time, because it was built into the browser, it talked directly to the page's DOM, and the competition did not. Today we'd have little trouble designing a better language than JavaScript for what we currently do with it, but our best bet to get something like that working is to build a language that compiles to JavaScript and then hoping browsers start building VMs for that language directly, skipping the JavaScript step. Still, not bloody likely.
One thing I personally like about Javascript is that it covers all three of the currently most popular programming paradigms.
You want an imperative style of development? Javascript can do that, check.
You want an object-oriented style of development? Javascript can do that, check.
You want a functional style of development? Javascript can do that too, check.
Some would argue that by covering so many different paradigms, it ends up covering none of them as well as languages that are designed for a specific paradigm from the ground up, and I wouldn't really refute this point... but it easily does all three of them well enough to still be profoundly productive when developing in any of them, and this means that a programmer is relatively free to pick the paradigm that best models the original problem when designing a solution. This, in my experience, results in shorter development cycles, and frequently much less buggy code.
File under 'M' for 'Manic ranting'
Because it's easy to mistake one's personal biases for sound judgment about what is "good".
I won't sit here and defend every design decision in javascript, but it's a lot more sophisticated than meets the eye. I think of it more like Lisp than Java; it encourages (among skilled programmers) a functional programming style, which turns out to be both under-used as a programming paradigm and very nicely fitted to the kind of event-driven tasks people use javascript for.
If you aren't writing higher order functions in javascript (functions that take functions as values or return them as values) you aren't fluent in javascript and aren't qualified to pass judgment on it.
Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
I'll get hate from the programmers but fuck it, truth is truth. Wanna know what is wrong with JavaScript? The entire damned concept, that is what!
I mean think about it, if I told you "I have an idea! Just to get some information you are gonna have to run strange code from over a dozen places, you don't know these places, if they have malware, you have to trust ALL these places or you can't have the information" you'd say that is seriously fucking STUPID, wouldn't you? That is how modern ad driven web works, calling shit from God knows where with zero control or fine grained permissions, its all run by default....STUPID.
What we need is either a new language built from the ground up with the realization that there are seriously nasty people out there trying to fuck your systems up, or JavaScript seriously needs a rewrite with the modern situation in mind. As it is now everybody keeps trying to fix the bullet wounds of failed design with bandaids like sandboxing, low rights mode, but at the end of the day the very concept of clicking on a link and suddenly getting code from a dozen sites you don't know and executing that code? its just a dumb idea.
ACs don't waste your time replying, your posts are never seen by me.