On Monday, 16 March 2015 at 12:18:42 UTC, Ellery Newcomer wrote:
On Sunday, 15 March 2015 at 14:58:54 UTC, Idan Arye wrote:
Even if we can't get the lambdas as syntax tress, the fact
that we can send whatever types we want to the delegates and
overload operators and stuff means we can still convert the
lambdas into SQL.
There are limitations on operator overloading that make it much
less likely you can use the exact same lambdas for collections
and sql. Bad for testability.
At any rate, I really don't like what C# did with LINQ-to-SQL.
The whole special-syntax to functional-style to syntax-tree to
SQL is too overcomplicated - a simply lisp-style macro
system(like what they have in Scala or Rust) could have done
the trick in a simpler and faster way.
overcomplicated? probably - it's microsoft. And any time I have
to manipulate the ASTs I find myself wishing for a language
with pattern matching. I wonder if F# offers anything in that
regards..
I don't think the problem is the lack of pattern matching. I
think the problem is that by forcing the query syntax into lambda
expression syntax, you obfuscate the syntax tree without really
gaining any value.