←back to thread

127 points warothia | 5 comments | | HN request time: 0.416s | source
Show context
gwbas1c ◴[] No.42166517[source]
Important question: Why would anyone develop a web application in C? Typically web applications lean heavily on garbage collection and memory safety, because their bottlenecks are very rarely CPU/memory issues. The ROI on manually managing memory just isn't there for a typical web application.
replies(10): >>42166611 #>>42166628 #>>42166883 #>>42167123 #>>42167520 #>>42167739 #>>42167933 #>>42168255 #>>42169645 #>>42173754 #
1. warothia ◴[] No.42166611[source]
I could say speed, but the main reason for me is because it is fun. And I like to see what I can make C do. :D
replies(2): >>42170880 #>>42171335 #
2. mst ◴[] No.42170880[source]
"Because I can" remains an entirely legitimate reason for a hobby project.

If anything, you've gone further along the "also (at least sort of) practical" scale than I expected.

Given as mentioned elsewhere a per-request arena + bump allocator system, it might actually be -genuinely- practical (to the extent that writing application logic in C is at all ;)

Bravo.

replies(1): >>42170903 #
3. warothia ◴[] No.42170903[source]
Thanks! Yes, an arena allocator for each request is on my todo list. Just didn’t get to implementing it yet. :D
4. kaba0 ◴[] No.42171335[source]
The second point is absolutely fair and your project is very cool and impressive, but the speed one is misleading. I am fairly sure you actually leave a fair bit of performance on the table simply by how convoluted parallelism and async IO are in C, and something like Java might easily outperform it in standard CRUD backend use cases.
replies(1): >>42171572 #
5. warothia ◴[] No.42171572[source]
You’re absolutely right, I have not tried very hard to optimize for speed either yet. To comment was more directed at the fact most just say that “speed” is the main reason to use C, but for me it’s almost exclusively for the fun and “cool” factor.