Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some problems with the Go implementation:

Looks like go does not have something similar to extension methods, so a result() call should be put at the end to unwrap the collection.

The lambda syntax is even worst than C++ and no query expressions (aka monad syntax)

Most important: No IQueryable<T> Expression<Func<...>> so doesn't work with remote data sources (SQL, mongo,...)

But the library looks ok given the possibilities



Great comments. I have thought about creating an interface so people can just implement their own query evaluation methods and, as you said, do querying from remote data sources. That's still a long-term plan, though, I probably need to see somebody using it before digging that deep.


Does golang support reified code/expression trees/quoted code/whatever you wanna call it? That seems to be a rather critical part of making it work.

Or you use RethinkDB's RQL approach, which implements a bunch of functions that record what you did, at the cost of not being able to put relatively arbitrary expressions inside the query.

Or how else do you translate ".Where(x -> x.Age > 10)" into SQL?


Go pretty much only has extension methods.


In .NET, extension methods are functions defined on the classes you don't own, like string or System.Net.WebRequest. In Go, you cannot define functions on builtin types and exported types from packages other than your own package. So Go way of defining functions on types is not exactly extension methods.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: