Hopefully F# will become even more mainstream than it is right now.
Hopefully F# will become even more mainstream than it is right now.
There's some inertia there simply because I keep thinking that the next person will hate me for forcing F# on them, but it's almost a siren call at this point... I might have to just pull the trigger and commit a .fs file.
Go for it! Wiring up a new F# project is quite simple:
dotnet new library -lang F# -o FSLib
cd CSharpASPNETApp
dotnet add reference ../FSLib/FSLib.fsproj
There are some templates in the .NET Core SDK for ASP.NET as well, so if folks are wondering if it's possible to use F# with ASP.NET Core, the answer is yes! There's even support for async controller actions using F# async expressions, so there's no need to do some of the more awkward interop between Async and Task.Look at it from this perspective: you might be able to hire the next person because you put some proper tools/stack for them to work with. :)
Impossible. F# (a.k.a. OCaml.NET) is --like OCaml-- a general purpose language. It's on Wikipedia so must be true :)
That means it has full access to the Base Class Library and cross language interop. It's as "general purpose" as C#, but wildly better for most "general" development by a) having builtin scripting support, b) being multi-paradigm, and c) having an interactive REPL-based development cycle.
There are certain kinds of OOP constructs that will always make more sense in a pure OOP language... For the other 99.95% of development being able to drop all the cruft and simplify your tasks, simplify your namespaces, and simplify your apps is a beautiful thing. Even while learning: at anypoint an imperative, OOP, or mutable solution makes sense you can just do it. You won't want to, but you can: easily.
F# feels as free and intuitive as Python in the small, while providing structural & type-based guarantees (and productivity!), that far outstrip C#/Java in the large.
[Arguably F# is also the first "mature" .net language in that it had the benefit of language design after most of the CLR was done... It's much more comfortable for dynamic generation/loading of AppDomains and such.]
Functional-style languages seem to have difficulty becoming mainstream.