Live data from Hacker News

Show HN: Sum (algebraic) types for C in one 100 line header

github.com

1–10 of 46 posts

Re: Show HN: Sum (algebraic) types for C in one 100 line header

#7
post #5

Question: is C gaining in popularity? If so, why exactly? Are their good reasons to be using C in product development rather than more modern languages?

I don’t know anything about trends but I still write some C because it’s widely supported across a variety of platforms.

Re: Show HN: Sum (algebraic) types for C in one 100 line header

#8
post #5

Question: is C gaining in popularity? If so, why exactly? Are their good reasons to be using C in product development rather than more modern languages?

I’ve started using zig for some stuff recently and it can include c effortlessly. Also with rust it is pretty easy to interact with c (well, you need unsafe and I guess for this particular case, bindgen would not be able to provide bindings).

I would not reach to c libraries on many other platforms but recently I started using more c, just not from c..

Re: Show HN: Sum (algebraic) types for C in one 100 line header

#9
post #6

Carcinization.

Variant records have existed long before (Algol 68 had them!) that that one crab-related language was a thing.

And sum types from ML circa 1972 (over fifty years ago). Indeed rust is basically an ML with affine types.

Re: Show HN: Sum (algebraic) types for C in one 100 line header

#10
post #5

Question: is C gaining in popularity? If so, why exactly? Are their good reasons to be using C in product development rather than more modern languages?

It looks like some cool new kids are rediscovering it, after more than a decade of pythonisation and javascriptisation of programming. You can have things that behave like values and actually reside on the stack, you can ask the operating system for more memory and you have static fixed-size memory which is allocated when the program is run. Good old procedures without the distractions of prototypal inheritance, variable hoisting, dynamic typing, coroutines, list comprehensions and lambda callbacks.

It's probably a more relevant tool for a larger class of problems than many people imagine.

Post reply on HN