HN user

nalgeon

6,898 karma

antonz.org

Posts396
Comments101
View on HN
bvisness.me 1y ago

Micro-libraries should never be used

nalgeon
180pts173
kevincox.ca 1y ago

Private Internet

nalgeon
31pts14
victoriametrics.com 1y ago

Go Maps Explained: How Key-Value Pairs Are Stored

nalgeon
4pts0
antonz.org 1y ago

Show HN: High-precision date/time in SQLite

nalgeon
274pts68
www.lambrospetrou.com 1y ago

Durable Objects – Unlimited single-threaded servers spread across the world

nalgeon
2pts0
www.openmymind.net 1y ago

Basic MetaProgramming in Zig

nalgeon
104pts7
antonz.org 1y ago

Show HN: High-precision date/time in SQLite

nalgeon
6pts0
ashvardanian.com 1y ago

The Painful Pitfalls of C++ STL Strings

nalgeon
2pts0
healeycodes.com 1y ago

Generating Mazes

nalgeon
1pts0
duckdb.org 1y ago

Friendly Lists and Their Buddies, the Lambdas

nalgeon
1pts0
rednafi.com 1y ago

HTTP Requests via /Dev/TCP

nalgeon
4pts0
victoriametrics.com 1y ago

Golang Sync Mutex: Normal and Starvation Mode

nalgeon
3pts0
www.sandordargo.com 1y ago

The Rule of 5 and Inheritance

nalgeon
3pts0
www.openmymind.net 1y ago

Zig's HashMap

nalgeon
4pts0
defn.io 1y ago

Using Units in Racket

nalgeon
3pts0
antonz.org 1y ago

Resetting Timers in Go

nalgeon
1pts0
rednafi.com 1y ago

Log context propagation in Python ASGI apps

nalgeon
2pts0
github.com 1y ago

Formulosity – Surveys as Code

nalgeon
1pts0
antonz.org 1y ago

Gist of Go: Wait Groups

nalgeon
1pts0
github.com 1y ago

Watchexec: Execute commands in response to file modifications

nalgeon
2pts0
daniel.haxx.se 1y ago

Libcurl Is 24 Years Old

nalgeon
1pts0
github.com 1y ago

K'exp – Kubernetes Explorer

nalgeon
2pts0
antonz.org 1y ago

Gist of Go: Wait Groups

nalgeon
2pts0
antonz.org 1y ago

Gist of Go: Wait Groups

nalgeon
3pts0
rednafi.com 1y ago

Please don't hijack my Python root logger

nalgeon
6pts0
antonz.org 1y ago

Go Features by Version

nalgeon
3pts0
kovalevsky.io 1y ago

Full Introduction to Golang with Test-Driven Development

nalgeon
37pts15
antonz.org 1y ago

Go Features by Version

nalgeon
3pts0
victoriametrics.com 1y ago

How Go Arrays Work and Get Tricky with For-Range

nalgeon
2pts0
nullprogram.com 1y ago

Deep list copy: More than meets the eye

nalgeon
1pts0

The title of the article is "Micro-libraries need to die already". Renaming the submission to "Micro-libraries should never be used" is pathetic, Daniel. I'm not surprised though.

I appreciate your comments, and thank you for trying out the extension.

This query returns -1 (minus one, not one), which seems correct to me. The first date is before the second:

    select time_compare(
      time_date(1927, 12, 31, 23, 58, 08, 0, 28800000),
      time_date(1927, 12, 31, 23, 58, 09, 0, 28800000)
    );

    -1
Go 1.23 Released 2 years ago

If you find the official release notes a bit dry (they really are), I've prepared an interactive version with lots of examples:

- Iterators (range / types / pull / slices / maps).

- Timer changes (garbage collection and reset/stop behavior).

- Canonical values with the `unique` package.

- HTTP cookie handling.

- Copying directories.

- Slices and atomics changes.

https://antonz.org/go-1-23

Thank you, glad you like it! In fact, one of the reasons I started Codapi in 2023 was to have a playground for an interactive book on Go concurrency.

I got a bit carried away with Codapi and later Redka (Redis+SQLite), but eventually returned to the book :)

It works with redis-py (which python-rq uses), but I doubt it will be any good in this case. python-rq seems to use Lua scripting in Redis, which is not planned for 1.0. I'd rather not add it at all, but we'll see.

The goal is to have a convenient API to work with common data structures, with an SQL backend and all the benefits it provides. Such as:

— Small memory footprint even for large datasets.

— ACID transactions.

— SQL interface for introspection and reporting.

Great tips, thank you! The thing is, getting maximum throughput is not the goal of the project (at least not at this stage). I'm using reasonable SQLite defaults (including WAL), but that's it for now.

Thank you! I also think that the relational model can get you pretty far if you don't need to squeeze every last bit of performance out of the program. And the added benefit of using a battle-tested SQL engine is far fewer storage-related bugs.

Yeah, it's explained in the code[1]

SQLite only allows one writer at a time, so concurrent writes will fail with a "database is locked" (SQLITE_BUSY) error.

There are two ways to enforce the single writer rule:

1. Use a mutex for write operations.

2. Set the maximum number of DB connections to 1.

Intuitively, the mutex approach seems better, because it does not limit the number of concurrent read operations. The benchmarks show the following results:

- GET: 2% better rps and 25% better p50 response time with mutex

- SET: 2% better rps and 60% worse p50 response time with mutex

Due to the significant p50 response time mutex penalty for SET, I've decided to use the max connections approach for now.

[1] https://github.com/nalgeon/redka/blob/main/internal/sqlx/db....

The most healthy approach is probably to compare yourself to yourself N years ago, not to others. Comparing yourself to others will always leave you disappointed.

But it's easier said than done. Especially if you read HN :)

Working like this typically creates additional cognitive load because you have to constantly convince yourself that it's okay, you can handle it, it's just a job, etc. It also increases the risk of burnout.

So yeah, it's a pretty tough deal.