Better HN
topnewbestaskshowjobs
Log inSign up

aleksi

2,212 karma · joined Nov 10, 2011 (15y ago) · 259 submissions

FerretDB (https://www.ferretdb.com) co-founder and CTO.

[ my public key: https://keybase.io/aleksi; my proof: https://keybase.io/aleksi/sigs/qhnH72xD_3_TdT9WvSCM6A_NRosP5WqsL2FIAqmljLI ]

Submissions

comment 1mo ago · link · parent

You know what you did

comment 1mo ago · link · parent

https://pkg.go.dev/net/http#Client.Do

> Note, however, that Transport will automatically try to read a Response Body to EOF asynchronously up to a conservative limit when a Body is closed.

Similar wording appears in a few other places; search for “asynchronously”.

comment 1mo ago · link · parent

I can finally remove a similar helper that I copied from project to project and from company to company since r60

comment 2mo ago · link · parent

> The pull requests are public, and the prompts, raw model outputs, judge verdicts, bug-class labels, repeat runs and scoring scripts are committed with this article.

Okay, but where are they? This quote says that PRs are public. Does that mean that everything else is private and we can’t actually reproduce those results?

This, and the fact that the article doesn't mention reasoning levels, sounds fishy to me.

comment 8mo ago · link · parent

I was on this talk expecting to hear about MongoDB abusing open source (as you could guess from my profile, that’s a topic dear to my heart). Instead, I saw the most entertaining talk in my life.

comment 9mo ago · link · parent

Yet most, if not all, READMEs of official branches recommend using mutable vM tags. Not even branches — tags that they re-create.

comment 9mo ago · link · parent

See also https://github.com/golang/go/issues/66653 (that I don’t think is linked from the article)

comment 10mo ago · link · parent

You omit the fact that he took those words back and said “Crimea is Ukraine” while being in prison, knowing well it will not make his life (and death) easier

comment 10mo ago · link · parent

> What languages will be supported?

> As a real keyboard with the QWERTY layout, Communicator supports languages that use the Latin alphabet: [...] Russian

Weird

comment 1y ago · link · parent

Aaaand it's gone!

comment 1y ago · link · parent

You can make it run much better by increasing the game's process priority with `renice`. I know that sounds like something that should not work, but it does.

comment 1y ago · link · parent

You are right; I stand corrected

comment 1y ago · link · parent

> If you have a struct with a simple int field, and you store that somewhere as an *int, the entire struct and anything it points to will be kept alive.

While Go allows interior pointers, I don't think what you say is true. runtime.KeepAlive was added exactly to prevent GC from collecting the struct when only a field pointer is stored. Take a look at this blog post, for example: https://victoriametrics.com/blog/go-runtime-finalizer-keepal...

comment 1y ago · link · parent

As a producer of the response, if I didn't care about being understood, I would use a made-up language. As a consumer, you may care about understanding my response, but you cannot do anything about it.

comment 1y ago · link · parent

I think you missed the “any handler” part. Currently, the types that my library package could use depend on the handler used by the caller. This limits types to an unspecified subset, making things quite impractical.

comment 1y ago · link · parent

1) The idea is that your library should accept the slog logger and use it. The caller would create a logger with a handler that defines how log messages are handled. But there are problems with supported types; see my other comments.

2) It is improved in 1.25. See https://github.com/golang/go/issues/59928 and https://pkg.go.dev/testing#T.Output. Now it is possible to update slogt to provide correct callsite – the stack depth should be the same.

comment 1y ago · link · parent

My problem with that is that it makes it impossible to use slog logger safely without knowing what handler is being used. Which kind of defeats the purpose of defining the common structured logging interface.

comment 1y ago · link · parent

Not sure I understand your sarcasm. I read the documentation, source code, handler writing guide, and issues in the Go repository multiple times over two years, and I use slog extensively. Go is my primary language since r60. I think I know how to read Go docs.

Now, please point me to the place in the documentation that says if I can or can't use a value implementing the error interface as an attribute value, and will the handler or something else would call the `Error() string` method.

My definition of "supported" is simple – I could pass a supported value to the logger and get a reasonable representation from any handler. In my example, the JSON handler does not provide it for the fmt.Stringer.

comment 1y ago · link · parent

So clearly not all values are supported.

And I know that I can create a wrapper for unsupported types. My problem is exactly that – I don't know what types are supported. Is error supported, for example? Should I create a wrapper for it? And, as a handler author, should I support it directly or not?

comment 1y ago · link · parent

Well, is fmt.Stringer supported? The result might surprise you:

  req := expvar.NewInt("requests")
  req.Add(1)
  
  attr := slog.Any("requests", req)
  
  slog.New(slog.NewTextHandler(os.Stderr, nil)).Info("text", attr)
  slog.New(slog.NewJSONHandler(os.Stderr, nil)).Info("json", attr)
This code produces

  time=2025-09-12T13:15:42.125+02:00 level=INFO msg=text requests=1
  {"time":"2025-09-12T13:15:42.125555+02:00","level":"INFO","msg":"json","requests":{}}
So the code that uses slog but does not know what handler will be used can't rely on it lazily calling the `String() string` method: half of the standard handlers do that, half don't.

comment 1y ago · link · parent

My biggest gripe with slog is that there is no clear guidance on supported types of attributes.

One could argue that supported types are the ones provided by Attr "construct" functions (like slog.String, slog.Duration, etc), but it is not enough. For example, there is no function for int32 – does it mean it is not supported? Then there is slog.Any and some support in some handlers for error and fmt.Stringer interfaces. The end result is a bit of a mess.

22.

Linux Foundation says yes to NoSQL via DocumentDB(theregister.com ↗)

5 points · by aleksi · 1y ago · discuss

comment 1y ago · link · parent

And our (FerretDB) take on it: https://www.linkedin.com/feed/update/urn:li:share:7365677213...

comment 1y ago · link · parent

And our take on it: https://www.linkedin.com/feed/update/urn:li:share:7365677213...

25.

DocumentDB Joins the Linux Foundation(opensource.microsoft.com ↗)

11 points · by aleksi · 1y ago · 1 comment

comment 1y ago · link · parent

I open-sourced my MongoDB alternative, and all I got was this lousy lawsuit.

comment 1y ago · link · parent

> It's too slow to run in prod to be worth it

I disagree there. It is reasonable to run a few service instances with a race detector. I have a few services where _all_ instances are running with it just fine.

comment 1y ago · link · parent

See https://manticoresearch.com/comparison/vs-sphinx/. Sphinx is no longer open-source.

comment 1y ago · link · parent

> Tigris means tiger

I'm pretty sure Tigris Data is named after the Tigris river (https://en.wikipedia.org/wiki/Tigris), and the name does not mean "tiger".

12345
9