News for hackers. Stuff that matters.
Re:Ask HN: If C++ is so bad, what should game developers use? by s-phi-nl on Sunday October 18, 2009 @04:48PM (#888804)
I am under the impression that Lua is widely used for video games.
Re:Ask HN: If C++ is so bad, what should game developers use? by Meatshoes on Sunday October 18, 2009 @05:18PM (#888851)
Lua is often used as an embedded scripting language within level editors, for example to keep track of the progress made on a quest or to trigger an event when the character reaches a certain point. Lua isn't used to code the game engine itself (in the vast majority of cases, there may be some obscure examples of game engines written in Lua)
Re:Ask HN: If C++ is so bad, what should game developers use? by silentbicycle on Sunday October 18, 2009 @06:12PM (#888953)
Right - The stuff that needs high performance or low-level access (e.g. graphics code) is written in C or C++, but most of the "soft layer" is scripted in Lua.

See: http://www.c2.com/cgi/wiki?AlternateHardAndSoftLayers

Re:Ask HN: If C++ is so bad, what should game developers use? by kiba on Sunday October 18, 2009 @08:22PM (#889154)
You need some LÖVE!

http://libregamewiki.org/LOVE

"LÖVE is a cross-platform, 2D game engine. The latest version of the engine is 0.5.0 released on September 9th, 2008.[1] It uses the SDL library, OpenGL hardware acceleration and the Lua programming language to program games.[2] It is licensed under the Zlib license. "

Re:Ask HN: If C++ is so bad, what should game developers use? by whye on Sunday October 18, 2009 @07:23PM (#889054)
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.
Re:Ask HN: If C++ is so bad, what should game developers use? by xsmasher on Sunday October 18, 2009 @08:31PM (#889166)
But the game engine is not. It doesn't use LUA to push polygons.
Re:Ask HN: If C++ is so bad, what should game developers use? by whye on Sunday October 18, 2009 @11:10PM (#889385)
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? by Scriptor on Monday October 19, 2009 @01:59AM (#889582)
So we can conclude then that games have many different facets to them and they can be loosely coupled enough that you can implement them using different technologies. The interface could be done in Lua, since it doesn't require intense computations when compared to graphics and physics engines.
Re:Ask HN: If C++ is so bad, what should game developers use? by henrikschroder on Sunday October 18, 2009 @06:09PM (#888948)
Lua is pretty popular because it is a simple scripting language that you can either run in an interpreter, or compile to C. The interpreter is easily embeddable, and you can call C functions from it. All of this makes for pretty rapid development without sacrificing speed for the things that it is suitable for.
Re:Ask HN: If C++ is so bad, what should game developers use? by silentbicycle on Sunday October 18, 2009 @06:20PM (#888971)
Just a nitpick - Lua doesn't compile to C, but rather to Lua VM bytecodes that can be embedded as data in C code.

Lua strikes me as a much nicer interface to C libraries.