Live data from Hacker News

Why I Write Games in C

jonathanwhiting.com

11–20 of 303 posts

Re: Why I Write Games in C

#15
post #11

I thought Lua was great for games development, the author does not mention it. http://www.lua.org

Lua is widely used as a scripting layer on top of a game engine. The intense calculations needed to generate a high-fidelity simulation like graphics and physics are usually implemented in the engine in C++, and then the game logic/item behavior/etc. is defined in Lua. I haven't heard of anyone using pure Lua for a whole game, including the engine. It'd be really interesting to see what it looked like if someone did so.

Re: Why I Write Games in C

#16
post #8

TL;DR Many people is making money doing Unity games, so I ignore it exists - for $1500 - and I go the hipster way and create my own hundreds of memory corruption bugs myself.

If you're going to write a TL;DR for others, you should at least read the article yourself, don't you think?

Re: Why I Write Games in C

#17

What about Rust?

I like Rust, but sometimes it is pretty difficult to convince the compiler that one's code is safe. And this does not mean that the compiler is preventing unsafety; there are many safe programs that the compiler rejects.

Also, the OP said that compile time was a priority, and compiling Rust code is closer to C++ speed than C.

Re: Why I Write Games in C

#19
The thing I miss most in C when I don't cheat and use a couple C++ features is templates. Specifically, a dynamically sized List implementation that is type-generic.

If you do this in pure C, you have to pick your poison:

1. preprocessor abuse

2. void *

3. multiple redundant implementations of the data structure

Dynamically sized lists are used so often, that this tends to be a problem in almost every C project. I wonder what the author's solution is to this dilemma.

Post reply on HN