Skip to content

rob05c/go-m4-generics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-m4-generics

Proof-of-concept Go Generics using GNU M4

Go generics are often done with ast and ssa. While parsing the AST allows for more control over generation, few would argue it's easy.

GNU M4 is a macro processor. It was made for this kind of thing.

The string escapes in the macro code are a little hard to read, and play havoc with Go syntax highlighters, but only for the .m4 code files, which will hopefully be only small libraries. Code using the generics is normal Go syntax, as are generated files.

But don't take my word for it—see for yourself. This proof-of-concept is very small.

Inspired by http://blog.00null.net/post/144763147991/using-gnu-m4-as-a-css-pre-processor

About

Proof-of-concept Go Generics using GNU M4

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published