[xquery-talk] HRE: and what I think we should tackle right now

David Lee dlee at calldei.com
Tue May 21 07:09:31 PDT 2013

>> Andrew
I don't get it - the language of the browser is javascript, and its
easy to process json in javascript.... The back end could well be xml,
but the server -> client communication is always going to be json
while the processing language is javascript - what's the problem with

I wouldn't hold my breath for "always".
I will make a prediction and bet a 1 beer delivered in person if you come to me personally in 5 years.
I predict that in 5 years that the majority of Web Applications Running In Browsers will *not* be authored in JavaScript directly, but rather in a language that compiles to JavaScript.

I see a trend continuing as it has for 50+ years as languages and machines evolve - the pattern seems the same to me.
As machines get faster and people get more creative with languages they go through a phase

A) This language is great, its fast, its close to the machine its  obvious we will use it forever
B) Well it would nice if it had a preprocessor or maybe some libraries
C) I'm using the preprocessor and libraries so much I am not writing very *much* of the native language
D) Someone just invented a *compiler* to let me write code in a language I prefer ... but ... 
  its slow and buggy and there's that 10% it never gets right so no Real Coders will ever  use it
E) The compiler gets better and better so that no longer is the layer below it needed for anything but the most obscure tasks.
F) The compiler gets *faster* then hand written code for the layer below it because it can optimize better than humans
  for a majority of expressions especially for large systems where you simply cannot optimize everything by hand.
G) What happened to all those people who would never use this new language ?  Nearly everyone is using it(s).
H) Language "A" is used only by people writing the compilers for language D and isn't taught in school ...in fact most
  people don't even know it exists.

Examples of this trend 
Machine Language -> Macro Assembler -> C -> C + libraries -> C++ 
Macro Assembler -> Fortran / Basic / Pascal ... 
C/C++ -> Java
Java -> (really Java Bytecode) ->  jRuby / Scala etc.
C++ -> JavaScript
C -> Objective C
JavaScript -> JavaScript + Libraries (jQuery etc.) -> Dart/GWT/CoffeeScript etc.
HTML -> GUI's that produce HTML -> JavaScript that produces HTML ... 
And even now were seeing new and old languages based on GWT ! 
Turtles all the way down.

Right now I see very little "Pure JavaScript" written in any bulk ... for people who write JavaScript Applications they do so with Libraries (like jQuery, YUI etc.).  This is Phase #B from above.
There are a few starting the trend of bucking the JS+Libraries and going for the new language directly.
I personally have become a fan of GWT ... and my JavaScript writing friends think I'm nuts.
But I have not stumbled  into the brick wall they claim is in front of me every step.
I understand their scorn because they know JavaScript inside-out so writing in some other language that *produces impossible to read JavaScript* is nonsensical.

Exactly the same discussions I had with C programmers in the 80s,  and C++ programmers in the late 80's
and Java programmers in the 90s ...

So I make a prediction <duck pie>.
In 5 years (give or take a decade) the shift will be complete as it has nearly universally done for the past 50
and Web Applications will be written in a language that compiles to JavaScript instead of JavaScript manually.

And when that happens.   The major reason for JSON will vanish. (that being it converts to JavaScript by simply looking at it).
I am not saying that JSON will vanish, it has other reasons to exist and by then will likely be as entrenched as ASCII,
and possibly as hard to get rid of ... but ... No longer will it be The Inherently Obvious format to send data to browsers.
I will not predict what will replace it, but I do predict that the biggest leg holding it up will simply vanish.


David A. Lee
dlee at calldei.com

Andrew Welch
talk at x-query.com

More information about the talk mailing list