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

How does it give you more compile time type checking than C# with Linq?


Because IQueryable's don't always translate to working SQL. I've broken EF's IQueryable a few times in the past; NHibernate's one was really bad if I recall. The expression inside the IQueryable operator is checked for type safety but the ability to generate SQL from it isn't which happens at runtime when the LINQ is evaluated. The F# approach bypasses the expression -> SQL translation and directly checks the SQL at compile time if it valid against a database schema rather than the expression AST that C# LINQ does.


True, the old "let me extract this functionality into a method and called it from Linq" - and that's when the fun begins.....




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: