Hacker News new | ask | show | jobs
by ConnorLeet 3414 days ago
Array.reduce(), Array.filter(), Array.map(), in JavaScript are pretty LINQ-ish if you ask me!
2 comments

The thing with LINQ is that it can represent itself (reified or 'quoted code), so you can transform it into SQL, GPU instructions, whatever. This isn't a new idea, and F# had it before C# did (and LISP had it before, and others).

map/filter/reduce are just basic functional programming elements.

They are nothing even remotely likely linq. Those functions return the resulting arrays. Linq expressions are not executed until enumerated.

This allows you to compose linq expressions without computing intermediate results.

Sounds like Java 8 Streams, then.

Streams bear a pretty strong resemblance to translated LINQ.