HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
zedshaw
mongrel2
OPEN SOURCE2011–2015
zedshaw / mongrel2

mongrel2

Mongrel2 Has Moved!

11Distinct people
11Mentions
0Explicit recommenders
2GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Mongrel2 Has Moved!

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year11 dated mentions

Observed mentions: 2011-05-21 17:28:43 UTC to 2015-06-01 08:14:56 UTC.

0123452011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20112012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2015

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC110
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC202
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC000
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC312
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC505

What Hacker News says

11 sources
I just clicked on that - here was what the top comment had to say about Zed: "Zed is known as one of the most prolific and capable software engineers around and I have heard his C code for Mongrel 2 server https://github.com/zedshaw/mongrel2 described as being amongst some of the best examples of C code to study, learn and understand (trying to find the link that said that). I hold his work in high regard."
In Dear Paul
That's not really the best example of using goto's, as that code is generated from this file: https://github.com/zedshaw/mongrel2/blob/master/src/http11/h... A nicer example of the use of goto's in Mongrel2 is the check macro: https://github.com/zedshaw/mongrel2/blob/a884aef0f4a460e130d... The convention of the project is that every function that has to deal with an error condition has an "error" label. These macro a used to jump to that label to clean up the function before returning. Here's an example: https://github.com/zedshaw/mongrel2/blob/a884aef0f4a460e130d... I think that this use of gotos is more clear than the alternative of a lot of nested if statements checking for success or having the clean up logic duplicated in a lot of places.
In C for high level programmers (slides)
As someone who occasionally dabbles in C code, I am interested in knowing what is the modern take on `goto`s. I know they are "harmful" but I often come across code riddled with goto statements [1] and I personally feel that as long as it makes the code readable without significantly obfuscating the logic, goto is a perfectly fine way of doing things (although popular opinion and consideration for best practices have more or less forced me to remove goto from my list of C tools). Also, the fact that it maps almost directly to asm makes it easier to reason about the generated machine code (although if that's a significant reason for using goto is questionable). [1] https://github.com/zedshaw/mongrel2/blob/master/src/http11/h...; Zed Shaw's Mongrel2 server code linked to in another thread.
In C for high level programmers (slides)
>>Let me start by saying that unlike Mr. Shaw, I am not a writer. I'm an engineer. Zed Shaw, whilst his approach to certain issues may be questionable, is not "a writer rather than an engineer". Zed is known as one of the most prolific and capable software engineers around and I have heard his C code for Mongrel 2 server https://github.com/zedshaw/mongrel2 described as being amongst some of the best examples of C code to study, learn and understand (trying to find the link that said that). I hold his work in high regard. I don't agree with everything that Zed does and think it's a pity that his combative and dogmatic nature detracts from the core message about his work, but the author of this blog post is off track if he is trying to suggest that Zed doesn't know what he is doing and is "a writer" rather than "a software engineer". Zed is
Read the rest
a (cantankerous) software engineer and a writer. The attempt to discredit Zed's credentials just discredits the blog post and its author. When criticizing, criticize the work rather than the person.
In Don't Learn C the Wrong Way
I managed to get Rust wired up to websockets pretty easily. There are working zeromq bindings: so you can use mongrel2 to handle websockets (with or without TLS) and then service those requests with a handler written in Rust! You have to write the handshake & protocol framing yourself; but there's a reference implementation in Python[1] that's only ~200 lines long and supposedly passed the Autobahn test suite. Rust's model of concurrency also jives really well with mongrel2's architecture. --- There's one gotcha: receiving on a zeromq socket through the C bindings blocks the OS thread. This will cause your program to deadlock if you're using Rust's green threading. (Native "1:1" threading is the default however.) [1]: https://github.com/zedshaw/mongrel2/tree/master/examples/ws
In Is Rust web yet? Not really
lkrubner·Mar 28, 2014Submission

Ask HN: Whatever happened to Mongrel2?

I was very excited about Mongrel2 for awhile, and also some of the projects that were being built off of it. For instance, I have mostly abandoned PHP, but Photon was the one PHP project that struck me as interesting, and it was built on top of Mongrel2. http://www.photon-project.com/ When I look here it seems the bulk of the work stopped almost 2 years ago: https://github.com/zedshaw/mongrel2 The work done this last year seems minor. I also notice that Zed Shaw is mostly working on some Javascript library right now. The world needs a great server built on top of ZeroMQ. Is anyone still focused on this project? If not, are there any other servers that use ZeroMQ in such a foundational way?
2 points · Open discussion
Excellent critique, but you show your hand here: > K&R is an excellent reference, and LCTHW covers some new topics like valgrind, which is great. Wrong, I already demonstrate that they have an example that is basically strcpy() and I show why it's broken. By the time I'm done with the book I'll have taken apart the entire book and shown that it's the source of most security holes through poor examples. > However, it fails to point out that some of the exercises are just that; exercises. For example, creating a custom type system in C. Never do this. Totally wrong. You basically just said that all of gobjects (the foundation of Gnome) should not exist, yet it's a successful object oriented abstraction. You may think that's true, but then you'd be in the vast minority. Without a demonstrated reason why one should never do this, your stat
Read the rest
ement is total bullshit. > Some other failings include; little attention to testing, no mention of cmake (used in major projects like opencv and clang) or lint(!), criticism of K&R systax (arguably validly so, but industry standard is industry standard). There's extensive attention to testing, with nearly every exercise having use of valgrind and the inclusion of defensive programming macros not found in most other books PLUS a constant demand to break the code they've just written. In the second half of the book I'll be including the testing suite I use in my own projects: https://github.com/zedshaw/mongrel2/blob/master/tests/minuni... This claim is borderline slanderous it's so wrong. Edit: And cmake is a piece of crap that isn't better than modern make. > Look there's a lot of good in Learn C the Hard Way. I completely recommend it as a way to learn some C... but don't make the mistake of assuming a new book is better than an old book just because it's new. Meanwhile, you make the mistake of not questioning the code in K&R when a cursory read finds numerous flaws and buffer overflows. If you feel that people should evaluate all things objectively (I agree!) then do it yourself and actually read K&R again. And by the way, they updated it several times to remove defects since you probably read it. My copy was only a few years old and I had to update it because they fixed bugs in that copy() function I tear apart (but not enough). > If you're programming C, read K&R. If you're doing it professionally, you probably also want to read Deep Sea Programming by Peter van der Linden. I agree, solid recommendations, but I'm going to advocate people read K&R for historical reasons and to practice code review, which is what I'm doing in my book.
In Learn C The Hard Way

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.