Live data from Hacker News

Show HN: A little web server in C

github.com

11–20 of 121 posts

Re: Show HN: A little web server in C

#11
This may sound sort of “old man waves at cloud” of me but one thing I’ve found sad is the gross over-complication of later versions of standards such that the sort of project linked here may not be as practical for something like HTTP/3 for example. Similarly, the large, muddled tool chain that is “required” to make modern JavaScript applications makes it hard for newer learners to really understand what is going on because the minimal code version still needs its own transpiler, build system, linter, process managers, etc. Maybe we need all this complexity, but I suspect that some of the overzealous, solve-everything systems design we have come accustomed to is mainly serving to create a larger problem set instead of creating elegant abstractions that are agreed upon.

Re: Show HN: A little web server in C

#12
post #11

This may sound sort of “old man waves at cloud” of me but one thing I’ve found sad is the gross over-complication of later versions of standards such that the sort of project linked here may not be as practical for something like HTTP/3 for example. Similarly, the large, muddled tool chain that is “required” to make modern JavaScript applications makes it hard for newer learners to really understand what is going on…

I see what you’re saying and agree that HTTP3 is complicated but I would that since it’s a backwards compatible standard, the added complexities are completely optional. For most use cases the basic protocol is perfectly suitable and only as the scale evolves does it require the additional complexity.

Re: Show HN: A little web server in C

#13
post #11

This may sound sort of “old man waves at cloud” of me but one thing I’ve found sad is the gross over-complication of later versions of standards such that the sort of project linked here may not be as practical for something like HTTP/3 for example. Similarly, the large, muddled tool chain that is “required” to make modern JavaScript applications makes it hard for newer learners to really understand what is going on…

I see what you’re saying and agree that HTTP3 is complicated but I would that since it’s a backwards compatible standard, the added complexities are completely optional. For most use cases the basic protocol is perfectly suitable and only as the scale evolves does it require the additional complexity.

I understand what you’re saying, but if someone decides to post a link to their project that is an HTTP/3 server in under X lines of code but only implements HTTP/2 features, is it really an HTTP/3 web server?

Re: Show HN: A little web server in C

#14
post #10

Cool project, but this project demonstrates the reason I've stopped writing things in C. The standard library has garbage string functions and it seems every project has its own version of this file: https://github.com/robdelacruz/lkwebserver/blob/main/lkstrin... It's fun to write this (and read others' versions) the first 3 or 4 times, but it gets old quickly.

I have the same issue, but I blame the absence of good package management. If it had that, one of the thousands of these libraries would have won out and become quasi-standard.

Re: Show HN: A little web server in C

#15
post #14
post #10

Cool project, but this project demonstrates the reason I've stopped writing things in C. The standard library has garbage string functions and it seems every project has its own version of this file: https://github.com/robdelacruz/lkwebserver/blob/main/lkstrin... It's fun to write this (and read others' versions) the first 3 or 4 times, but it gets old quickly.

I have the same issue, but I blame the absence of good package management. If it had that, one of the thousands of these libraries would have won out and become quasi-standard.

I always thought the glib part of gtk was really nice for this, but adoption is spotty at best.

Re: Show HN: A little web server in C

#16
post #10

Cool project, but this project demonstrates the reason I've stopped writing things in C. The standard library has garbage string functions and it seems every project has its own version of this file: https://github.com/robdelacruz/lkwebserver/blob/main/lkstrin... It's fun to write this (and read others' versions) the first 3 or 4 times, but it gets old quickly.

This is how I felt writing Go. Writing the same nongeneric functions with slightly different type signatures and/or endless interfaces and/or interface{} signatures. It's 2023.

Re: Show HN: A little web server in C

#17
post #10

Cool project, but this project demonstrates the reason I've stopped writing things in C. The standard library has garbage string functions and it seems every project has its own version of this file: https://github.com/robdelacruz/lkwebserver/blob/main/lkstrin... It's fun to write this (and read others' versions) the first 3 or 4 times, but it gets old quickly.

I know it's not your code, but related to this comment, it looks like it missing a check for lks == null?

https://github.com/robdelacruz/lkwebserver/blob/main/lkstrin...

Re: Show HN: A little web server in C

#18
post #7

Earlier quoted context omitted.

I dunno. I haven't written a multiplexing I/O server. I haven't written a CGI forking process. I haven't written a reverse proxy handler. Heck, I haven't written C in years. All sorts of reason why someone might want to write one of these. There's even a bunch of free tools to help test it (and who doesn't like free tests!). Until you put fingers to keyboard, you just don't know, it's all book learnin'.

Good for you. Great way to learn!

[deleted]

Re: Show HN: A little web server in C

#19
post #7
post #4

[flagged]

I dunno. I haven't written a multiplexing I/O server. I haven't written a CGI forking process. I haven't written a reverse proxy handler. Heck, I haven't written C in years. All sorts of reason why someone might want to write one of these. There's even a bunch of free tools to help test it (and who doesn't like free tests!). Until you put fingers to keyboard, you just don't know, it's all book learnin'.

> Until you put fingers to keyboard, you just don't know, it's all book learnin'.

This!

Also writing a HTTP server seems like a hacker rite of passage, like creating your own lightsaber for a Jedi.

So last Christmas, I did just that :)

Personally, I like retrocomputing so I did mine in perl. I learned a lot of things, and I added a few "modern features" as extras like mDNS and cosmopolitan, because it's more fun to use something.local that 127.0.0.1)

It's on https://github.com/csdvrx/PerlPleBean and if you want to dig into mDNS, check the Bonjour part on https://github.com/csdvrx/PerlPleBean/blob/main/experiments/...

It's very fun to be able to launch just one executable and then curl whatever.local

Re: Show HN: A little web server in C

#20
post #10

Cool project, but this project demonstrates the reason I've stopped writing things in C. The standard library has garbage string functions and it seems every project has its own version of this file: https://github.com/robdelacruz/lkwebserver/blob/main/lkstrin... It's fun to write this (and read others' versions) the first 3 or 4 times, but it gets old quickly.

This is how I felt writing Go. Writing the same nongeneric functions with slightly different type signatures and/or endless interfaces and/or interface{} signatures. It's 2023.

never mind than MANY people dont need generics, and that generics have a significant compilation and runtime cost, in terms of time and memory. who cares right?

and never mind that Go has had generics for over a year now right? sometimes having a small, stripped down language is better than having a huge bloated monster. I would point to examples, but you know what they are.

Post reply on HN