TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

I wrote a commercial game in C in 2025

50 pointsby steeleduncan4 months ago

6 comments

fullstop4 months ago
I&#x27;ve been shifting a little more into C++ after decades of C. It takes longer to compile, but I find that a lot of the tedious stuff that I&#x27;m doing with C (function pointer structures, etc) is handled automatically in C++, and I kind of like the RAII pattern.<p>Also, I enjoy embedding Lua in projects for extensibility, so this guy is really pulling my heart strings. :-)
评论 #42769171 未加载
lelanthran4 months ago
&gt; Serialisation Compared to serialisation in almost any modern language, serialising state in C (or C++) is excruciating. There are no reflection capabilities in C, and minimal capabilities in C++, so you need to manually specify each and every field when serialising or deserialising the game state<p>I got tired of that years agao, and have used this approach with success in a few projects: <a href="https:&#x2F;&#x2F;www.lelanthran.com&#x2F;chap2&#x2F;content.html" rel="nofollow">https:&#x2F;&#x2F;www.lelanthran.com&#x2F;chap2&#x2F;content.html</a>
评论 #42812777 未加载
评论 #42770102 未加载
bb884 months ago
My biggest issues are crashes in programs by someone who writes C&#x2F;C++ and doesn&#x27;t take it through valgrind (or even bothering to lint it).<p>I feel like Google&#x27;s Carbon could be good, but it&#x27;s still not ready for general use. I&#x27;m surprised they even bothered with Carbon since they had built golang for their server software development.
AstralStorm4 months ago
Rust is slowly getting there, and there could be a good chance of using LLVM to touch the platforms with only C runtimes indirectly. As in, transforming directly to the LLVM-IR byte code which can be compiled to C or more readily C++.
评论 #42770134 未加载
seba_dos14 months ago
C99 is a pretty good choice for small gamedev projects like this. There are better languages out there (C++ is not one of them), but tooling and platform support is still unrivaled.
sebstefan4 months ago
&gt;Successes<p>&gt;Fast Compilation Iron Roads builds quickly, so I can iterate fast, and in this way C has helped my workflow a lot<p>I wish they&#x27;d given a number. 1s?
评论 #42769179 未加载
评论 #42777959 未加载