Monday, October 19, 2026 Today’s Paper
Log in Join free
Vol. I · No. 20 Texas Edition
Monday, Oct 19
Texas first. Then the world.
Always free Updated just now
Read. React. Discuss.
Tech

Show HN: Cwist; a hobby-grade C17 web framework that keeps your app simple

By gg582 2 min read 6 views 0 comments

First of all, I'm not claiming that my framework will save industrial C/C++ development. It's just a hobby project.Industrial code needs safer code, not easier code. But when you're developing a blog at 8 PM, long template errors are annoying.You need CRUD and RDBMS. It's simple.CWIST is for that kind of work.It sacrifices memory safety, smart pointers, and modern C++ abstractions. In return, compile errors are more predictable. #include
#include
#include
#include

static cwist_db_pool_t *g_db_pool;

static void send_error(cwist_http_response *res, const char *msg) {
res->status_code = CWIST_HTTP_INTERNAL_ERROR;
cwist_http_header_add(&res->headers, "Content-Type", "text/plain");
cwist_sstring_assign(res->body, msg);
}

static void render(cwist_http_response *res, const char *path, cJSON *ctx) {
cwist_sstring *html = cwist_template_render_file(path, ctx);
if (html) {
cwist_http_header_add(&res->headers, "Content-Type", "text/html");
cwist_sstring_assign(res->body, html->data);
cwist_sstring_destroy(html);
}
cJSON_Delete(ctx);
}

Hacker News (Newest) Original story · github.com
Read the full story

Discussion (0)

No comments yet. Start the conversation!