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

I wonder how these "optics" compare to .NET's Language Integrated Queries (LINQ) (see https://en.wikipedia.org/wiki/Language_Integrated_Query )



You are onto something, since LINQ was developed by Erik Meijer, one of the authors of the paper linked in the childcomment of the siblingcomment.


LINQ is definitely a precursor, and has tons of fantastic ideas. It's unfortunate that Microsoft didn't continue to invest heavily into this as it's rarely mentioned nowadays.


I'm not sure I'd call LINQ a precursor when LINQ itself was based on haskell's monadic list comprehensions.

monadic list comprehensions aren't quite the same thing as optics, however.


List comprehensions aren't quite the same thing; they are declarative but they describe an iterative method of creating lists through maps and filters, whereas optics are semantically oriented around traversals and projections.


The nice thing about comprehensions is that, depending upon how one looks at them, they can be declaratively defined yet iteratively implemented.


isn't that what I said?


Wikipedia claims there are LINQ implementations for Javascript/Typescript and for PHP (in addition to C#, of course).


These are really just simplified versions, though.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: