Lurker News

Comments (218) 56 threads

Earlier comments
lubesGordi1 reply#
Well I don't know about others here, but I think its cool. If you can make the setup super readable and get the performance of C then why not? Especially now when you can get claude to write a bunch of the framework for you. Add in whatever you need whenever you need it and you automatically have a platform independent web framework that's no bigger than what you need and likely decently performant.
maybewhenthesun2 replies#
Maintainer nightmare checklist:

- Web framework : inherently hard to maintain due to communication over evolving standards. Check.
- AI written code where nobody knows howwhatwhenwhy!? Check.
- Written in C. Check.
bwahahahaha!
edit: semi-joking. As I actually like the simplicity of pure C. But the combination of AI written,network-facing and C makes me shudder.

ashtonjamesd3 replies#
Haha, I have used AI in some parts of it - mainly the JSON part because I could not wrap my head around it for the life of me. But I am proud that 90% is self written!
jvanderbot#
That is excellent. Well done.
le-mark#
In that case the json parse function might be a bit of a challenge. It should actually be pretty straight forward with the builder functionality you’ve got in there. Loop over the input and use a state machine (switch block with a state variable) keep track of what you’re doing. Oh and you’ll need to recurse or otherwise use a stack to keep the nesting levels correct. Ie objects that contain arrays or objects, arrays that contain arrays, etc.
isubkhankulov#
I can see this becoming a trend. People putting badges on their repo as to how artisanal, organic and “authentic” their code is.
jvanderbot#
I think the old HN ethos that I loved, on full display here, won't survive intact in the AI era. It'll have to change from "It is cool to try making in ". Such a project is now a prompt away, and there's light-years of distance between a carefully hand crafted version and something that is posted aspirationally by an AI.

Every agent I know of or use will always say they built "Production ready, secure, fast package for X" if you ask them to build that, but they rarely actually will. It takes enormous time and effort to actually do that, and any first iteration of "production ready" is definitely aspirational until it actually hits the real world and survives. I'm speaking from experience, fwiw.

levkk1 reply#
That's awesome. With macros, you can go far and most modern web frameworks use whatever complex tools their language allows (like metaprogramming in Rails).

Mad props for building this. It's hard and it's fun!
As to other comments in the thread about the "why": why not. For the love of the craft.

ashtonjamesd#
Thank you so much! I appreciate it :) And yes, totally agree.
mistivia2 replies#
It's very dangerous to write a http parser from scratch in C. This can be very vulnerable without rigorous testing. To get a useful web framework for production in C, I think it's a better idea to start from libmicrohttpd, libevent_http, or even fastcgi, which are battle-tested.
jacquesm#
I don't think anybody here is going to use this for production, but just in case you're tempted: don't.
wallmountedtv1 reply#
I hear this comment warnings, and can easily see this myself being true. But, how could one actually make a reasonably safe http server in C from scratch?

That would honestly sound like an amazing book, just walking through all the ways it's horrible chapter by chapter, and how to structure the code instead, slowly. Like an accelerated history to create such a matured http library.

throwaway2037#
I like your idea for the book. I hope that Robert Nystrom writes it.
fallingmeat1 reply#
wow that’s a lot of HATE for a really well organized project with some great ideas. Killer job Ashton, you just built some skills they can’t take away from you.
ashtonjamesd#
Thank you, that means a lot! :)

Load more comments