←back to thread

111 points teleforce | 5 comments | | HN request time: 0.819s | source
Show context
shoozza ◴[] No.43799700[source]
Slightly off topic: Is D a good language for creating tiny windows or Linux executables? There is an upcoming game jam (4mb jam 2025) which gives extra points for game submissions <= 8KB. With c you can fit a window with graphics update in an executable of less than 900 bytes[0]. Granted it's using crinkler for linking which does some compression.

0: https://gist.github.com/ske2004/336d8cce8cd9db59d61ceb13c1ed...

replies(1): >>43800232 #
monkeyelite ◴[] No.43800232[source]
Yes. Just use the “better C” mode
replies(1): >>43802106 #
mariusor ◴[] No.43802106[source]
... which is not D any more though.
replies(2): >>43802314 #>>43802699 #
monkeyelite ◴[] No.43802699[source]
What essential features are missing for you?
replies(1): >>43802765 #
1. mariusor ◴[] No.43802765[source]
For game development? I imagine having to use only structs but not classes would be something that forces a "non idiomatic D" experience. Dynamic arrays sound like something that's very useful for a game. I don't know, there are plenty of features that are incompatible with better C that makes D, D. Generally speaking, garbage collection would be the biggest in my opinion.
replies(2): >>43804002 #>>43805612 #
2. monkeyelite ◴[] No.43804002[source]
Yeah this person is asking how to make the smallest executable. They don’t want garbage collection.
replies(1): >>43804260 #
3. mariusor ◴[] No.43804260[source]
Garbage collection was about what I would be missing. I mentioned before what could be missing from OP's point of view.
replies(1): >>43805125 #
4. monkeyelite ◴[] No.43805125{3}[source]
Ok. I think the better C mode is cool and I think it’s worth a try for his interest and project.
5. WalterBright ◴[] No.43805612[source]
You can still use classes in BetterC - you just have to allocate them yourself. D recently acquired "placement new" which makes that more convenient.