Better HN
topnewbestaskshowjobs
Log inSign up

gg582

20 karma · joined Oct 17, 2025 (1y ago) · 44 submissions

Dynamic, Simple, High-Level Development.
Submissions

comment 1d ago · link · parent

We can 'see' the shape of software. Some uses UML, some uses flow chart, many methods are available. But now I share my personal method to understand its principle.

comment 3w ago · link · parent

It's like reviving Xiangshu school in 21st century..

comment 3w ago · link · parent

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.

4.

Show HN: Cwist — Tiny, Easy, and Structured Web Framework for C(github.com ↗)

2 points · by gg582 · 3w ago · 1 comment

comment 3w ago · link · parent

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 yall.

comment 1mo ago · link · parent

This was somehow flagged as a spam post.

I hope you enjoyed this.

comment 1mo ago · link · parent

Nice, what's your example website? I'd like to check if it really seems better

comment 1mo ago · link · parent

Features

CWIST GC for fast prototyping. It's closer to a garbage sweeper than a traditional GC, and lighter.

Dev blog engine

HTML Template Engine

WASM

..well

comment 1mo ago · link · parent

Hacker News doesn't support bullet style with -

..I didn't expect this. I guess it's not md4c based one

10.

Show HN: Cwist; a hobby-grade C17 web framework that keeps your app simple(github.com ↗)

2 points · by gg582 · 1mo ago · 2 comments

comment 2mo ago · link · parent

It is a long way but I shall continue..

comment 2mo ago · link · parent

I guess there are cultural biases here, I hope to study together with somebody who knows Latin or Greek :)

comment 2mo ago · link · parent

Yep that's right. Using #if/#endif excludes whole lines(so compiler won't see any lines). And this difference can prevent when struggling with nested comments :)

comment 2mo ago · link · parent

Honestly I don't pretty sure if this post will impress somebody or not. But after a long period of vibe-coding I think I'm trying to do these methods..

comment 2mo ago · link · parent

some logics were reorganized. 感->減(sensing->reduction)

comment 2mo ago · link · parent

Some conventions are socially made... In C, some uses

#if 0

    these_lines_are();
    not_executed();
#endif

but most of the cases people just use

/* comments

* these_lines_are();

* not_executed();

*

* end comment */

Then, why?

#if 0

#endif

looks clear and it definitely says how a computer skips many lines.

But we just don't use it because it implies low-level knowledge "that every C developers have"

comment 2mo ago · link · parent

yep. There was a maintenance. :)

comment 2mo ago · link · parent

That's cool. Using a same logic, we can say 'Undefined behaviors are not behaviors.'
12