Open erlend-sh opened 6 months ago
$> scc (fd -t f -e h -e c)
───────────────────────────────────────────────────────────────────────────────
Language Files Lines Blanks Comments Code Complexity
───────────────────────────────────────────────────────────────────────────────
C 297 106736 9116 10148 87472 15459
C Header 219 52709 4699 13038 34972 4346
───────────────────────────────────────────────────────────────────────────────
Total 516 159445 13815 23186 122444 19805
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $4,206,585
Estimated Schedule Effort (organic) 23.74 months
Estimated People Required (organic) 15.74
───────────────────────────────────────────────────────────────────────────────
Processed 4902161 bytes, 4.902 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────
According to scc
, the code base is 122k lines long. It's going to be a fun experience for those who want to dive in. But bear in mind that it won't be trivial, because while C can easily be translated by hand into Zig, Zig offers new features that you need to be aware of to simplify the software architecture.
I support this approach, because I'm doing it myself on a relatively small C project and it's an excellent learning exercise. I also think that translating your C code to Zig will allow you to discover new bugs and help you fix them! I wish you the best of luck!
Cheers :) Do note this particular comment from Congus above:
Personally I wouldn't rewrite existing C parts into zig unless there are significant benefits, like memory safety, much simpler code.
The game is already feature-complete. This issue is mainly about making it capable of being extended with Zig contributions by getting the build pipeline in order.
I had a conversation with @cxong about this and he’s receptive to the idea.
Problem: it’s pretty hard to attract new C contributors to a project like this because the language, timeless as it may be, consists of an “aging population”.
Solution: Zig on the other hand is rising in popularity among both young and old with its many novelties and rapid development. There’s a potential win-win here with cdogs providing Zig coders with a richly featured game project to hack on, while the Zig community can bring renewed interest to the cdogs codebase.
There’s precedent for this in the likes of raylib: https://github.com/raysan5/raylib/pull/2014 – but as Cong pointed out: