The Next Browser Scripting Language Is — C?
mad.frog writes to tell us that in a recent talk by Adobe's Scott Petersen he demonstrated a new toolchain that he has been working on (and soon to be open-sourced) that allows C code to be run by the Tamarin virtual machine. "The toolchain includes lots of other details, such as a custom POSIX system call API and a C multimedia library that provides access to Flash. And there's some things that Petersen had to add to Tamarin, such as a native byte array that maps directly to RAM, thereby allowing the VM's "emulation" of memory to have only a minor overhead over the real thing. The end result is the ability to run a wide variety of existing C code in Flash at acceptable speeds. Petersen demonstrated a version of Quake running in a Flash app, as well as a C-based Nintendo emulator running Zelda; both were eminently playable, and included sound effects and music."
Now we can finally get this "web operating system" thing I've heard so much about...
Same as the old boss.
We can write PHP! And then browser security will be top notch.
You mean my preferred language has just become cool?
Ok, this is either great news or the world is about to end.
I think I'll go stand in a doorway for an hour or two, just to be on the safe side.
A learning experience is one of those things that say, 'You know that thing you just did? Don't do that.' - D. Adams
There used to be a project, many years ago, which was I believe called itself something like "Internet-C". It used gcc with a pseudo-code backend to produce portable binaries which could then be ran from a plugin or through an emulator. Since gcc was tuned for register based archectures and 68k was already an existing backend, I think the pseudo-machine code he used was based at least loosely on the 68k one.
Nope. SFX is generally event driven (hit a key, hear the sword swing) where music is not (enter an area and music plays continuously in the background).
SFX requires timing, latency, and speed to be accurate. Music requires bandwidth and a minimum level of continuous CPU cycles.
Both have different needs so you can have one without the other (when you are talking emulation).
GPL Deconstructed
Is that a pirate copy? Just curious...
Everything's being constantly reinvented but no actual progress is being made. Oh look, the 100th toolkit to do exactly the same thing! Oh look, a new way of layering something old on something old on something old to give something new! Oh look, another silver bullet framework!
Can anyone here remember the web of 10 years ago, for example? Content = text for reading + graphics for illustration. No bullcrap, just Google/Wikipedia style web sites to give me a simple navbar + content.
If the "byte array mapped to RAM" installed in Tamarin allows the code to store anywhere in the interpreter's space, that's a huge security hole. It can do anything the user process can do. If you're going to allow that, you may as well just load executable machine code directly, as with Active-X.
Anyway, the article is a blog post that rehashes an interview from last year. The info in that article is better.
primary? ummm... I thought the primary point of layers is so that you can do a lot with only a few simple function calls
http://en.wikipedia.org/wiki/Jury_nullification
This is an interesting hack but it does not do anything for improving either computational theory or improving web application development. Combine C arrays that can be coded within a page like Javascript with a web-browser's security model and you get yourself what exactly? Is this going to improve the speed of development, the security of a thin client, the stability of a browser, the ease of memory usage, the consistency of interfaces or reusability of code? Certainly there will be more features available to a browser client but will there be enough abstraction between the machine and the code to avoid having major security/consistency problems?
It is just not clear to me right now whethere there is a purpose to this beyond satisfaction of an interesting hack.
You can't handle the truth.
So Flash can simulating computing as it was back in 1998? Super....
This is the NFL, which stands for "Not For Long" if you keep making those bulls*** calls.
The more you run away from it, the closer you get to it. So now things are as inevitable as Death, Taxes and C.
A frightful three-some indeed.
MMO Quests are like orgasms:
You may solo them, I prefer them in a group.
The circle is now complete. When C left Unix it was but the back-end. Now, it is the API.
The last time I checked, Adobe Systems is about as hostile to open source as possible. They are the seldom acknowledged masters of the "first hit on the crack pipe is free" scheme.
http://labs.adobe.com/technologies/eula/air.html
Multiple helper libraries licensed under the MPL doesn't change the fact they are promoting another information silo.
http://www.maxineudall.com/2010/02/should-economists-be-sued-for-malpractice.html
And you realize all the overhead this created? It's why we needed dual core 3GHz 64 bit processors. C code, properly written is very tight and fast. Too many layers complicates the issue and introduces more chances of error. If you are looking inside Unix you'll find out the OS is written in C (and some assembler). You can have a GUI/Windows and still have C code..it's called X/MOTIF and has been around a long time, works well and is very fast. I'm pretty sure the current Linux GUIs owe a lot to to Motif.
How so? That's like saying sushi bars are there to try to get away from fishing.
Well, it must work because I've never had to catch a fish to eat sushi.
When our name is on the back of your car, we're behind you all the way!
I feel a great disturbance in the force as if a million admins suddenly screamed in terror . . .
Well, there's spam egg sausage and spam, that's not got much spam in it.
There's very little if any C code that can't be written basically the same for Perl to interpret it basically the same way. The exception is direct memory access, but there are ways. And besides, I'd rather access memory through an API that really manages it, like making it hard to unexpectedly overflow buffers or grant access to unauthorized other users.
I'd love a Perl interpreter embedded in my browser. I'd love to have a Perl API directly to the browser app and the browser documents' DOM. I'd love to have a "Perl commandline" that returns text like usual, or that works on remote data by URL, or that returns icons or other data displayable in the browser.
Javascript is a pain in the ass. I'd rather have a Perl engine, and all the Perl modules and scripts, to run against my browser the way I usually run against my terminal window.
--
make install -not war
Nope. SFX is generally event driven (hit a key, hear the sword swing) where music is not (enter an area and music plays continuously in the background).
SFX requires timing, latency, and speed to be accurate. Music requires bandwidth and a minimum level of continuous CPU cycles.
Both have different needs so you can have one without the other (when you are talking emulation).
In Parappa the Rapper, Beatmania, Guitar Freaks, Drummania, Keyboard Mania, Frequency, Amplitude, Taiko Drum Master, Donkey Konga, Guitar Hero, Rock Band, and even scenes in the Mario Party and WarioWare series, the player triggers sound effects at specific times, and these sound effects represent music that the player is performing. If the background music becomes desynchronized from the sound effects that represent music, the emulated environment becomes unusable. Even games that aren't directly about performing music, such as Rez, Lumines, and some scenes in Super Mario RPG, indicate the timing of various game world events using the music.
Trying to retrofit C into Tamarin seems bizarre. Why not use an on-the-fly sandboxing native C compiler? Tiny C (tcc) would seem like a good start.
http://bellard.org/tcc/
Being able to run Python or Quake inside a Flash VM sounds useful at first blush, but it seems you'd lose most of what makes webapps nice for both developers and users. In particular, C based apps are not designed to be streamed, whereas Flash or AJAX apps usually are (to some extent). Nobody wants to browse to a "web app" and then spend 5 minutes twiddling their thumbs whilst 20 megabyte of Python runtime or Quake is pulled down over the wire. Web apps just have a different DNA to desktop apps.
I can see this being used to accelerate computation-heavy subelements of a regular Flash app though. I wonder how much of this is being driven by a desire to run a Photoshop subset inside Flash?
Those who don't remember ActiveX are doomed to reinvent it. Poorly.
Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
... can it run Linux?
> You realise that all the OS layers, networking layers, web browsers,
> scripting languages are primarily to try to get away from C?
So? You are missing the bigger point. All of those layers and scripting languages you speak of are written in C. So C working in Flash means all of that other stuff can be brought over. Perl + Flash? Python + Flash? Ruby? The mind boggles at the possibilities.
Of course since nobody will want to stuff all of Perl + half of CPAN down the pipe every time an applet loads we will end up with predownloaded versions cached for use. Let the package war begin, will flash binary packages be maintained with .deb or .rpm... I can see Windows users fighting Package Kit or Synaptic to manage the cruft needed so that "web apps" can work. We could end up with an entire GNU/Flash[1] distribution lurking on every Windows PC.
[1] I object to the GNU/Linux misnaming abomination but this time it really will be a "GNU" distribution since Linux won't be involved. At least until we get a formal 'distribution' being shipped by Adobe.
Democrat delenda est
Hooray! Now C programmers can join the fun of writing sluggish applications that eat up huge amounts of CPU even when they're doing nothing!
Deceptive headline, too, as this is just about compiling C to the bytecode that the Flash player interprets. Or even worse, now that I RTFA: "The LLVM instructions are converted into opcodes for a custom Virtual Machine that runs in ActionScript, a variant of ECMAScript and sibling of JavaScript." So your C is compiled to bytecode, that is interpreted by an interpreter that is, itself, a stream of the Flash player's bytecode.
Moore's Law notwithstanding, this is a pretty insane use of processor cycles, guaranteed to make your program run a couple orders of magnitude slower than it would if you actually compiled it, or rewrote it in Actionscript!
egypt urnash minimal art.
only an API of evil, Darth!
chrome://browser/content/browser.xul
Firefox inside Firefox inside Firefox...
For example, does it support buffer overruns? Double free's?
"Long run is a misleading guide to current affairs. In the long run we are all dead." (John Maynard Keynes)
A poorly re-invented ActiveX? I feel like I've just stared into the abyss, and seen Bill staring back at me.
I'm pretty sure the current Linux GUIs owe a lot to to Motif.
Indeed. The violent urge to get rid of Motif has been a driving force in most of the modern GUI development.