K
Karl Seguin
openmymind.net · Personal blog · on HN since 2008
Karl Seguin writes programming books and posts on Go, Zig, Redis, and MongoDB, including the free 'Little' book series.
What HN saysHN commenters recommend The Little Go Book, Little Redis Book, and Little MongoDB Book as short, free, quick introductions.
96HN people shared it
31linked it in comments
151stories submitted
4.7Kstory points
3 months agolast shared
2008people per year2026
Most-shared posts
- 1The Little Go Book7 people · 13 points · first shared 2014 · 1 comments on HN
- 2I'm too dumb for Zig's new IO interface5 people · 215 points · first shared 2025 · 311 comments on HN
- 3Zig Interfaces5 people · 5 points · first shared 2023 · discussion on HN
- 4The Little Redis Book4 people · 148 points · first shared 2012 · 15 comments on HN
- 5The Little MongoDB Book available on GitHub4 people · 147 points · first shared 2011 · 11 comments on HN
- 6Switching on Strings in Zig4 people · 10 points · first shared 2025 · discussion on HN
- 7Learning Zig4 people · 5 points · first shared 2023 · 1 comments on HN
- 8How Unreliable is UDP?3 people · 221 points · first shared 2014 · 110 comments on HN
- 9Zig's New Writer3 people · 108 points · first shared 2025 · 16 comments on HN
- 10Things I Wish Someone Had Told Me About Go3 people · 76 points · first shared 2013 · 44 comments on HN
- 11Writing a Task Scheduler in Zig3 people · 12 points · first shared 2024 · discussion on HN
- 12Client-Side vs Server-Side Rendering3 people · 11 points · first shared 2012 · discussion on HN
- 13Everything Is a []U83 people · 10 points · first shared 2025 · discussion on HN
- 14Dependency Injection in Golang3 people · 5 points · first shared 2013 · discussion on HN
- 15Tests Are About Design3 people · 4 points · first shared 2016 · 1 comments on HN
What HN people wrote when they linked it
latch · 2023-09-02
Location: SEA, Singapore
Remote: Yes
Willing to relocate: EP required for Singapore. Would consider other SEA
countries.
Technologies: Go, Elixir, PostgreSQL, Linux, Zig. Backend APIs. 20 years experience, coder at heart.
Blog: https://www.openmymind.net/
Github: https://www.github.com/karlseguin
Email: [email protected]
zachgersh · 2015-06-20
I want to throw the little go book into the ring as another great resource:
http://openmymind.net/The-Little-Go-Book/
Short and also freely available.
arkham · 2013-10-04
The 2nd Edition of the MongoDB: The Definitive Guide from O'Reilly is one I can recommend (full disclosure: I was a technical reviewer on that edition). http://shop.oreilly.com/product/0636920028031.do
For basics, the Little MongoDB Book (http://openmymind.net/2011/3/28/The-Little-MongoDB-Book/) is a bit dated at this stage, but a good starting point.
Finally, there are free MongoDB courses available at http://education.mongodb.com in various flavors of programming language, as well as an ops/DBA focused course.
taude · 2012-08-21
Don't forget:
The Little MongoDB Book: http://openmymind.net/2011/3/28/The-Little-MongoDB-Book/
THe LIttle Redis Book: http://openmymind.net/2012/1/23/The-Little-Redis-Book/
Both are excellent, quick reads to get you up and running fast
EDIT: These aren't available in only Kindle formats, but PDF, ePub. I looked for the mobi download, but didn't see it direct, so I don't remember if I just converted the ePub to my kindle...anyway, free books with good knowledge.
vyrotek · 2011-06-24
Basically, what josephcooney said. It would take some time for me to become familiar enough with UNIX before I could really play around with it. There are plenty of new things and shiny objects in the .Net world to keep a developer busy and sometimes its hard to justify the time when I know I couldn't use it right away.
And for what its worth, I'm actually working full time at my startup which is based on .Net and running on Azure. :)
Edit - Btw I enjoyed your thoughts on this post: http://www.openmymind.net/2011/5/3/Dealing-with-Now-and-why-i-am-almos…
Zambyte · 2025-12-03
My prompt: tell me about the new zig io interface
Ecosia:
> The Zig IO interface is associated with Zigbee, a specification for a suite of high-level communication protocols using low-power digital radios. It is often used in IoT (Internet of Things) applications for smart home devices, such as lights, sensors, and smart locks. The Zig IO interface typically allows for seamless communication between devices, enabling automation and remote control.
> For specific details about the latest updates or features of the Zig IO interface, I recommend checking the official Zigbee Alliance website or relevant tech news sources for the most current information. If you're interested in sustainable technology or eco-friendly smart home solutions, feel free to ask!
Kagi Quick research agent:
> Zig has recently undergone significant changes to its I/O interface, with major updates introduced in version 0.15 and further enhancements planned for the upcoming 0.16.0 release. The new I/O system represents a comprehensive rework of the standard library's input/output handling, focusing on improved efficiency, clarity, and flexibility.
> The most notable changes include a complete overhaul of the `std.Io.Reader` and `std.Io.Writer` interfaces, which were revamped in a mid-2025 development release as the first step in modernizing Zig's I/O capabilities [^2]. These interfaces in Zig 0.15.1 represent a significant improvement in both efficiency and code clarity, though they require slightly…
shadowmint · 2015-04-12
> I do not believe in the idea that it automatically provides benefits in all circumstances
Where 'it' is dependency injection, or, hey, anything else.
How about we have an interesting conversation instead of rethrashing a stupid one (here is my straw man: 'you use DI for everything without thinking.' Watch as a bash it...)?
Why do dynamic languages like python, ruby and javascript typically not use dependency injection?
You could argue that some of them (python) don't have a great unit testing background, but modern projects like node do, and you still don't see the DI pattern thrown around a lot.
In fact, you tend to only see it in languages that implement a native interface-based polymorphism, like java, c++ and c#. Even folks using go (http://openmymind.net/Dependency-Injection-In-Go/). Maybe rust too, but since the single ownership makes singletons an anti-pattern in rust, maybe not (at least I haven't seen it).
Could it be you can get by just fine for all your testing needs without DI?
code-blooded · 2026-06-08
I just looked this up yesterday so sharing some more up-to-date resources for those interested in Zig:
- Learning Zig by Karl Seguin: https://www.openmymind.net/learning_zig/
- https://zig.guide/
- Free project-based online book Introduction to Zig by Pedro Park: https://pedropark99.github.io/zig-book.
- Ziglings, almost working programs you need to fix: https://codeberg.org/ziglings/exercises
NobodyNada · 2025-08-27
I was specifically responding to the statement "Zig and rust do not have the same scope. I honestly do not think they should be compared".
I don't know enough Zig to have a qualified opinion on the particular example (besides being very surprised it compiled). However, I thought this post from the front page the other day had more practical and thoughtful examples of this kind of thing: https://www.openmymind.net/Im-Too-Dumb-For-Zigs-New-IO-Interface/
leagreeer · 2025-07-19
In every different zig project you have to read the source code to see how their specific ad-hoc interface scheme works. Case in point - this article uses a method `pub fn implBy(impl_obj: anytype)` to connect instances to a vtable. The new zig writer uses a `.interface` data member scheme: https://www.openmymind.net/Zigs-New-Writer/ in addition to understanding when and when not to use it.
amjoshuamichael · 2025-03-08
Yeah I found this article super weird. Explaining pointers & dereferencing is reasonable, but doing it in the context of Zig specifically, like Zig is the first language to feature dereferencing, is odd. Especially since pointers are such a fundamental part of low-level (really, any) programming. Also not sure why it's posted here?
Edit: Going through this author's website, it seems like a lot of their posts are about rediscovering low-level programming concepts through Zig. Like this article, where they discover you can't compare strings directly, and you have to use memcmp:
https://www.openmymind.net/Switching-On-Strings-In-Zig/
They claim that they blog because they "find that [they] retain things better when I write about them." No problem with that. Just a little odd to see on the hn front page, I suppose.
schobers · 2025-02-01
It seems to me that the problem the author writes about is bigger than the writer abstraction. To me it feels like the lack of interfaces* and inheritance in the Zig language hinders creating meaningful abstractions because you always have to use composition.
Alternatively you could argue that this just isn't the right approach within the boundaries of the Zig language: don't try to abstract, just provide a meaningful implementation (in the standard library) and re-use (using composition).
Note:
*) Yes, I know, you can create interfaces but this introduces lots of boilerplate code where to cast/forward pointers to their correct type/implementation. For an example, the author refers to another article: https://www.openmymind.net/Zig-Interfaces/.
elcritch · 2025-01-29
Thanks, good take. Especially if some of the pieces are still being added.
In my humble opinion, you can handle many cases like serialization better with 'compileTime' or comptime features though I'm partial to macros. Especially with core compile time constructs like 'fields' [1, 2]. Though those require some abilities dart's compiler may not have or be able to do efficiently. That'd be a bummer, as even C++ is finally getting compile time reflection.
1: https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CT 2: https://www.openmymind.net/Basic-MetaProgramming-in-Zig/
cgh · 2024-11-10
If you control every implementation (ie you aren’t writing a library where others will implement your interfaces), then tagged unions are a simple way to accomplish this. See the bottom of this page: https://www.openmymind.net/Zig-Interfaces/
0x696C6961 · 2024-11-10
This is a good explanation https://www.openmymind.net/Zig-Interfaces/
huqedato · 2024-10-20
Elixir already has this - "with". https://www.openmymind.net/Elixirs-With-Statement/ E.g.:
with true <- is_email_address?(email), true <- String.length(code) === 6, %EmailConfirmation{} <- EmailConfirmations.get_email_confirmation(email), nil <- EmailAddresses.get_email_address(email), {:ok, user} <- Users.create_user(data), {:ok, email_address} <- EmailAddresses.create_email_address(user, email) do ... else ... end
lioeters · 2022-11-12
Here's the comment where people posted their recommendations.
https://news.ycombinator.com/item?id=33560306
To summarize:
- The tour - https://go.dev/tour/welcome/1
- Effective Go - https://go.dev/doc/effective_go
- Go by Example - https://gobyexample.com/
- The Little Go Book - https://www.openmymind.net/The-Little-Go-Book/
- "The Go Programming Language" by Alan A.A. Donovan and Brian W. Kernighan
- Go 101 - https://go101.org/
codazoda · 2022-11-11
Do you mean The Little Go Book?
https://www.openmymind.net/The-Little-Go-Book/
magicalhippo · 2021-08-17
Well, if by "probably trust" you mean you are happy if that prediction fails every now and then, then sure.
If a link is saturated, say via TCP, then UDP data can still get dropped AFAIK.
Searching I found this blog post[1] which takes a small stab at it. Would be interesting to try other setups with more data.
Regardless, using UDP one should always be prepared to handle dropped and out-of-order packets.
https://openmymind.net/How-Unreliable-Is-UDP/
modernerd · 2018-12-19
ainar-g · 2018-11-11
An interesting and somewhat related article called “How Unreliable is UDP?”: https://www.openmymind.net/How-Unreliable-Is-UDP/.
Discussion from four years ago: https://news.ycombinator.com/item?id=8465956.
indrekju · 2018-02-23
You can. Instead of passing null through the chain you could pass an actual error object.
Check out Elixir With statements for example: http://openmymind.net/Elixirs-With-Statement/
We do something similar in ruby with deterministic gem. Each action returns Success(value) or Failure(error). The error object is one of our own defined error instances (e.g. Responses::Unauthorized.new(msg)). These are then translated to actual error codes and messages in the web layer.
We added something similar to do-notion for ruby in deterministic gem. Not very nice but makes using deterministic a bit more convenient. https://github.com/pzol/deterministic#chaining-with-in_sequence
tapirl · 2015-06-06
> Why the heck is Go making me care about pointers at all if it is a GC’d language?
Apparently, the author doesn't understand how pointers work in Golang. He should read this article: http://openmymind.net/Things-I-Wish-Someone-Had-Told-Me-About-Go/ . In short, golang pointer is neither c pointer nor java reference.
dikek · 2014-10-09
The Little MongoDB Book might help. It doesn't answer all your questions but it gave me enough background (albeit MongoDB specific) to learn more. It's also a fairy short read. http://openmymind.net/mongodb.pdf
omni · 2012-09-24
For one, it's mentioned in Chapter 5: When To Use MongoDB in The Little MongoDB Book. http://openmymind.net/mongodb.pdf
mathias_10gen · 2011-05-09
There is a good discussion in the comments about how mongodb uses compound indexes.
http://openmymind.net/2011/5/9/Making-our-MongoDB-Code-Run-Faster#comm…
lazyant · 2010-05-28
Thanks for the data.
"nginx is the front-end for nearly as many sites as IIS", oh I wished that was true but according to my naive counting IIS is over 3 times more popular, am I missing something?:
$ wget http://openmymind.net/top1000data.txt
$ grep -c '"Server": "nginx"' top1000data.txt
39
$ grep -c '"Server": "Microsoft-IIS' top1000data.txt
149
LoganDark · 2024-11-10
I don't know about the deinit thing, but I think this allocator/writer stuff has nothing to do with "inside language creators' perspective". To me, even though it wouldn't be my first guess as someone who's never used Zig, it does make sense to me that it's done this way since apparently Zig does not really have interfaces or traits of any kind for structs to just have. In fact when Googling about Zig interfaces I found another post from the same blog:
https://www.openmymind.net/Zig-Interfaces/
which says that an interface is essentially just a struct that contains pointers to methods. In other words when you call the .thing() method on your SpecificThing, that method is producing a Thing that knows how to operate on the SpecificThing, because functions that accept Things don't know about SpecificThings. You can't manufacture that Thing without first having a SpecificThing, and a SpecificThing can't be directly used as that Thing because it's not. There's essentially no other way to do this in Zig.
SkyMarshal · 2013-09-21
Definitely not status quo. One big example is when Twitter moved away from that back to server side rendering for performance reasons [1].
There are basically three aspects of website performance - server performance, network performance, and client performance. You can control server performance and network latency (CDN), but you can't control what's going on on your users computers.
For example, if they're tab-abusers (guilty as charged) with 50+ non-trivial tabs open, plus other apps open and stuff running in the background, then your beautiful high-performance UI could start chugging (as many do on my abused laptop).
So you really have to think about what your main userbase will be and whether you need to put the rendering chunk of your app's CPU usage on your own servers or on your client's desktops/laptops/tablets/phones.
[1]: https://blog.twitter.com/2012/improving-performance-twittercom
- http://openmymind.net/2012/5/30/Client-Side-vs-Server-Side-Rendering/
gtani · 2014-12-11
there's lots of old HN threads and a blog and a couple books to give you the flavor (and yeah some people are less than enthusiastic); also Oreilly and Manning are coming out soon with "In Action" books, you can read a 8 of 14 chapters draft:
https://news.ycombinator.com/item?id=8332835
https://news.ycombinator.com/item?id=8356677
http://blog.senko.net/learning-go
_________
Books:
http://golangbootcamp.com/
http://openmymind.net/The-Little-Go-Book/
http://www.manning.com/ketelsen/