Earlier quoted context omitted.
So what was the point of the async/callback web programming revolution if processes were good enough?
The point was that you didn't have the ability to spawn new threads at all . async lets you pretend you have threads, at the cost of everything being run through a hidden event loop.
Althttpd: Simple webserver in a single C file
131–140 of 345 posts
Re: Althttpd: Simple webserver in a single C file
#132Earlier quoted context omitted.
Just use recordflux for binary parser proved absent of runtime errors... ;-)
Can you expand on that a little?
Re: Althttpd: Simple webserver in a single C file
#133Earlier quoted context omitted.
The reason HTTP is ASCII based isn't because it's easier to debug. It's because back then the other end was as likely to be a human as a piece of software. Because HTTP in it's early days barely had headers or even formatting, so people typed "GET /" at the server directly or used the same method to send mail directly. Nobody does that anymore and debugging is easily solved by converting your binary protocol to a tex…
I question the ascertain that humans were doing "GET /" or "HELO my.fq.dn" on any regular basis. There were mail clients from the very beginning for example: * https://en.wikipedia.org/wiki/History_of_email Perusing document-based information was also done via clients, first with Gopher and then with the WWW: either GUIs like Mosaic, or on the CLI via (e.g.) Lynx.
Re: Althttpd: Simple webserver in a single C file
#134Here is the actual single C-code file: https://sqlite.org/althttpd/file?name=althttpd.c Something I absolutely love about text based protocols such as HTTP/1 is how easy you can implement it in any virtually programming language. Sure, the implementation is not top-of-the-notch, but it just damned works, it is portable, it is understandable by humans. That's something what's got lost with HTTP/2 and HTTP/3, respectiv…
Being text based is a huge flaw with HTTP in my opinion (and also elsewhere, like Redis). It leads to parsing bugs and overly verbose communications. Humans are good at reading text, CPUs prefer binary.
Re: Althttpd: Simple webserver in a single C file
#135Interesting. If the load avg is consistently low, it could mean they're over-paying for CPU. If this was a non-dedicated AWS instance you might want low load so you don't chew up CPU credits, but you'd also want to use an instance type that creates some load so you're utilizing what you're paying for. Linode VPCs don't use cpu credits so the calculation is a bit simpler. I'm also curious how much of that bandwidth couldn't be offset by a CDN or mirrors.
If you were using a serverless platform, you'd ideally want to use something like static site hosting feature where you're mostly just paying for storage and egress. Or a serverless application platform to auto-scale traffic as needed. The main problem with doing this, of course, is the cost of egress: cloud providers with fancy serverless platforms often have redonkulous egress costs, so using a plain old VM on a VPC provider can be cheaper if you have more bandwidth demands than compute.
(I am aware none of this is a concern if you'd rather just spend $40 and forget about it. I am a nerd.)
Re: Althttpd: Simple webserver in a single C file
#136I'd be putting this in 1000 layers of sandboxing since its a C program with network access.
Maybe I'm getting old but these days I'm having a hard time telling if comments like these are serious or sarcastic.
Re: Althttpd: Simple webserver in a single C file
#137There is also redbean ( https://justine.lol/redbean/ ) - a single-file web server with embedded Lua interpreter as an Actually Portable Executable by Justine Tunney, the creator of Cosmopolitan.
Justine Tunney is a treasure!
Re: Althttpd: Simple webserver in a single C file
#138Sure it lives a single file, but considering the length, wouldn't it actually be better to split it into multiple files? I'm not that familiar with C, it seems to be a "thing" in C to just have giant files.
Re: Althttpd: Simple webserver in a single C file
#139Earlier quoted context omitted.
I never understood the point of squashing if you just want the short version, only read the merge commits; if you want the full details to figure out some bug or whatever, then yes, I want those fix typo commits most definitely, because as often as not, those are at fault. Squashing buys you next to nothing, and costs you the ability to dive into the history in greater detail. I suppose if your project is truly huge,…
Squashing for example allows me to have a history where each commit builds. This has been very useful for bisecting for me. I wouldn't call it "next to nothing". The "greater detail" part can cost me a lot of time.
Re: Althttpd: Simple webserver in a single C file
#140Earlier quoted context omitted.
Squashing for example allows me to have a history where each commit builds. This has been very useful for bisecting for me. I wouldn't call it "next to nothing". The "greater detail" part can cost me a lot of time.
Having commits that do not build represents the history more accurately. It could very well be a “fix” to some build error that silently introduces an issue, that context is lost when you squash.