this post was submitted on 17 Oct 2024
921 points (98.9% liked)

RetroGaming

19338 readers
1302 users here now

Vintage gaming community.

Rules:

  1. Be kind.
  2. No spam or soliciting for money.
  3. No racism or other bigotry allowed.
  4. Obviously nothing illegal.

If you see these please report them.

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Wilzax@lemmy.world 111 points 15 hours ago (3 children)

Your game will actually likely be more efficient if written in C. The gcc compiler has become ridiculously optimized and probably knows more tricks than you do.

[–] Valmond@lemmy.world 18 points 12 hours ago (1 children)

Yep but not if you write sloppy C code. Gotta keep those nuts and bolts tight!

[–] Wilzax@lemmy.world 21 points 8 hours ago (1 children)

If you're writing sloppy C code your assembly code probably won't work either

[–] 0x0@lemmy.dbzer0.com 9 points 4 hours ago

Except everyone writing C is writing sloppy C. It's like driving a car, there's always a non-zero chance of an accident.

Even worse, in C the compiler is just waiting for you to trip up so it can do something weird. Think the risk of UB is overblown? I found this article from Raymond Chen enlightening: https://devblogs.microsoft.com/oldnewthing/20140627-00/?p=633

[–] dejected_warp_core@lemmy.world 32 points 13 hours ago

Especially these days. Current-gen x86 architecture has all kinds of insane optimizations and special instruction sets that the Pentium I never had (e.g. SSE). You really do need a higher-level compiler at your back to make the most of it these days. And even then, there are cases where you have to resort to inline ASM or processor-specific intrinsics to optimize to the level that Roller Coaster Tycoon is/was. (original system specs)

[–] s_s@lemm.ee -3 points 12 hours ago

Write it in Rust, and it'll never even leak memory.