Live data from Hacker News

Ask HN: If C++ is so bad, what should game developers use?

news.ycombinator.com

101–110 of 127 posts

Re: Ask HN: If C++ is so bad, what should game developers use?

#101
post #26

You're right, C++ pretty much has no serious alternatives for games. And not just games, anything that involves computer graphics, physical simulation, computer vision or image processing. Python is excellent if some good soul has already written a library that does exactly what you need (in C or C++, obviously). The combination of numpy+PyOpenGL+PyCUDA is great for certain kinds of research projects (I have written…

yay! Python + PyOpenCL + ... is on my shortlist for the next project.

D is a dream to program in. The templates, especially, are so much nicer than C++ that I hate coding in C++ for a few days after doing D. OTOH, it's the same thing wrt runtime. Why spend a few days getting other people's crappy wrapper code working, FOR EACH LIBRARY, when you already know how to use, debug, and optimize those libraries for C/C++. It wastes a lot of time!

Re: Ask HN: If C++ is so bad, what should game developers use?

#102
post #91

Earlier quoted context omitted.

Err, by "runtime type inference", you actually mean runtime type checking , right? The pipe dream you are talking about has a tiny hope of coming true here: http://www.bitc-lang.org/ EDIT: replying to thras, below. According to the very Wikipedia article you cited, there is no such thing as "runtime type inference". What you described as such is a way of implementing dynamic type checking: checking at runtime that th…

According to the very Wikipedia article you cited, there is no such thing as "runtime type inference" I can't seem to find that statement anywhere in the article. And it hasn't been edited since September. Also, why not google for "runtime type inference": http://www.google.com/search?hl=en&client=firefox-a&...

There is such a thing, but it has a different meaning than how I believe you used it.

You said "scripting languages have run-time type inference built in everywhere". I don't think that's true for most scripting languages. Inference refers to determining facts which were not explicitly provided, and usually implies a statically typed programming language where inference is done at compilation time. "Runtime type inference" might be used for, e.g., Python's Psyco project, where the just-in-time compiler infers properties about a particular variable (such that it's always an integer) and can therefore compile out boxing, unboxing, runtime type checks and so on.

Speaking of runtime type-checking, I inferred that that's what you meant when you said "runtime type inference". Type-checking IS something that happens at runtime almost everywhere in dynamic languages. It is also more closely associated with RTTI -- a dynamic_cast in C++ would not be termed type inference (the previous and new types are known), but a type check does occur at runtime.

Re: Ask HN: If C++ is so bad, what should game developers use?

#103
post #53

Earlier quoted context omitted.

Err, by "runtime type inference", you actually mean runtime type checking , right? The pipe dream you are talking about has a tiny hope of coming true here: http://www.bitc-lang.org/ EDIT: replying to thras, below. According to the very Wikipedia article you cited, there is no such thing as "runtime type inference". What you described as such is a way of implementing dynamic type checking: checking at runtime that th…

Hmm. Check this out: http://en.wikipedia.org/wiki/Type_inference Type checking is a little different, and refers to some safety measures done at compile time that theoretically guard against certain types of errors. Scripting languages don't do them, and don't miss out on much programming correctness as far as I can tell. Full run time type inference in C++ is about having a container of something -- let's say void p…

I replied to you above, but I'll reply to your specific example here. Your example is really not how PL people talk about type inference. However, you're right that you wouldn't call this example type-checking either... it would probably be a fuzzier term such as "reflection" or "introspection". But certainly not type inference. Do you understand what the wikipedia article you linked is about? Because it's NOT about introspecting the type of a contained object within a container. It's about statically making proofs of the type of a variable based on its usage.

Re: Ask HN: If C++ is so bad, what should game developers use?

#104
post #88

Earlier quoted context omitted.

Precisely ! That's kind of the point, isn't it? I use the languages that I am most familiar with, because I am far more effective with them than I am with whatever this year's new awesome language is. If I had been doing Ruby from the beginning, then I should continue doing Ruby, and not use C++ just because someone else says so. Likewise, if I've been doing C++ for as long, it doesn't make sense for me to switch to…

