C++ Developer moving to Web

Started by
15 comments, last by LJ_1102 10 years, 9 months ago

Simply put, people using C++ on the web, are doing so because they are unwilling to learn another language.

This is certainly true, it allows them to get productive quickly with whatever languages they already know.

For me, it is a portability issue. I know with C++ I can write my game once and know it can be compiled on every platform under the sun with minimal rewrite of the core boilerplate (boring) bits. I cant seem to find a single javascript platform that works on more than one or two platforms (including 3D) whilst still offering me enough flexibility to also use native libraries when required.

Plus the javascript emitted by Emscripten has the LLVM optimizations as a bonus so runs much faster than what I could manually write.

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.
Advertisement

Yeah, JavaScript (or its subset, asm.js) is just another target, what's the big deal *shrugs* ;-)

There's a reason subsets like asm.js are created to make the Web a viable target:

http://mozakai.blogspot.com/2013/06/what-asmjs-is-and-what-asmjs-isnt.html

http://en.wikipedia.org/wiki/Asm.js

Wt has tight integration with several modules, like JSON, or WebGL: http://www.webtoolkit.eu/wt/doc/reference/html/namespaceWt.html

If you have some prior experience with Qt and OpenGL, you should find a familiar ground with Wt and WebGL.

OP: as for Emscripten, see these two links, should explain most:

http://isocpp.org/blog/2013/03/cpp-to-javascript

http://isocpp.org/blog/2013/04/cpp-on-the-web-run-your-big-3d-game-in-the-browser

// the last one links to this: http://slideshare.net/andreweissflog3/quovadis2013-cpp-ontheweb

Okay so I think I am getting two recommendations here, unless I am reading this all wrong... :D. From what I can tell Serapth I think is pushing towards straight JS while Matt and Karsten are pushing me towards C++ JS. I really don't see why I can't use both. I mean learning JS will be great for me because I will understand the outputted code of emscripten and for managing input on my website. Emscripten would be great for optimized code that is used to make a game. So what do you guys think, should I just learn both and use both where they fit best? :)

I mean Karsten does have a point Serapth. Emscripten doesn't look like its only meant for lazy people who don't want to learn a new language. It also provides optimizations that would be time consuming to manually write. So if I could get more speed from it, why not use it for games? :)

And if I have C++ code, it would be a lot easier to make a desktop version or a mobile version of the game.

Thanks again for the replies :)

I really don't see why I can't use both. I mean learning JS will be great for me because I will understand the outputted code of emscripten and for managing input on my website. Emscripten would be great for optimized code that is used to make a game. So what do you guys think, should I just learn both and use both where they fit best? smile.png

Yup, that would actually be my recommendation! :-)

// Well, except that I wouldn't expect to gain much from looking at the output codegen, since it relies on asm.js and mostly looks like this:

asmjs1.png

I really don't see why I can't use both. I mean learning JS will be great for me because I will understand the outputted code of emscripten and for managing input on my website. Emscripten would be great for optimized code that is used to make a game. So what do you guys think, should I just learn both and use both where they fit best? smile.png

Yup, that would actually be my recommendation! :-)

// Well, except that I wouldn't expect to gain much from looking at the output codegen, since it relies on asm.js and mostly looks like this:

asmjs1.png

Ahh I can read that just fine! ;). Now I am hoping I can make a nice website with the help of the CSS, Jquery, and HTML skills taught here and here and a fun little sandbox game with Escripten and some micro frameworks using inline JS!

If course these tools all have their purposes or they wouldnt exist.

That said, you are just starting out and want to learn web technology. In that case, recommending a C++ cross compiler is just bad advice.

Had you said "i have C++ code I want to port to the web" I would have a different suggestion.


I cant seem to find a single javascript platform that works on more than one or two platforms (including 3D) whilst still offering me enough flexibility to also use native libraries when required.

There are plenty of shells out there f.e. node-webkit that runs on windows, osx and linux, you can also easly plugin NaCl modules or NPAPI stuff in there to use your native code.

Jan F. Scheurer - CEO @ Xe-Development

Sign Up for Xe-Engine™Beta

This topic is closed to new replies.

Advertisement