
C++ on the web: emscripten, nacl, flascc - BruceM
http://de.slideshare.net/andreweissflog3/quovadis2013-cpp-ontheweb
======
adamnemecek
I can't wait for the time when we will use C++ in the browser and JS on the
backend. Oh the irony.

~~~
derefr
Turns out we need performance on the front-end, and ease-of-development on the
backend, not the other way 'round.

Really, though, the strong motivating consideration is that while backend code
scales horizontally (i.e. you can throw money at an app and get more
concurrency), the user only has one computer, so you _have_ to optimize
frontend code for performance. If we could just pay money to make users'
computers faster I guarantee we wouldn't be worrying about browser JITs. :)

~~~
adamnemecek
I mean, I understand the reasons and more than anything I'm excited. But it's
still one of the things that if you time traveled to the 90's and told some
developers about the future, they'd lock you up in a mental asylum.

~~~
arthurrr
If you traveled back to the 90's, it would be a good fictional story about
computing dystopia.

In fact, it is still a good story about computing dystopia. But it's no longer
fiction.

------
chadaustin
I gave a similar presentation at GDC this year. Same conclusion, slightly
different supporting details. If you're interested:
[http://www.slideshare.net/chadaustin/multiplatform-c-on-
the-...](http://www.slideshare.net/chadaustin/multiplatform-c-on-the-web-with-
emscripten-18258801)

~~~
doktrin
Thanks. Both sets of slides were very interesting. While upon seeing
presentation slides I inevitably wish I could be privy to the talk, both were
informative enough to convey substance via slides alone.

The OP had a slide dedicated to platform-dependent components of building a 3D
game engine (memory management, threading, game loop, audio, etc.). While much
of the action happened "off camera", is the conclusion essentially that
[emscripten -> [ asm.js + webGL] etc.] makes this process _simpler_ (if still
tricky to debug)?

------
BruceM
Floh's website is at <http://www.flohofwoe.com/> and he's got links to demos
of using Emscripten there as well as some other interesting stuff.

~~~
kayoone
impressive stuff <http://www.flohofwoe.com/demos/dsomapviewer_asmjs.html>

But the most amazing thing is that they basically just compile their existing
engine that has years of development to the browser using emscripten and it
works. Thats a bit of a death blow to the new (and still very limited) JS 3D
Engines, but of course their ease of use is a big benefit and they still make
sense for smaller/web integrated projects.

------
ashcairo
C++ is awesome, but I kinda went the other way with my stuff for more
flexibility. JavaScript as the main programming language and C++ only for the
performance and driver access bottlenecks. (More info: <http://multiplay.io>)

~~~
niggler
"JavaScript as the main programming language"

Using node (or the v8 shell directly) javascript is competitive with python or
perl for most common scripting tasks

~~~
Joeri
The thing i've always found weird is how javascript didn't catch on for
windows sysadmin scripts instead of batch files, given that it's been
integrated into windows since w2k. People spend a lot of time learning
powershell, while the cscript engine exposes the same level of ability in
javascript.

~~~
just2n
I did all of my scripting in Windows in JS. You had full access to COM
objects, which means you could do a lot of stuff out of the box. One thing I
hated was that it wasn't even fully ES3 conformant (it's jscript), and it
seemed not to be maintained. I think they threw out cscript considerations
when they built powershell. For me, a simple bash shell or even a jscript REPL
would've been preferable.

I think my favorite least-known thing about writing simple tools for Windows
during my time as a sys admin was HTAs. You had full jscript COM access with a
web page presentation that's packaged into something that you can run without
opening a browser explicitly. It was awesome building full web applications
that could do pretty much any administrative task on Windows.

~~~
TazeTSchnitzel
HTAs were! I believe the user accounts management screen in Windows XP was
actually one.

------
_ak
emscripten is absolutely awesome. Some time ago, I used it to port libmp3lame
to JavaScript to encode MP3 files in the browser:
<https://github.com/akrennmair/speech-to-server>

------
mtgx
Wasn't there a rumor that Sony would use the full native OpenGL for the PS4?
Was that true?

~~~
zokier
> Sony is building its CPU on what it's calling an extended DirectX 11.1+
> feature set, including extra debugging support that is not available on PC
> platforms. This system will also give developers more direct access to the
> shader pipeline than they had on the PS3 or through DirectX itself. "This is
> access you're not used to getting on the PC, and as a result you can do a
> lot more cool things and have a lot more access to the power of the system,"
> Norden said. A low-level API will also let coders talk directly with the
> hardware in a way that's "much lower-level than DirectX and OpenGL," but
> still not quite at the driver level.

source: [http://arstechnica.com/gaming/2013/03/sony-dives-deep-
into-t...](http://arstechnica.com/gaming/2013/03/sony-dives-deep-into-the-
ps4s-hardware-power-controller-features-at-gdc/)

edit: that said, I wouldn't be surprised if there was an OpenGL stack
available for ps4, especially if they want to attract indie-devs.

------
muyuu
Is this presentation available for download outside of slideshare?

------
sultezdukes
I'm just not getting it. I understand the whole "let's make JavaScript the
assembly language of the web", but "real" games (not 1987ish 2d scrollers)
seem to have an uphill battle in the browser. IE probably won't ever implement
WebGL, and even if it did, what's the point? I can point and click on Steam
and download 20+ gig for some MMO. How's that suppose to work in the browser?

Can we take baby steps, and get really rich, hardware-accelerated UIs (maybe
canvas based), WebSockets, a nice debugging experience (source maps), etc...
before we're trying to play Crysis 3 in the browser.

~~~
adamnemecek
> IE probably won't ever implement WebGL

Au contraire, [http://www.theverge.com/2013/3/30/4165204/microsoft-
bringing...](http://www.theverge.com/2013/3/30/4165204/microsoft-bringing-
webgl-support-internet-explorer-11-windows-blue)

~~~
ashcairo
You beat me by 30 seconds. Congrats!

