News for hackers. Stuff that matters.
Re:The Hidden Cost of C++ by groby_b on Tuesday October 20, 2009 @02:39PM (#893002)
I propose a lower level than C++ for the kernel, and a higher level for the rest.

C++ is simply at the wrong abstraction level.

Oh, and I don't want to manually track resources myself, either. But guess what, somebody has to do. And on a game console, that's you. There's not much of an OS to speak of.

You did notice I was talking about game development, right? ;)

Re:The Hidden Cost of C++ by blub on Tuesday October 20, 2009 @03:21PM (#893106)
My reply was not targeted at you and I don't do game programming.

Anyway:

* smart pointers don't need an OS.

* for me, C++ is at the exactly right abstraction level to allow me to use only C++ instead of "C++ + other language" or "other language and C for speed". Most C + HLL proponents underestimate the logistics overhead of using multiple programming languages.

Re:The Hidden Cost of C++ by groby_b on Tuesday October 20, 2009 @04:03PM (#893215)
_Most C + HLL proponents underestimate the logistics overhead of using multiple programming languages._

I'll concede that as a valid concern, especially for smaller projects where everybody touches many areas of the code. As projects grow, a separation becomes easier.

Add to that the fact that most games need scripting support anyways, and you'll see that the logistics overhead is at least not much different.

Re:The Hidden Cost of C++ by kmavm on Wednesday October 21, 2009 @12:03AM (#894024)
As somebody who's given you a hard time up thread, and who has advocated the C + HLL approach, let me say: you're right, I now think that approach is naive. It's really difficult to share data across the C/HLL boundary, and in normal applications the data representation is the most likely place to need performance tweaking, and thus you often want to represent it in "LLL" data structures.

The mappings of C/C++'s type system into an HLL is almost intractable. What if there's a union somewhere? You could have distinct HLL and LLL representations, sync'ed either lazily or eagerly, but that's really, really complicated.

Unfortunately, you can only apply "C* + HLL" when there's a nice, clear, never-shifting boundary between the HLL and LLL parts. So, language selection is not a false dichotomy; you really do have to choose "mostly one."

(edit: typo, non-sense sentence. Sorry folks, running a fever.)

Re:The Hidden Cost of C++ by liamkf on Tuesday October 20, 2009 @05:06PM (#893352)
I've experienced the effects of trying to have the C++ "kernel" and a HLL for the "rest" on a project.

We allowed large parts AI/gameplay (not generally what I would think of as "kernel") to be pushed out of C++ into a HLL, and it was extremely painful bringing it back when the performance began to hurt us.

Re:The Hidden Cost of C++ by groby_b on Tuesday October 20, 2009 @08:50PM (#893698)
You can't by any chance share a bit more about the project, can you?

I'd certainly be interested to hear about this, because I'd love to know what the breaking points were.