12 ms·
C++ on the web: emscripten, nacl, flascc
- BruceM 13y agoFloh's website is at http://www.flohofwoe.com/ http://www.flohofwoe.com/ and he's got links to demos of using Emscripten there as well as some other interesting stuff.
- kayoone 13y agoimpressive stuff http://www.flohofwoe.com/demos/dsomapviewer_asmjs.html 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.
- adamnemecek 13y agoI can't wait for the time when we will use C++ in the browser and JS on the backend. Oh the irony.
- derefr 13y agoTurns 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 13y agoI 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 13y agoIf 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.
- ErikCorry 13y agoActually if you are using C++ on the server there would be an argument for using it in a sandbox like NaCl. After all, you don't want to get pwned on the server any more than the user wants to get pwned by a web game.
- PommeDeTerre 13y agoC and C++ are already being heavily used on basically all servers. Linux, the BSDs, the various commercial UNIX systems, OS X, and Windows all make very heavy use of C, and also C++ in some cases. Apache, nginx, lighttpd, and many other web servers are written in C or C++. The same goes for the major database systems commonly used today. The main interpreters for languages like PHP, Python, Perl, and Ruby are written in C. Even if you're using a Java implementation of those languages, or some other language that targets the JVM, the runtime you're using is most likely written using C and C++. So I find it kind of silly to hear Ruby and PHP advocates say how it's "dangerous" to use C or C++ for server-side development. Their preferred stacks are already essentially all C and C++! The amount of C and C++ code powering their applications dwarfs the amount of Ruby or PHP code they might have written.
- jeremyjh 13y agoWell, it would be dangerous to let those developers write application code in C++.
- PommeDeTerre 13y agoTrue, but the other languages don't necessarily help with that, either. PHP doesn't prevent programmers from writing code susceptible to SQL injection attacks. Ruby doesn't prevent programmers from writing poorly-performing web apps that are brought down or rendered unusable with a even minimal level of traffic. It's dangerous to let those kind of developers write any code.
- eru 13y agoYou can make C safe, it just takes lots of effort, as you see in the software you mentioned. Other languages may require less effort to write safe programmes in.
- ashcairo 13y agoC++ 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 http://multiplay.io)
- niggler 13y ago"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
- ashcairo 13y agoThat's really interesting actually. Is JavaScript still considered a scripting language or given it's modern web development application, is it now a fully fledged programming language?
- Joeri 13y agoThe 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.
- sultezdukes 13y agoI'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 13y ago> IE probably won't ever implement WebGL Au contraire, http://www.theverge.com/2013/3/30/4165204/microsoft-bringing-webgl-support-internet-explorer-11-windows-blue http://www.theverge.com/2013/3/30/4165204/microsoft-bringing...
- ashcairo 13y agoYou beat me by 30 seconds. Congrats!
- ashcairo 13y agoThe new version of IE supports WebGL: http://www.theverge.com/2013/3/30/4165204/microsoft-bringing-webgl-support-internet-explorer-11-windows-blue http://www.theverge.com/2013/3/30/4165204/microsoft-bringing... *I totally nerded out when I found out by the way.
- modeless 13y agoToday's games make you wait while they download 20 gigs of content up front, but there's no good reason for it. It's already been announced that the PS4 will let you start playing games before they've completely downloaded, and Web games will work the same way. You only need the first part of the first level to start playing.
- kayoone 13y agoIt might not be the best thing for AAA multi gigabyte games like Crysis 3 (yet), but it makes sense for alot of smaller scale projects, especially online games (typically free to play) where the barrier to entry is low. Longterm in also makes sense to think of games loading on demand while you play vs downloading everything to disk and install it somewhere. It also solves alot of the piracy problems of the industry. Today there are Game Engines like Unity3D that already offer Native Client deployment and have their own browser plugin for IE or anything unsupported. Add to that a HTML5 deployment option through Emscripten & ASM.js and the games will basically run anywhere, just in edge cases requiring a plugin.
- chadaustin 13y agoI 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-web-with-emscripten-18258801 http://www.slideshare.net/chadaustin/multiplatform-c-on-the-...
- doktrin 13y agoThanks. 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)?
- muyuu 13y agoIs this presentation available for download outside of slideshare?
- mtgx 13y agoWasn't there a rumor that Sony would use the full native OpenGL for the PS4? Was that true?
- zokier 13y ago> 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-the-ps4s-hardware-power-controller-features-at-gdc/ http://arstechnica.com/gaming/2013/03/sony-dives-deep-into-t... 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.
- _ak 13y agoemscripten 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 https://github.com/akrennmair/speech-to-server