4 ms·
A bit unrelated, but does anyone know at what comment score one gets to downvote non-constructive comments, or is that what the flagging is for?
by okamiueru 13y ago
A bit unrelated, but does anyone know at what comment score one gets to downvote non-constructive comments, or is that what the flagging is for?
- angersock 13y agoDownvoting comes around 500 maybe? Not actually sure. Anyways, lest you think my observation is just a "non-constructive comment": The great thing about the browser is that it is free of a lot of garbage we have to deal with in C++. The antics required to make C++ work in the browser, while laudable, are absurd. If you need cross-platform code, write in Java and avoid native extensions. If you need cross-platform code that has to be fast (i.e., you actually need to have inline assembly), write in C or C++ and actually do your proper cross-platform work (proper abstraction of I/O, proper defines, proper selection of types, etc.). If you need to draw shit in the browser, use the wonderful ecosystem of tools that have evolved using the standard affordances of Javascript and CSS. Here are the bits I take issue with: "write web applications in C++, reusing existing code and making porting of whole applications and games to the browser plausible." Why? What type of code is worth reusing? What type of performance is this going to get me? Most C++ codebases are janky and sad--game engines being some of the worst offenders. " code both the frontend and the backend of a web application in the same language and codebase " Why the fuck would you ever want to use C++ as that language? It's terrible, so much so in fact that it lost out to PHP and Perl. Let that sink in for a second. People said, "I would really like a language that's easier to work in!" and then picked PHP and Perl. PHP and Perl. Moreover, go look at their docs: http://www.leaningtech.com/duetto/examples/ http://www.leaningtech.com/duetto/examples/ " Duetto does not attempt at emulating numerical types which are not supported by JavaScript float is supported with 64-bit precision, like double. long long is defined as a 32-bit integer. 64-bit integers are not supported at all in JavaScript and duetto does not attempt to emulate them." Well thank Christ we never will need numerical types not in Javascript--I mean, I've never used bit-twiddling in my engine code, or my decompression code, or my audio code. ~ Look, it's a really cool use of LLVM, but we don't need C++ in the browser.
- flohofwoe 13y agoHave 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 ;)
- angersock 13y agohttp://fabiensanglard.net/anotherWorld_code_review/index.php 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. :| )
- flohofwoe 13y ago;) 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.
- tomkludy 13y agoFrankly, 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.