New opportunities for D => ASM.js

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri May 16 12:26:53 PDT 2014


On Fri, May 16, 2014 at 02:52:43PM -0400, Nick Sabalausky via Digitalmars-d wrote:
> On 5/16/2014 2:21 AM, Paulo Pinto wrote:
> >
> >The ideas behind the browser are great, when looked from the Xerox
> >PARC hypermedia research, the implementation however leaves a lot to
> >be desired.
> >
> >The problem is that currently it is a document format, trying to be
> >an application, with a clustf**** of JavaScript/CSS/HTML with more
> >compatibility issues than when C was being standardized.
> >
> 
> Exactly. I actually love HTTP/HTML as a document system (especially
> the older versions of HTML that deliberately left style/formatting
> mostly up to browser/user, with the ability to override when really
> necessary). Not perfect of course, but still quite good overall.
> 
> But then using it as a GUI engine and software platform is like
> abusing Latex or PDF to make software run inside Acrobat Viewer. All
> the effort, bloat and compromises...and for what point?

No software is feature-complete until it can read email. :-)

Today I skimmed over the PDF spec... and was horrified to discover that
I had been living in a fool's paradise, thinking that it was only a
passive *document* format. Turns out that it is yet another of those
document format turned Turing-complete messes. With its own embedded
flavor of Javascript, even. (And obviously, it's gratuitously
incompatible with "standard" JS). With the ability to attach files.
(Huh, what?! I thought PDF was *the* attachment... nope, not only it can
contain executable JS code, which is just a repetition of that security
nightmare that is Outlook + ActiveX, it can also encapsulate an entire
directory structure within itself. Yep. No bloatware here, move along.)
PDFs can also embed *movies*. (!!!)

So basically, you can create an entire interactive website inside a
single PDF file, complete with scripting, movies, embedded subfiles
(basically a self-contained directory structure aka URL tree). It would
utterly suck, of course, given that probably only crappy Adobe bloatware
would be able to interpret the resulting mess. But you could do it. And
obviously somebody *has* done it, since otherwise where did all these
features come from? One of these days, somebody's gonna reinvent the
browser inside a PDF file...

This seriously tempts me to go back to standardizing on Postscript. I
just want the *document* part of it, darnit!! What's with this obsession
of making every single file format Turing-complete so that it can run
scripts and play movies?! Why reinvent the computer inside a file
format?! Argh...

This is exactly the same thing that happened with HTML/HTTP. HTTP was
originally designed to be stateless because... the whole point was to
serve *static documents*?! It's a totally sucky protocol for interactive
media, to say the least. All the pathology with cookies, Javascript,
AJAX, and the rest of that jazz that got piled on top, basically arose
from trying to shoehorn a stateless protocol into something stateful.
Nobody ever considers to *replace* the darn protocol with something
*designed* for that purpose. Or that three-headed 5-eyed slimy
monstrosity that is HTML, with something a little more... *suitable*?...
for describing UI elements. Y'know, like a GUI toolkit or something! But
no, we have to use HTML because HTML is cool, and therefore that makes a
HTML UI implementation cool. The Emperor has no clothes, and nobody says
a thing lest they be regarded as fools.

A future generation -- if there even will be one, at the rate we're
going -- will look back and laugh at the foolishness that is today's
computing world.


T

-- 
What is Matter, what is Mind? Never Mind, it doesn't Matter.


More information about the Digitalmars-d mailing list