News for hackers. Stuff that matters.
Re:Astonishing Performance of .NET 5 by goto11 on Thursday November 12, 2020 @09:18AM (#25070072)
API's are the same for F# and C#, so it should be trivial to translate the code examples from C# into F#. Just remove the curly braces and change "var" into "let".
Re:Astonishing Performance of .NET 5 by oaiey on Thursday November 12, 2020 @10:00AM (#25070567)
F# deserves more love in their communication. Definitely. F# appeals to many, however, from a product management perspective (aka MS perspective) there is a ratio of 100 C# dev to 1 F# devs (MS showed statistics once on it).

Also, F# is community owned to my understanding (up to the statement of a MS Research Employee and F# inventor Don Syme to say that the "Microsoft." prefix on ASP.NET Core are not open source community friendly) while C# is 100% design & developed by MS.

Which - IMHO - makes it very delicate for Microsoft to communicate well here.

Re:Astonishing Performance of .NET 5 by pjmlp on Thursday November 12, 2020 @11:00AM (#25071203)
They also have a few high profile personalities that are pretty much into the "us vs them" towards C# developers and Microsoft, which turns off many enterprise developers to even bother with F#.
Re:Astonishing Performance of .NET 5 by mdpm on Thursday November 12, 2020 @11:34AM (#25071564)
This would remove the benefit of functional idioms, and mitigate any advantages the differing approaches have. F# and C# and not just syntactically different.
Re:Astonishing Performance of .NET 5 by goto11 on Thursday November 12, 2020 @01:02PM (#25072641)
True, but the code examples in the BCL documentation is to show how to use the API, not to teach the languages. See something like F# for Fun and Profit https://fsharpforfunandprofit.com/ to learn to write idiomatic F#.

More F# documentation and support from MS would be great, but IMHO F# examples in the BCL documentation would not be the best use of resources.

Re:Astonishing Performance of .NET 5 by rishav_sharan on Thursday November 12, 2020 @09:54AM (#25070480)
two problems here;

1. For a new comer to the language, this is still too much of a hurdle. 2. If I wanted to use F# only as a proxy for C#, then I would rather use C#. I want to write F# code in a functional first and idiomatic way.

This is the stock answer I have gotten in the .Net Community and as someone who wants to use F# for web apps, its a huge turn off. There are pretty much no tutorials, no recent articles and no performant native F# libraries out there. There is no push from MS to improve the situation. and the community is like - This is fine!

Expecting a new user to write c# code with "let" isn't going to fix that.

Re:Astonishing Performance of .NET 5 by piaste on Thursday November 12, 2020 @10:44AM (#25071034)
> There are pretty much no tutorials, no recent articles and no performant native F# libraries out there.

Giraffe [1] is the de facto standard F# web framework. It's a plugin on top of ASP.NET (for all the reasons described elsewhere - performance, security, ecosystem) that lets you write functional-style 'route >=> function' code without controllers.

If you want a more batteries-included approach, Saturn [2] builds on top of Giraffe to provide, well, more backend batteries (database layer, etc.)

Finally, the SAFE stack [3] are a set of project templates that combine the above with a F# frontend (via the Fable JS compiler) and some Azure deployment helpers.

[1] https://giraffe.wiki/docs

[2] https://saturnframework.org

[3] https://safe-stack.github.io/