News for hackers. Stuff that matters.
Re:Show HN: LINQ for Go by MichaelGG on Saturday January 04, 2014 @02:10AM (#7010338)
The real language part of LINQ isn't the simple sequence functions (.NET had them before LINQ), it's the LINQ monad embedded into the language.

While personally I don't think I've ever used the LINQ monad syntax, and wish it had been implemented as a generic feature, not every language with support for anonymous functions or closures or function pointers is "LINQ".

Re:Show HN: LINQ for Go by olmo on Saturday January 04, 2014 @02:51AM (#7010409)
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

Re:Show HN: LINQ for Go by aabalkan on Saturday January 04, 2014 @03:20AM (#7010459)
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.
Re:Show HN: LINQ for Go by MichaelGG on Saturday January 04, 2014 @07:02PM (#7013653)
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?

Re:Show HN: LINQ for Go by fleitz on Saturday January 04, 2014 @03:11AM (#7010441)
Go pretty much only has extension methods.
Re:Show HN: LINQ for Go by aabalkan on Saturday January 04, 2014 @03:21AM (#7010463)
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.
Re:Show HN: LINQ for Go by aabalkan on Saturday January 04, 2014 @03:18AM (#7010455)
I am afraid that's actually not 100% accurate. Microsoft also uses term "LINQ" for method-based query syntax. See here: http://msdn.microsoft.com/en-us/library/bb896339(v=vs.110).a...
Re:Show HN: LINQ for Go by MichaelGG on Saturday January 04, 2014 @06:57PM (#7013628)
Yes, I know Microsoft put "LINQ" over the entire thing, but calling map, filter, fold etc. "LINQ" seems to be a huge stretch. Method-based query options were around in .NET and C# before the LINQ name existed.

It's not really "Language INtegrated" if there's no real language aspect, is it?