Emscripten Compiler Gets Optimizations, Now Self-Hosting 60
Emscripten is an LLVM-based compiler from dozens of languages to JavaScript (previously demoed as a repl and used to port Doom to the browser), and some recent changes have made it a bit faster, and allowed it to compile itself. Some highlights include a redundant variable eliminator, parallelization of the optimizier and compiler, and a new relooper. From the developer's weblog: "With all of the emscripten optimization passes now in JavaScript, I then worked on parallelizing that. ... The speedup can be close to linear in the number of cores. ... For the LLVM to JS compiler, I made the emscripten compiler parallel as well: It splits up the LLVM IR into 3 main parts: type data, function data, and globals. The function data part is unsurprisingly by far the largest in all cases I checked (95% or so), and it can in principle be parallelized - so I did that. Like in the optimizer, we use a Python process pool which feeds chunks of function data to multiple JavaScript compiler instances. There is some overhead due to chunking, and the type data and globals phases are not parallelized, but overall this can be a close to linear speedup. ... [On the new relooper] Note that this update makes Emscripten a 'self-hosting compiler' in a sense: one of the major optimization passes must be compiled to JS from C++, using Emscripten itself. Since this is an optimization pass, there is no chicken-and-egg problem: We bootstrap the relooper by first compiling it without optimizations, which works because we don't need to reloop there. We then use that unoptimized build of the relooper (which reloops properly, but slowly since it itself is unoptimized) in Emscripten to compile the relooper once more, generating the final fully-optimized version of the relooper, or 'relooped relooper' if you will."
yes but does it... (Score:2)
run linux in the browser ?
----
Sincerely Emscripten is way cool...
Re:yes but does it... (Score:4, Interesting)
Re: (Score:2)
now what we need to do is compile virtualbox with it so that we can run any pc operating system in the browser even several of them at a time. this could be a great way to bench mark you browser and its js engine of course it would be hell of a slow but a fun project to attempt
Re: (Score:2)
It's neat to see it working and there will be lots of ways it could be applied but really browsers need something like PNaCl - where LLVM bitcode can be compiled or interpreted by the browser with as little overhead as possible in a sandboxed environment.
Re: (Score:2)
https://github.com/kripken/emscripten/wiki#wiki-body [github.com]
I don't see any limitations there really in how they are applying it. Demos that work on IE, Opera, Firefox, Chrome, Safari on any chip type.
I don't see a need for pnacl.
Even last year azakai was reporting emscripten output was running at 2x to 3x of optimised C.
There's a few things I guess it'd be nice if emscripten had like native 64 bit integers, but there's a Firefox bug on adding that to javascript w/ actual patches, so I imagine it'll get added to a
Re: (Score:2)
Aside from the overheads of the above, JS is executed from inside a browser through events. You might have seen a message in a browser along the lines of "Javascript is taking too long to return should I kill it?" if a JS snippet does not exit quickly enough within some preset duration. The browser is essentially frozen while it's
Re: (Score:2)
Re: (Score:2)
If you checked out the demos, such as bananabread, emscripten is fully capable of doing javascript threading.
That is, any work that does not need DOM access can be done on background threads.
The "freezing" and "time slicing" are not particularly interesting objections. Any application that has to interact with the DOM has the same issue, which is why JavaScript hasn't solved it on the main thread, apart from the perfectly reasonable approach of event based code. And yes, this means using setTimeout and re
Re: (Score:2)
Re: (Score:2)
What we need first is to compile Firefox or Chromium to javascript. That way, we can finally be freed from that annoying non-compliant and otherwise broken IE crap that calls itself a browser.
Chrome Frame (Score:2)
Re: (Score:2)
Any serious management team will discard the "Chrome Frame" option as it requires the user to go through extra hassles, and like you said, in some cases where the user does not have the proper privileges it simply does not work. Therefore, this solution is actually a non-solution, unfortunately.
lather, rinse, repeat (Score:2)
Nope (Score:1)
wow (Score:2)
DOOM (Score:4, Informative)
I followed the link to Doom (and the next link, and the next link...) until I finally got to:
Harvey Anderson
Mozilla Corporation
650 Castro Street, Suite 300
Mountain View, CA 94041
Email: dmcanotice@mozilla.com
Phone Number: 650-903-0800
Fax: 650-903-0875
Re: DOOM on browser available on Mozilla website - Cease and Desist Notice - DMCA Notice of Copyright Infringement
Dear Mr. Anderson:
In accordance with Mozilla’s copyright infringement policy, this is to notify you of activity occurring on the Mozilla site listed below which infringes on the exclusive intellectual property rights of Id Software LLC, a wholly owned subsidiary of ZeniMax Media Inc. The copyrighted work at issue is Id Software’s proprietary software game DOOM® (“DOOM”). The link below offers an unauthorized derivation or version of Id Software’s DOOM game.
https://developer.mozilla.org/en-US/demos/detail/doom-on-the-web/ [mozilla.org]
DOOM is a registered trademark and the game assets are copyrighted material. Use of the mark DOOM and copyrighted assets without our authorization and consent, directly violates our trademark and copyright rights in and to such intellectual property. We hereby demand the immediate removal of all such links from your website and written assurance that you will prevent any further infringement of Id Software’s intellectual property rights. I have a good faith belief that use of the copyrighted materials described above as allegedly infringing is not authorized by the copyright owner, its agent, or the law. I swear, under penalty of perjury, that the information in this notification is accurate and that I am the copyright owner or am authorized to act on behalf of the owner of an exclusive right that is allegedly infringed.
Sincerely,
Joshua Gillespie
Associate General Counsel
ZeniMax Media Inc.
1370 Piccard Dr., #120
Rockville, MD 20850
T: 301.948.2200
Email: jgillespie@zenimax.com
Re: (Score:3)
Re: (Score:2)
Re: (Score:2)
Is sending a C&D regarding Doom on the browser more acceptable if it turns out that it's from his angelic business partner?
Re:ZeniMax CEO is a piece of shit (Score:4, Informative)
The wikipedia page you reference states explicitly that he was acquitted of all charges in the criminal suit (and is therefore NOT a known criminal), and he agreed to be banned from banking to make a civil suit go away. That suit was never resolved, so we don't really have any idea whether he was guilty or not - he might have agreed on the basis that he was tired of defending himself in court and didn't care much for being a banker anyway. Let's face it, settlements in the face of expensive yet questionable government prosecutions are hardly rare, especially in the USA.
The rest of the wild claims you assert aren't supported by any of the wiki pages either. Maybe it's all true but it's impossible to tell from your post. At any rate, it has nothing to do with the fact that DOOMs artwork and level data is still under copyright. If you want to get pissy at somebody about that, go complain to Carmack - he's the one who decided to open source the code but not the game data. Or not: he does a lot more for open source than most game company CEOs do.
Re: (Score:1)
The name's
NEO
Re: (Score:2)
The problem is they cant distribute the wad files. Other Doom engines such as prboom, zdoom, jdoom (my favorite), etc. have done just fine for over a decade as they only provide a "doom compatible" engine. The user must provide the wad files themselves even if they intend to play the shareware wad files that are freely available. They should have made or searched for a freely distributable total conversion wad to avoid any problems. I am sure there are plenty to be had off Doom fan sites.
There was a Doom ga
Take down notice from ZeniMax Media (Score:2)
I like how the Doom Port [slashdot.org] now redirects to a take down notice sent by ZeniMax Media Inc's legal counsel.
There are free assests for running on the Doom engine, but I guess not running actual Doom won't get you linked anywhere cool.
Re: (Score:2)
Re: (Score:3)
So they assert they own the copyright, and issue cease and desist orders based on that assertion, because they don't know who owns the copyright?
Seems one could challenge the cease and desist by requesting they identify precisely what they are claiming ownership of, and proof that they do in fact own it.
If, they can provide that, great, then request a license.
If not, I'm not, then the C&D doesn't hold a lot of water.
That's how I'd tackle a C&D for most abandonware. This is a little different though;
Re: (Score:2)
So they assert they own the copyright, and issue cease and desist orders based on that assertion, because they don't know who owns the copyright?
They know they own the copyright at least in part. They are claiming infringement of copyright in that part, whether or not that part is complete.
Re: (Score:2)
Re: (Score:2)
Yes, total PR disaster. I remember being unable to pick up a newspaper or turn on a news program without hearing the outrage. I'd be walking around on the street or in a store and everyone was complaining about how evil Zenimax was for their takedown notice.
Wait, what?
the only reason we need this... (Score:2)
is because a bunch of squabbling companies can't agree what kind of runtime to put in the browser. So, we're stuck with JavaScript, .NET, and the JVM. How hard can it be to turn the llvm into a plugin?
Re: (Score:1)
n compteting standards
let's add a new one!
n+1 competing standards
Re: (Score:2)
JVM and CLR are not competing standards, they are failed standards.
JavaScript is a standard scripting language, but not a VM.
Right now, the number of competing standards for embedded virtual machine for compiled languages is zero.
Re: (Score:2)
The big issue is probably sandboxing, so you'd need a VM which was sandboxed like Java or Javascript, and then to deal with the constant security headaches as people find vulnerabilities. If it was a trivial problem someone would have done it by now, but please do go ahead :)
Re: (Score:2)
No, the squabbling companies have agreed on JavaScript and the DOM as the runtime, and agreement on additional Web APIs for audio, game pads, fullscreen mode, orientation, etc. is likely soon. It works, it's spectacularly compatible in the latest browsers, and there's little need for anything more.
LLVM isn't a runtime, NaCl or better PNaCl talking to the Pepper API is a runtime, but it's an underspecified Google-controlled approach that Apple, Mozilla, Microsoft and Opera will never adopt . For all the all
Re: (Score:2)
These are two aspects where bytecode (or native) runtime would be certainly better. I don't see benefits of source level runtime... it's no easier to audit sources security-wise than to audit VM and it can break in so many more ways.
Re: (Score:2)
emscripten is compilation in advance of massive complex C code into JavaScript that truly runs anywhere. In most cases keeping your source code to yourself is unimportant; Facebook and Google ship MBs of JavaScript source to billions of browsers every minute. My impression is Java has more security vulnerabilities than JavaScript, but then again it's able to do more.
Java in the browser did deliver benefits; yet Java in the browser is almost completely dead. Maybe a bytecode or native runtime would have del
Re: (Score:2)
The obvious is completely missed.. (Score:2)
Re: (Score:2)
Qt (Score:2, Interesting)
Somebody's porting Qt to it - looks like it's just the non-gui parts for now, though:
http://ssj-gz.blogspot.co.uk/2012/11/quickie-qtcorejs-proof-of-concept.html [blogspot.co.uk]
Would be cool to be able to get Qt apps running in browsers without using the architecture-specific nacl [qt-project.org].
Javascript? Pfah (Score:5, Funny)
Anyone can compile C into Javascript. Only I can compile C into... Perl.
See cluecc [sourceforge.net].
(Clue allows C to be compiled, badly, into a variety of scripting languages including Lua, Javascript and Perl as well as Java. Some nutter even contributed a Common Lisp backend. It was an experiment to see whether exploiting certain vaguenesses in the ANSI C spec concerning pointer representation was useful. Unlike Enscripten, Clue doesn't have a big array of bytes representing the C memory; instead pointers are represented as object-offset tuples. It worked really well, but unfortunately nearly all existing code out there doesn't work right on a system where sizeof(int)==sizeof(double)==sizeof(char)==1 and sizeof(void*)==2. Plus, the compiler frontend I was using had a number of major issues. But it works well enough to run benchmarks.)
(And before you ask, yes, compiling C into Perl 5 is a total, utter, complete waste of time.)