Hacker News new | ask | show | jobs
by pjmlp 3111 days ago
Because C actually has better support than Go for generics.

They could be faked with macros since the early days, which was what Borland's BIDS framework in Borland C++ 2.0 for MS-DOS made use of, dropped when version 3.0 with initial template support was released (around 1992).

Additionally, C now has basic language support for generics in C11 with _Generic.

2 comments

Except adding tools for doing some kind of macros is much simpler in Go than C because the language is easier to parse. What stops you from using a preprocessor in Go? It is not really part of the compiler in C either.
Sure it is, ANSI C11 (ISO/IEC 9899:2011) chapter 6.1 and section 6.5.1.1.
Fair enough, my C knowledge is a little behind the curve.