Sweet! Another Javascript!?!

Scoble, the famous self-promoter who many people love-to-hate, did a short post tonight on “ECMAScript“, something of a mashup between C++ and Java that aims to replace (read: fix) Javascript. Is this good (everyone knows Javascript was poorly thought out)? Is this bad (aren’t browsers bad enough as it is)?

The Good

Let’s start with the positives. First, everyone (and I do mean everyone) that has used Javascript knows the following:

  • not well thought out
  • very hard to develop with
  • supported and interpreted different ways (because of the DOM) by different browsers

Given those items, the simple fact that ECMAScript has much better syntax and higher level functionality gives it a major leg up on the competition. A language that is based on both C++ and Java, one would assume, has many more development and debugging tools than Javascript/AJAX currently does. What do you use now? Firebug? And that’s it? Oh right, that’s all there is.

You Will Fail
Just like the entire .NET Platform.

If you actually look at some of the specs, you should be impressed. I would love to have structure, syntax, and functionality comparable with compiled/server-side/”normal” languages like C/C++, PHP, and Java. True DOM OOP? Oh how you tease me…

The Bad

Take a look at any website that isn’t built entirely in flash. Chances are that it involves at least one “hack”… something to make the fancy menu work? Or perhaps some dynamic data flow courtesy of AJAX? Or one of those little-known projects like Google Maps that work so fluidly? Let’s look at some info on the three “main” browsers (and pretend Opera doesn’t exist):

  • Internet Explorer is a total failure, and is currently trying to play “catch up” with the rest of the browser world. This is not news.
  • Mozilla/Firefox has become the poster child for attempting to closely follow the W3 recommendations, and receives praise daily from almost anyone who works with computers.
  • Safari has been known to be better than IE, but worse than Firefox. However, with the new/forthcoming release, many of the problems in rendering items, as well as it’s idiosyncrasies, are fixed or improved. There’s even rumors of it being based on the ‘Gecko’ engine…

Browser Wars
Gates = Sith = Evil. Get it?

My point? The three most widely used browsers are all terribly different. They can’t agree on how to render certain HTML/XHTML and CSS elements… let alone how to handle Javascript and the DOM. What happens when you try and implement a language that is meant to do more while replacing Javascript?

The Ugly

If you’ve been paying attention the last year or two, then you’re aware that very few (if any?) AJAX applications are custom coded from the ground up. More often than not, they use a library like Prototype or jQuery. Even Google doesn’t… they developed a “translator” that moves Java to Javascript, allowing you to code in Java and then implement it as Javascript/AJAX: it’s called the Google Web Toolkit.

Think about all those applications, pages, sites, and “business models” based around using Javascript and a certain library. Think about how long it took them to figure out how to do what they wanted… and then guess at the cost. Once you’ve wrapped your brain around that, think about how long and costly it would be to switch languages.

That would be the web equivalent of recoding your entire program in C++ when it was written in FORTRAN… it would really be that different.

Understand Me
Pretty much the same thing here.

My Stance

Believe it or not, I don’t have one. I’m divided. I really would like to have everything I described as being a benefit of a “real” language to replace Javascript, but I think the outcome of attempting this would be truly disastrous.

Maybe the answer is not to build another language that sits on the browser for DOM usage… why not build that functionality into server-side languages like PHP or Ruby? I realize that sounds impossible, but what if there was a way for the script to recompile itself (or portions of itself) as necessary? Tie in connections to the browser itself, and doesn’t that meet all the requirements without all the hassle?

“Told You So”

I’ve just created a new tag:  “Told You So”.  Why?

“Scientists create a powerful antimatter beam” uses the phrase “amazingly similar to a warp reactor from Star Trek”.

Did I not already mention that most “real” inventions are found in SciFi many (in this case twenty) years earlier? 

Hancock: AT&T’s Language to Spy On You

Wired recently covered “Hancock”, a new programming language developed by AT&T used to spy on telephone customers and “graph” the results. Alot of people are up in arms over this, decrying the end of privacy… but I, at least, think they’re misguided, if not totally wrong.

“Language”?

I think that the use of the word “language” here is not the write way to describe Hancock. If you look at the code sample provided on Wired’s post, it should look familiar. It appears to be a very close cousin of C, with some procedural and syntax changes. At what point does a language change from and “adaptation of” to a new language? The obvious point in C vs. C++ is OOP… Should this be called a “security oriented C adaptation”? Or “C, using different libraries”?

In this case, however, it would appear that “different libraries” is an understatement, and “new language” is an overstatement.

VaderPhone
This is completely unrelated.

Uses

AT&T developed this language with security monitoring and “community of interest” goals in mind, but when you read about how it works, and the end results… does anything else come to mind?

This language has huge potential. Looking for groupings of habits, traits, and connections between items (in this case, “people”) is a programmatical way to describe what Hancock does. Now imagine what search engines do. Or Facebook with their “social graph”. Or statistics’ processing.

If Hancock were to become more widely used, complicated things like searching for data and returning the most relevant results would become very easy… and, in the case of Google, perfect an already near-perfect system.

Maturation

Hancock is more than just an added library or two to a pre-existing language (kind of like C++), or a modification of one (Ruby)…. I believe it is a “maturation” of the language. As I mentioned before, it has many similarities to C, but makes some things much quicker, more efficient, and simpler than C. C++ was supposed to do that for C, but the end result was a more complicated language.

Iteration and data sorting is a huge part of any “real” language (LOLCODE does not count). Take another look at the sample provided by Wired, and then meditate on the code.

I Can Has Programming Language?
i can has SHUT YOUR MOUTH

Evil? Maybe.

Yes, maybe Hancock is currently being used for “evil” deeds like sorting through very private data to find “terrorists” for the American government. But take a step back from your emotions…

Elvis made “devil music” in his time… what’s he considered now? I’m pretty sure he can’t compete with Slayer…