In Animation and 3D: the web is doing it wrong, I argue that the way the web does animation and 3D is completely bogus and deserves to die. With Tao Presentations, we offer a dynamic document description language that lets us write shorter code that is much closer to storytelling. We’d like to bring this to the web.
Have you ever created a dynamic animation on a web site, or displayed a 3D object? Really, why is it so complicated? Why should I learn how to use half a dozen libraries, write dozens of line of boilerplate HTML, WebGL and CSS code, just to rotate some text on the screen or display a 3D object? Why do I need three (or four, or five) languages, libraries or frameworks to design a single animated web page?
In the realm of business presentations, Tao Presentations solved this problem with a 3D dynamic document description language, letting you easily create sophisticated interactive 3D animations and presentations. What if we brought this very innovative platform to the web? What kind of applications would become possible if we improved web browsers in the areas of storytelling, interactivity, 3D or multimedia?
Recently, a user of Tao Presentations informed us that Google Chrome displayed a dire warning after he downloaded our software: “Tao Presentations may be malicious software”. Uh oh, for the average Joe, that’s a big no-no.
Google locks out “unapproved” programs
It’s not just us. Recently, I tried to download some of the amazing demos created by Iñigo Quilez. Same thing. Seriously, a 4K exe that manages to display a complete mountain? And Google Chrome would have me believe that there’s room in there for “malicious software”? Get real.
Now, it took me quite a while to find a solution to this problem. Apparently, you just need to record your site in Google’s Webmaster tools, and after scanning your site and ensuring (I assume) that there’s no known virus signature in the files, things should improve.
I still find this really annoying that a browser vendor would, by default, tag unknown files as “malicious”. Who are they to make this judgment call?
Why didn’t Google implement a real solution?
Shouldn’t they instead have something a little more sophisticated, that actually detects malicious signatures? You know, like a real anti-virus? Don’t tell me that Google doesn’t have smart enough engineers to write an in-browser anti-virus that doesn’t completely suck.
Nah, instead they went the easy route: anything that we don’t know is malicious. And we tell your users so.
I used to be a big fan of Chrome. Not anymore. Because of this single issue. I think this demonstrate an incredibly stupid arrogance and lack of technical diligence on Google’s part.
Google overstepped its authority and took advantage of their weight. Let’s not get used to it.
I gave a short talk about LLVM today. The link to the talk is tao://git.taodyne.com/examples/LLVM (sorry, can’t make it a hyperlink, as WordPress removes the tao:// part…). To watch this link, you will need Tao Presentations, which itself uses LLVM for the rendering.
This is not the first meta-talk made with Tao Presentations, but for some reason, this one reminds me of the first time I presented HPVM from a Powerpoint within HPVM.
I have release the source code for the “Season’s Greetings” from Taodyne. This can give you an idea of what XL can do today. In that video, which is rendered in real-time and in 3D, the XL program executes 60 times per second to synchronize the animations on the screen with the background movie.
In other XL-related news, I’ve been working on an updated language reference document. This describes where I want to bring XL, notably the type system and library. A lot of what is in this document is not implemented yet, but it will give the directions that I intend to follow in the coming months.
I’ve been working for years on a programming language called XL. XL stands for “extensible language”. The idea is to create a programming language that starts simple and grows with you.
All the work of Taodyne, including our fancy 3D graphics, is based on XL. If you think that Impress.js is cool (and it definitely is), you should definitely check out what Tao Presentations can do. It’s an incredible environment for quickly putting together stunning 3D presentations. And we are talking real 3D here, with or without glasses depending on your display technology. We can even play YouTube videos directly, as the demo below shows.
But the paradox is that the work for Taodyne keeps me so busy I’m no longer spending as much time on the core XL technology as I’d like. Fortunately, vacation periods are an ideal time to relax, and most importantly, think. So I guess it’s no chance if Christmas is one of the periods where XL leaps forward. Last year, for example, I implemented most of the type inference I wanted in XL, and as a result, got it to perform close to C on simple examples.
This year was no exception. I finally came up with a type system that I’m happy with, that is simple to explain, and that will address the demands of Tao Presentations (notably to implement easy-to-tweak styles). The real design insight was how to properly unify types, functions and data structures. Yep, in XL, types are “functions” now (or, to be precise, will be very soon, I need to code that stuff now).
Another interesting idea that came up is how to get rid of a lot of the underlying C++ infrastructure. Basically, symbol management for XLR was currently dome with C++ data structures called “Symbols” and “Rewrites”. I found a way to do exactly the same thing only with standard XLR data structures, which will allow XLR programs to tweak their own symbol tables if they choose to do so.
An interesting rule of programming: you know you have done something right when it allows you to get rid of a lot of code while improving the capabilities of the software.
Back to coding.
There is a little bit of activity on the XLR-Talk mailing list, dedicated to discussions about the XL programming language and runtime. XL is a high-level general purpose programming language I designed and implemented over the years. It exists in two primary flavors, XL2, an imperative statically-typed language, and XLR, a functional flavor. Both share a very similar syntax and basic concepts.
One of the interesting threads is about using XL for high-performance computing. I like it when someone writes:
Thank you for releasing Xl and in particular Xl2, this is a most
interesting and exciting development. I am a very long-time C++ user
and appreciate the power of generic programming through templates but
the syntax is clunky and I often find myself going off the end of what
is currently possible and end up messing around with the C pre-
processor which is frustrating. I am hoping that Xl2 will prove to be
an effective alternative to C++ templates and provide the programming
flexibility I crave.
Now, XL2 is not ready for prime-time yet. Its library is significantly lacking. But the core compiler is already quite advanced, and can compile very interesting pieces of code. For instance, XL was as far as I know the first language to introduce variadic templates, for code like this:
generic type ordered where A, B : ordered Test : boolean := A < B function Max (X : ordered) return ordered is return X function Max (X : ordered; ...) return ordered is result := Max(...) if result < X then result := X
What happens in this little piece of code is interesting. It introduces two key features of XL: true generic types and type-safe variadics.
True generic types
ordered type is an example of “true generic type”, meaning that it can be used as a type in function declarations, but it implicitly makes the corresponding function generic (C++ programmers would say “template”). In other words,
ordered can represent types such as
real, and you can use
Max with all these types.
In that specific case,
ordered is a validated generic type, meaning that there are some conditions on its use. Specifically,
ordered only represents types that have a less-than operator, because that operator is necessary to implement
Max. Note that a compile-time failure will occur if you attempt to use
Max with a type that doesn’t have a less-than, even if no less-than operation is used in the instantiation.
The second interesting feature demonstrated on this small example is the use of
... to represent arbitrary lists of arguments. This is used here to implement type-safe variable argument lists. You can for example write
Max(1, 3, 5, 6, 9), and the compiler will recursively instantiate all the intermediate
Max functions until it can compute the result.
These same features are also used for functions that have lists of argument with differing types, such as
WriteLn. The XL2 implementation of WriteLn is found here:
to WriteLn(F : file; ...) is any.Write F, ... PutNewLineInFile F
Write function itself is implemented with a similar recursion that ends on functions that write a single argument, e.g. an integer value.
How does it help HPC
So how do these features help high-performance computing? They allow you to easily write highly generic code, covering a large range of uses, without paying a run-time penalty for it. No objects are constructed. No garbage collector is required to clean up memory allocations : there are no memory allocations. Everything can easily be inlined.
There are other features in XL that also help with HPC:
- Expression reduction allows you to combine operations for performance or logical reasons, e.g.
- Configurable code generation allows you to take advantage of specific hardware and integrate it directly into your code.
Where do we go from here?
XL2 is currently a little bit on hold because I’m currently focusing a lot of my energy on the functional variant, XLR, used by Taodyne in its products.
However, I believe that it reached a stage where other people can contribute relatively easily. For example, it would be useful to implement the various “fundamental” data structures in the library, i.e. go a little bit beyond arrays. If you want to contribute to XL2, nothing would please more than to give pointers. Simply join xlr-talk.
Here is the right way to tell people about DRM and freedom. I’m sorry I can’t embed it here, YouTube says “Embedding disabled by request” (who talks about DRM…) You should also read the EFF original story.
Unfortunately, the freedom fighters are not always that good. Here is an entirely wrong way to attack the problem. Hint: don’t watch that movie, it’s boring. Instead of making simple points in a humorous way, we get a lot of talking heads, all on the same side of the story except for a few “bad guys”. Only the analogy with music remotely hits a chord in that whole movie. Yawn…
Don’t get fooled, though. There is a war going on, a war to grab land and power, a war to get more control. That war is currently being played on your iPhone by Apple, on your PS3 by Sony. But it’s all about denying you rights that you have and that you should fight to keep. Gizmodo says it quite well:
The easy, cheap reply would be to write the author off as a blithering idiot who has failed to notice that his entire environment has been drastically reshaped by open-source innovation, and the proof slaps him in the face every time he looks at a browser. The easy, cheap reply would be to write the author off as a blithering idiot who has failed to notice that his entire environment has been drastically reshaped by open-source innovation, and the proof slaps him in the face every time he looks at a browser. But, in fact, I think he (and others like him) are not idiots; they are reasonably bright people making a couple of serious and identifiable errors in their reasoning about open source, closed source, and innovation.
Eric Raymond makes a fool of himself with this post. To begin with, he quotes only a fraction of my “screed”, later makes fun of “M’sieu de Dinechin”, and barely avoids calling me a blithering idiot. I’m honored he later revises his judgment and ups me to “reasonably bright”…
Yet for all the name calling, ESR totally misses my point: developers need to eat, and corporations provide vast majority of the necessary funds, even to open-source contributors like ESR or myself. My XL work is all open-source, but I would not have been able to afford it without a regular source of income. That’s my point, and if ESR wrote a single word to address it, I didn’t see it.
As for claiming that open-source build the world-wide-web, sorry Eric, but that’s bollocks and you know it. I could not even find any evidence that Berners-Lee’s browser, WorldWideWeb, was open-source at the time. What everyone knows is that Berners-Lee worked for CERN at the time, in other words he had a stable revenue, and that only reinforces my point. The browser that ignited the web was not Berners-Lee’s (nobody could afford the incredibly expensive and closed-source NeXT machines that ran it) but Mosaic. And as I pointed out in my “screed”, the source code of Mosaic was public, but not open-source by any standard definition. More importantly, it is silly to ignore all the corporate contributions that made the web what it is today, from Netscape to Microsoft to Cisco to fiber-optics to ISPs…
It is legitimate to say that “Tim Berners-Lee invented the world-wide-web”. I think it is even OK to say that hackers built it. But that’s a far cry from “open-source built it”, which seems to be what ESR would want us to believe…
Ultimately, I’d say that Eric’s error number zero is to confuse “ideas” with “innovation”. Innovation is ideas made real.