2 ms·
Workflows. Tuples. Immutable types. Inline functions. First-class functions. Definable operators. Pattern matching. Active patterns. Type providers (although fu
by MichaelGG 13y ago
Workflows. Tuples. Immutable types. Inline functions. First-class functions. Definable operators. Pattern matching. Active patterns. Type providers (although full hygienic macros would be even better). Everything-as-an-expression. Lack of nulls. Nested functions. Discriminated unions. Quotations (expression trees are a weak hack just for LINQ-to-SQL). Object expressions. Concise function definition and application syntax (which naturally creates the illusion called partial application).
I make the inverse argument: At a minimum, you can use F# as C# but with better syntax. So what does C# buy you, if you're not using some of the VS designers?
- runT1ME 13y agoGood comment. Didn't realize F# let you have inline functions, everything as an expression and partial application. Forgot about pattern matching too! I don't really see a need for workflows, I can do everything I need to use workflows for with custom LINQ. I'll reconsider pushing F# for some of the c# work I do. However, if someone isn't bound to the CLR, i'll ask what F# gives you over Scala :-)
- MichaelGG 13y agoWithout workflows, you can't achieve e.g. async without building it into the compiler. You can abuse the LINQ syntax to simulate part of it, but you don't get proper exception handling, and it reads terrible as well. Versus Scala, F# seems far more concise. Scala seems to be very Java/OO oriented, and comparatively verbose. I understand the type system is more advanced in Scala. But I've not written anything in Scala so this is sorta speculation. I'd be surprised to find that the tooling for Scala surpasses F#'s though.