-
Notifications
You must be signed in to change notification settings - Fork 1
Description
C Codgen does not yet exist, but should be capable of parity with existing languages.
Notably, C does not have a way to build an API for a data model in the way that OO languages do. C operates directly upon data, whereas other languages operate upon a data's API.
Patterns similar to golang's codegen should be used for C, where functions are made to operate upon data structures, but the structures themselves are open to editing.
Pointers should be used for any string data (as char*
), as well as any other structures used in a nested fashion. This enables the usual pattern of null checks, constructors, etc.
Constructor functions should be named "newXYZ", and follow the same logical patterns as other languages.
Null guards should use NULL (which is define-guarded).
Files should be define-guarded in the Google style.