r/dotnet • u/[deleted] • Dec 05 '20
Fable 3.0 released
https://fable.io/blog/Announcing-Nagareyama-4.html1
1
u/fragglerock Dec 05 '20
Use case is being the 'f' in SAFE... a thinger that lets you make websites in F# if you fancy doing that for some reason.
https://www.compositional-it.com/news-blog/introducing-the-safe-stack/
1
u/chocolatecitytech Dec 05 '20
For a web dev is there a compelling reason to switch to f# given how easy and powerful c# already is? I haven't touched f# yet and part of my reasoning is that
C# does everything I want.
If I wanted all an all out functional why not go with elixir or some "more" functional language. Besides as someone already said c# is already going the way of f#.
I like playing with different languages but I really want to understand "the why f#" for specifically a web developer. My desktop programming days are behind me so am only thinking about web.
3
u/fragglerock Dec 05 '20
Genuinely no idea...
I was thinking I should learn f# to broaden my horizons and the SAFE thing turned up as a way to produce a thing more than 'hello world'.
People seem to love F# but I find it incomprehensible and off putting so I have not got very far using it.
2
u/Alikont Dec 05 '20 edited Dec 05 '20
F# has a lot of nice small things, but overall C# is catching up.
Things I miss in C# compared to F#:
Union types. It's a nice way to represent mutually exclusive states or messages. C# just don't have the same abstraction. Example.
Terse syntax for function combination. This allows basically build readable DSLs on F# alone. Example JSON parser. FParsec is probably the best use-case for F# in .net world.
F# naturally works with React, because React is functional by design. It makes F# probably the best front-end tool right now. It has nice functional compiler to JS, the payload is small and fast (it's basically the same as typical React app), and strict type system is good. But it's competition between F#, TypeScript, JS and Elm, not between F# and C#.
Computational expressions allow you to build almost a custom language. Look here.
But overall F# suffers from the fact that C# is a very good language. Here is a nice article about it.
1
u/chocolatecitytech Dec 05 '20
Some good points. Yeah, I want to try it but I really wanted a good reason. It's tough because I do js/typescript daily. I can get up and running with a new react/nextjs/angular app in no time with c# on the backend.
If I wanted one language for backend and frontend there's blazor with c# and of course some [insert nodejs framework]
I guess I just don't have enough of a compelling reason to make f# my home.
12
u/Dr-Collossus Dec 05 '20
What is it? I read the “What is Fable” section of the docs but I still don’t quite get it. Is it analogous to TypeScript, in that you write code in F# and it gets transpiled to JavaScript?