frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Show HN: Stroq – a local audit of what your coding agent did and why

https://github.com/AGGIB/Stroq
2•agybay_07•27m ago•1 comments

Show HN: After a decade of reversing, I got co-op working in DOS Wing Commander

https://fireflyk64.github.io/wcmulti/
237•daniel_rh•21h ago•33 comments

Show HN: XSDHub – checks correctness of invoice format and local standards

https://xsdhub.com/e-invoice-validator
4•DroneLedger•2h ago•1 comments

Show HN: TubeHaus – an open-source YouTube client with no Google account

https://github.com/biolend83/tubehaus
4•invidiouslove12•2h ago•0 comments

Show HN: Aloud – native macOS TTS for selected text, PDFs and screenshots ($19)

https://aloudapp.app/
4•SnapState•2h ago•0 comments

Show HN: Firenook – Firebase emulators in Rust: 40× faster writes, 10× less RAM

https://firenook.dev/
2•sanjevirau•3h ago•0 comments

Show HN: Cwist — Tiny, Easy, and Structured Web Framework for C

https://github.com/c4punks/cwist
2•gg582•3h ago•1 comments

Show HN: Lmux – A Lightweight macOS Terminal for Claude Code and Codex

https://github.com/sooftware/lmux
5•sooftware14•3h ago•0 comments

Show HN: The DNA of DOOM – How code structure survives across 44 ports

https://squid-protocol.github.io/gitgalaxy/museum-of-code/doom-dna/
50•joe-esquibel•2d ago•29 comments

Show HN: I built a tool that prices a pre-built PC part by part

https://pcdealcheck.com/
113•adlep•1d ago•78 comments

Show HN: Gauge – Open-Source CLI to recursively improve your docs

https://github.com/gauge-sh/gauge-cli
38•0x63_Problems•19h ago•8 comments

Show HN: Hyperbutler – Docker on Windows 11 Without WSL or Docker Desktop

https://github.com/Higangssh/hyperbutler
4•swq115•4h ago•0 comments

Show HN: A 69-byte on-chain PNG that turns OLED pixels off (0 nits)

https://black-pixel-1x1.vercel.app/dossier.html
2•KINGOFTHESCREEN•4h ago•0 comments

Show HN: Get Better at Piano with Noodle

2•rahilb•4h ago•2 comments

Show HN: Nico – a two-agent type personal agent on your Mac

https://nico.app/
4•benjushi•5h ago•1 comments

Show HN: Uncracked City, detective game where you question LLM suspects that lie

https://uncracked.city
127•passkey1510•1d ago•69 comments

Show HN: ChessGrind – Turn missed chess positions into training that sticks

https://chessgrind.fyi/
2•ShubhamBhar07•5h ago•0 comments

Show HN: Spindle – a full-featured, type-safe web framework for OCaml 5

https://github.com/hyphatech/spindle
3•zaiev•5h ago•0 comments

Show HN: Distill anyone's writing style into a skill

https://github.com/xatuke/mimic
7•satuke•5h ago•0 comments

Show HN: Grasmere: Markdown for Writers and Researchers

https://grasmere.app/
7•trwhite•6h ago•1 comments

Show HN: FranklyMail, business email and workspace tools for $9/year

https://franklymail.com/
4•franklymail•6h ago•2 comments

Show HN: HackerTV – HN's most-recommended Youtube videos as 24/7 TV channels

https://hackertv.org
474•dsalzman•2d ago•81 comments

Show HN: Anything to colors – To every dream, its colors

https://colors.void.app/
5•Justineo•6h ago•3 comments

Show HN: HackerBooks – HackerTube, but for books mentioned on HN

https://hackerbooks.org
1856•roansh•4d ago•306 comments

Show HN: Subvocal – Talk to your computer without making noise

834•aarushyadav•2d ago•390 comments

Show HN: Kairos – Open-source risk and fraud decisioning platform

https://github.com/finic-ai/kairos
104•ayanb9440•1d ago•34 comments

Show HN: Unclickbait – Replace clickbait YouTube thumbnails

https://unclickbait.app/
14•namuorg•22h ago•9 comments

Show HN: I've updated my Linux System Call website and API

https://syscall.sh/
237•guitmz•3d ago•55 comments

Show HN: Hacker Times, a New York Times-inspired version of Hacker News

https://hackertimes.ca/
473•polpenn•2d ago•148 comments

Show HN: HackerFriction, HackerTube for what HN complains about

https://hackerfriction.org/
5•capex•8h ago•0 comments
Open in hackernews

Show HN: Cwist — Tiny, Easy, and Structured Web Framework for C

https://github.com/c4punks/cwist
2•gg582•3h ago

Comments

gg582•3h ago
I did this for fun, and it is definitely not a good portfolio to get a job as a C programmer.

I was a bit tired of reading some toys made with NextJS+Tailwind CSS+Ugly Glossy Theme+Redis docker image, so I just thought that I can write something else for my toy projects like my dev blog.

Anyway, now let's see "why it's simple?"

It's an example from CWIST's readme:

  #include <cwist/app.h>

  static void hello(cwist_http_request *req, cwist_http_response *res) {
      (void)req;
      cwist_sstring_assign(res->body, "Hello from CWIST!");
  }

  int main(void) {
      cwist_app *app = cwist_app_create();
      cwist_app_get(app, "/", hello);
      cwist_app_listen(app, 8080);
      cwist_app_destroy(app);
      return 0;
  }
Some would say it's not that simple. They may say this:

  #include <cwist.h>

  static void hello(cwist_http_app *app) {
      cwist_sstring_assign(app->res->body, "Hello from CWIST!");
  }

  static void setApp(cwist_http_app *app) {
      CWIST_APP_CREATE(app);
      app->get.append(app->get, "/", hello);
      app->ipv4.port = 8080;
  }

  int main(void) {
      CWIST_APP_LISTEN(app);
      CWIST_APP_DESTROY(app);
  }
Yeah, it looks reasonable at a glance. And this definitely has its own strength. But, some parts are set up by struct members. some are not. some are in ALL CAPS, and some are not. Also, header amalgamation can be easily done by some scripts.

Well, in my opinion unifying 'conventions' as many as I can would be a good solution for simplifying code.

When somebody vibe-codes an application without looking at their code (although it's a really bad habit but I've seen somebody who does it) hallucinations are more frequently happened from struct members. However public functions seems quite good to be probabilistically inferenced.

Also, the second one needs more "helper codes". Formally, yep, CWIST's main is kinda bloated, but each step specified in the main function is executed by an explicit wrapper function. It's just like making a lego building.

I know it's not like Drogon. There are really many "mature" C/C++ web frameworks like Drogon, and when you are doing things for production, you cannot use this framework since it's not measured and monitored by security professionals.

Each change should pass sanitizers, cppcheck, http soak test, https c100k test, wasm/wasi smoke test, http/2 test, and so on. Actually I thought that I should do something for http/3, but it's just borrowing many things from lsquic so I just didn't do it.

It's in this external benchmark:

https://web-frameworks-benchmark.netlify.app/

Although it's not "blazingly fast C web framework other than CGI", its performance is fair for developing some small websites. And I am pretty sure it will give you a new perspective to see your code as a "well-structured building".

C4Punks is an organization with many people but some members are quite busy to co-maintain this, so currently I am mainly checking its status. But it's quite hard to read all those modules and refactor, sometimes I couldn't sleep before releasing a new tag.

Any pull requests (including documentations) are welcomed:

https://github.com/c4punks/CWIST/issues

Thanks for reading.