Hacker News new | ask | show | jobs
by enno 4024 days ago
I learned a ton of things doing this (not least how to post something on HN, and that Show HN exists). Can't say that for Minecraft.
1 comments

That's why I upvoted you.

Btw, have you followed a tutorial or a instruction to make this? I'm reviewing the code and it seems pretty straightforward.

Thanks for the upvote and the compliment! There isn't all that much code, just enough for a toy project, and what there is, is written with maintainability in mind.

Not sure what kind of tutorial I could have read. I've seen two key-value store implementations before, memcache and openkeyval. The memcache code is a nightmare to follow, and openkeyval is written in PHP, so neither of them is what I'd call either a tutorial or instructive.

Other than that, I read a book about C twenty years ago, but I'm completely self-taught ever since. I obviously read djb's paper on critbit trees before implementing them. The rest is from man pages and code. I had never used libfcgi for anything big before embarking on this, so that was a new thing. It's also my first time using mmap, and the Windows equivalent. Configuring nginx just right may have been the hardest part of it all.

I think the code is pretty clean, although it could use a few more tests. Mocking out libfcgi is a bit of a chore that I didn't want to go into right now, and it has already bitten me in the ass once.