News for hackers. Stuff that matters.
Re:Duetto: a C++ compiler for the Web going beyond Emscripte... by flohofwoe on Thursday October 31, 2013 @12:26PM (#6647747)
Have you ever had to maintain a code base with more then a few hundred thousand lines of code across Flash, Javascript, iOS, Android, PC, OSX, Xbox, PS, Wii, Vita, NintendoDS, ...and whatever other gaming platform is popular at the moment? The "popular platform of the day" changes a lot faster then being able to write new code for it. You need to support that new platform within 3 months or less. Good luck rewriting your entire code base into another language in that time ;)
Re:Duetto: a C++ compiler for the Web going beyond Emscripte... by tomkludy on Thursday October 31, 2013 @12:48PM (#6647897)
Frankly, I've had to maintain a huge C++-only codebase, and that's why I hope to never write another app in C++.

Yours is an argument for a high-level, typesafe, compiled-to-native and compiled-to-javascript language. But IMO the argument falls down when applied to C++, because it is not high-level, it is only marginally typesafe, and it doesn't compile to javascript well at all (tradeoff of either massive performance, or missing basic functionality like 64 bit ints).

It is very possible that no language will fit this role exactly for some time to come. But, to me at least, it is very clear that C++ is NOT the language for the job.

Re:Duetto: a C++ compiler for the Web going beyond Emscripte... by flohofwoe on Thursday October 31, 2013 @01:11PM (#6648053)
Yes I see your point to a degree, in a way we're working in a sort of "highlevel C++" most of the time at some performance cost: We have strict coding conventions in place which forbid low-level C/C++ stuff in high-level code (no raw pointers, no C-style arrays, no pointer arithmetics, no C library functions, etc...). Plus static code analysis and tons of runtime asserts. I can't remember the last time we had a buffer overflow or pointer-gone-wild. The performance hit of C++ compiled to JS is surprisingly small (1.5x native performance in Firefox, a bit slower in Chrome, but the gap is getting smaller, this is in the same ballpark as strongly typed bytecode languages like C# or Java).
Re:Duetto: a C++ compiler for the Web going beyond Emscripte... by angersock on Thursday October 31, 2013 @12:39PM (#6647842)
http://fabiensanglard.net/anotherWorld_code_review/index.php

This was well-solved a long time ago so...uh...yeah I guess? With much worse hardware?

Maybe Lua?

Do you actually have a real example, or were you just listing off all the magical platforms?

EDIT:

Ha, you do some pretty cool work.

Anyways, put more mildly, is there a case you've seen where you actually have to support all the platforms you've mentioned?

(I seem to be making all sorts of friends today. :| )

Re:Duetto: a C++ compiler for the Web going beyond Emscripte... by flohofwoe on Thursday October 31, 2013 @12:53PM (#6647936)
;) We've been an independent dev studio (Radon Labs) before being bought by Bigpoint, and the only way to survive was to support a wide range of platforms (we weren't big or successful enough to have the luxury to pick our target platforms). So our engine basically scaled from the NintendoDS to PCs. Being able today to just cross-compile our engine to JS+WebGL or mobile platforms(between 150k and 500k of C++ code, depending what modules you link) is very nice. Plus, for browser games, Flash and plugins as a whole are on the way out, so we need a solution to bring our games into the browser without plugins. A solution like emscripten or duetto to compile C++ (or maybe later other languages) to JS with a relatively small (and predictable!) performance hit is definitely "good enough" for us.