frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Type-C – variants, options, generics and pattern matching for C

https://github.com/stass/type-c
7•stass•1d ago
I love C, but often using it for parsing, tree walking or complex error handling leads to spaghetti code.

Of course there is Swift, Ocaml or Rust for situations like that, but then you are either forced to convert the entire codebase, or add a runtime library or go through the pain of bridging C to the new language. Sometimes there are no compilers for the target architecture too when you are working on embedded stuff.

This is where Type-C comes in. It works as a preprocessor like TypeScript and calls the original C driver behind the scenes. Your code stays normal C for the most part, so you can predict how the code will be laid out. TypeC is a full superset of C11, so any C11 code compiles as is.

Want to use TypeC just for one file? Rename to .tc and use the features you want, the rest of the codebase stays the same. This works for kernel or baremetal code too as there is no runtime or extra libararies.

There are examples of TypeC code as well as real-world tests of converting existing code to TypeC on the GitHub page.

This is how the code looks like for an expression evaluator: type expr = | Num(int value) | Add(const expr l, const expr r) | Mul(const expr l, const expr r) | Div(const expr l, const expr r);

  static result(int, eval_error)
  eval(const expr *e)
  {
      int d;

      match (*e) {
      case Num(value):
          return (Ok(value));
      case Add(l, r):
          return (fit((long long)try eval(l) + try eval(r)));
      case Mul(l, r):
          return (fit((long long)try eval(l) * try eval(r)));
      case Div(l, r):
          d = try eval(r);
          if (d == 0)
              return (Err(DivByZero));
          return (fit((long long)try eval(l) / d));
      }
  }

  % typec -std=c11 -Wall -Wextra eval.tc
  $ ./a.out
  14
  division by zero
Would love to hear your thoughts and feedback!

Nvidia Reinstates Jensen Huang as CEO

https://www.cnbc.com/2026/11/23/nvidia-jensen-huang-ceo.html
1828•jaz•8h ago•2914 comments

VP ≠ VNP over Every Field

https://github.com/anthropics/formal-math/tree/main/vp-vnp
73•mikeryan52•46m ago•36 comments

Ladybird is now in alpha

https://ladybird.org/posts/alpha/
1193•janvdberg•6h ago•295 comments

Per Arm's request, this site will be discontinued on 4 December 2026 :(

https://arm.jonpalmisc.com/
698•tech234a•3h ago•146 comments

The horse made the state

https://aeon.co/essays/the-origins-of-the-state-are-not-agrarian-but-pastoralist
42•ersinesen•1h ago•38 comments

Bored.com: Fun, interesting and cool websites to explore when bored

https://www.bored.com/
43•susam•1h ago•12 comments

GLM-5.4: Toward generalized coding with our first loop transformer

https://z.ai/blog/glm-5.4
1005•foohis•12h ago•328 comments

GPUI is getting its own repository

https://github.com/zed-industries/gpui
34•EvilGoose•2h ago•5 comments

Dario is hyping the dangers so OSS models are illegal and he stays in control

https://twitter.com/ylecun/status/2124550037912920090
865•MrBuddyCasino•5h ago•502 comments

Levent Alpöge comments on his Riemann Hypothesis proof

https://twitter.com/__alpoge__/status/2124987173439209561
6•Dylan1312•32m ago•0 comments

Stalwart is now a drop-in replacement for Microsoft Exchange

https://stalw.art/blog/microsoft-exchange-replacement/
6•shaunpud•22m ago•0 comments

NariQ: BF16-level Qwen3.8-27B in a 10 GB file

https://huggingface.co/nari-labs/Qwen3.8-27B-NariQ-GGUF
100•toebee•9h ago•15 comments

Derivative Flipping

http://blog.sigfpe.com/2026/11/derivative-flipping.html
54•dmit•1d ago•3 comments

Spacecraft reaches Mercury on second-ever mission to enter its orbit

https://www.theguardian.com/science/2026/nov/20/spacecraft-mercury-second-ever-mission-orbit-bepi...
264•geden•2d ago•84 comments

Kagi Mail (public beta)

https://blog.kagi.com/kagi-mail-public-beta
300•rdmuser•5h ago•226 comments

The Beauty of Artists' Studios

https://spectator.com/article/the-beauty-of-artists-studios/
3•promulgator•6m ago•0 comments

Nospeaker ─ Make your MacBook's trackpad talk using its haptic motor

https://github.com/os6/nospeaker
255•yakkomajuri•11h ago•152 comments

EasyPost (YC S13) Is Hiring

https://www.easypost.com/careers/
1•jstreebin•5h ago

Apple removed my open-source app from EU App Stores after 9 years

https://github.com/glushchenko/fsnotes/discussions/2056
427•fluder•4h ago•87 comments

Win4wine – Run Windows Shell as the Linux Desktop on Wine

https://github.com/mikuta0407/win4wine
200•hard_times•10h ago•104 comments

What does it mean to understand what we built?

https://brooker.co.za/blog/2026/11/16/understanding.html
8•luu•1d ago•1 comments

Free alternative TV network built from the Internet Archive's forgotten videos

https://spelunkr.tv
909•SockThief•21h ago•159 comments

Show HN: Hermit CRM – Free open-source CRM for solopreneurs

https://hermitcrm.io/
21•gijsbos•12h ago•2 comments

How should an LLM see a computer?

https://www.greptile.com/blog/trex-computer-use
35•dakshgupta•5h ago•20 comments

XNU Linux: Full OS X GUI Userspace on Linux

https://github.com/AFK-surf/xnulinux
589•mmastrac•19h ago•242 comments

Show HN: Type-C – variants, options, generics and pattern matching for C

https://github.com/stass/type-c
7•stass•1d ago•0 comments

Crafting Targeted MP4 Fuzzers

https://atredis.com/blog/2026/11/16/crafting-targeted-mp4-fuzzers/
20•frostbyte7•3d ago•1 comments

Show HN: Drive around my village in 3D

https://cherwellvalleymotorclub.app
97•johnwards•3d ago•68 comments

The next circle of security hell

https://blogs.gentoo.org/mgorny/2026/10/27/the-next-circle-of-security-hell/
226•qtqtqt•11h ago•135 comments

Building a wireless network adapter for the Super Nintendo

https://boland.dev/snet/
75•dannyboland•8h ago•17 comments