Gamma is a self-hosting C preprocessor enabling simple, ergonomic templated data structures.

It’s primarily an experiment in designing a template engine for C in a minimal way (e.g., without having to parse C).

Gamma is a strict superset of C.

You merely set CC="gc gcc" to enable support for templates. Here’s a quickstart:

$ git clone https://lair.masot.net/git/gamma.git
$ cd gamma
$ make
$ cat examples/sorting.c
#include <string.h>
...
$ ./gc gcc examples/sorting.c -o sorting
$ ./sorting
1, 10, 50, 75
apple, hello, world

Gamma can be bootstrapped by normal C compilers, and is small enough to vendor into your own project, so it’s remains easy for others to use your code.

Gamma supports creating object files and static archives, and allows linking against normal C…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help