Unwillingness or inability to shift between development tools where appropriate is also something I've noticed characterises less experienced programmers (often evangelism can be driven by this). Using your example languages. I can think of situations where using C++ rather than Ruby would be idiotic, and likewise situations where the reverse is true.

Unwillingness due to what, though?

Because, from what I've seen, a lot of people can be very excellent programmers in one language, but be unable to learn to program in another.

Actually, I don't think it's really "less experienced programmers". Several of my computer science peers (I'm 23) -- inexperienced as professionals, but very smart -- will try the same problem in four or five languages, just to learn the language, and have no fears about jumping into a new language to start a new project. On the other hand, I know some excellent older programmers (late 40s) who know C++ super well, are willing to apply jaw-droppingly complex template metaprogramming, but who only reluctantly use Python and won't touch Ruby or Scala. It's probably more of a cultural thing.

Re: Ask HN: If C++ is so bad, what should game developers use?

#105
post #11

Earlier quoted context omitted.

I edited the original post. I'm interested in commercial game projects. Real games, the kinds that you see in shops for PS and XBox etc.

If you are interested in making games for consoles you are pretty much restricted to what the console maker's software development kit supports, which is usually C/C++. It's usually impractical to reverse engineer the hardware and supply your own system libraries in another language. Computer games are another story, but the same facts are generally true, that you should use the language which provides the libraries…

"If you are interested in making games for consoles you are pretty much restricted to what the console maker's software development kit supports, which is usually C/C++. "

Unless you want to write a lisp using that c/c++ sdk and then develop with the lisp you wrote. (http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp). So it certainly can be done. Whether you should is another matter.

Post acquisition (by Sony) Naughty Dog seems to have shifted to c++ but seems to have shifted back partially to lisp (C++/ scheme combo as far as I can make out) for their "Uncharted" games for the PS3.(http://www.naughtydog.com/docs/Naughty-Dog-GDC08-Adventures-... Warning PDF)

Re: Ask HN: If C++ is so bad, what should game developers use?

#106
post #85

Earlier quoted context omitted.

Much of World of Warcraft's user interface is written in Lua, and I'm not sure I'd classify WoW as an obscure example.

But the game engine is not. It doesn't use LUA to push polygons.

That is correct, but the game does use it for a lot more than just scripting.

ps: Lua, not LUA -- it's the Portuguese word for moon, not an acronym :)

Re: Ask HN: If C++ is so bad, what should game developers use?

#107

Earlier quoted context omitted.

Over-engineering? You're confusing me with one of those guys that has to do a UML diagram before he can start coding.

I was mostly referring to the language. The standard library that comes with Java is over-engineered to the point of absurdity

Not _quite_ to the point of absurdity. I kinda like it. Admittedly, I dislike it when I have to instantiate four classes to read the contents of a file. But I have also used the same flexibility to great advantage, and been burned in other languages when the standard library wasn't flexible enough.

Re: Ask HN: If C++ is so bad, what should game developers use?

#108
post #4

XNA is great, but your games will only be compatible with windows(and xBox). Haskell is definetely not a good idea.

Why is Haskell a bad idea?

haskell, libSDL, and OS X are a match made in hell. I recently tried this, and all sorts of dylib problems on my system lead me to believe its just not practical.

Are there other 3D/multimedia frameworks that play better w/Haskell? Or is it just raw OpenGL?

Re: Ask HN: If C++ is so bad, what should game developers use?

#109
post #53

Earlier quoted context omitted.

Err, by "runtime type inference", you actually mean runtime type checking , right? The pipe dream you are talking about has a tiny hope of coming true here: http://www.bitc-lang.org/ EDIT: replying to thras, below. According to the very Wikipedia article you cited, there is no such thing as "runtime type inference". What you described as such is a way of implementing dynamic type checking: checking at runtime that th…

Hmm. Check this out: http://en.wikipedia.org/wiki/Type_inference Type checking is a little different, and refers to some safety measures done at compile time that theoretically guard against certain types of errors. Scripting languages don't do them, and don't miss out on much programming correctness as far as I can tell. Full run time type inference in C++ is about having a container of something -- let's say void p…

The I in RTTI stands for "identification", not "inference". Stop saying "runtime type inference".
Post reply on HN