
F# end to end - gebe
http://colinbul.wordpress.com/2013/02/23/f-end-to-end/
======
MichaelGG
F# is fantastic, and the team behind it is super solid, having delivered
generics for the CLR.

What this post leaves out is some of the tooling you lose when you move to F#.
For what I assume are political reasons, F# keeps being marketed as a niche
"scientific" product, when in reality, pretty much any C# code is better off
being written in F#, even if you aren't writing idiomatic F#. I did one small
test where I rewrote a C# program in non-idiomatic F#, and it required 1/20th
the type annotations. C#'s just verbose - why use it?

Even WebSharper requires a "C# web site" to actually get Visual Studio to kick
up IIS and make things run. There's no real C# code, but so much in the
.NET/VS environment assumes C# (or VB).

In fact the worst times I've had with F# were due to other libraries depending
on how the C# compiler is implemented, and failing when reflection/expression
trees didn't look exactly the same. Fortunately the major use case (LINQ)
seems to have been addressed quite solidly with F# 3.0.

~~~
kevingadd
Doesn't F# still perform worse than C# in various scenarios? IIRC the
functional glue adds some overhead and F# uses classes instead of structs in
some cases.

~~~
MichaelGG
I have not found that to be the case. Yes, sometimes certain idiomatic things
in F# might be slower, but in that case, just write them like you would in C#
and you'll get the same performance. So, at worst, you end up with the same
code, with more concise syntax.

There are a few exceptions, but in general, F# can emit anything C# can.

In fact, with F#'s "inline" ability, you have more flexibility than you do in
C# - the CLR does vastly better when handed a big IL function, versus
expecting it to get inlining right. The F# compiler does more advanced
optimizations, too.

------
sbrother
This is really exciting. I do about 50% of my commercial development work in
VB .NET (the other 50% in Python), and I hate hate HATE working in VB.
Convincing the suits to go with Python would be near impossible -- too many
processes rely on .NET -- but this seems like it could a be a great
compromise. Sane, fast, modern language but with the full power of .NET
libraries.

Can anyone recommend a good resource for learning F# for the .NET developer? I
don't need an intro to functional programming (I have a pretty functional
style in python and I've messed around with Haskell) but just a well paced
intro to the syntax and standard library.

~~~
noblethrasher
What do you hate about VB?

I'm a C# dev that thinks in terms of F#/ML but I've long recognized that VB is
actually a more expressive language than C#, especially if you want to write
OOP in a functional style. For instance, VB has better IDE support for
expressing sum types, doesn't require type annotations for lambada
expressions, and has more Linq (query comprehension) operators.

Edit: I'm wrong about the "better support for sum types", I was thinking of
Completion List feature but it doesn't quite give you a proper sum type
(though it comes close).

~~~
jimmaswell
VB.NET also doesn't allow #region's in method bodies, and can't use unsafe
code.

I've found C# to feel more concise, clean, and have less annoying hard to
predict syntax. If .. End If, While .. End While, but For .. Next? I'd expect
End For. The attempt to make it look more like words just made it more
annoying to me. VB.NET's syntax feels too verbose. C#'s feels more like a good
spot where it's very similar to C++ and Java, but not alien.

~~~
mercurial
In my experience, if you use #region in the body of a function, it is a sign
it needs refactoring.

------
ditoa
F# is a very interesting language and one of the best things to come from
Microsoft in a long time.

It could be a very very good thing for MS in the next decade if they invest in
it properly (which they seem to be doing).

Interesting times.

------
dzderic
Does anyone have any experience with F# (and Mono in general) under Linux?
How's the library support?

It seems like it should be a good fit for the stuff we normally do (log
processing/munging), but I don't know how well it'll work outside of Windows.

~~~
raphaelj
I've used F# for some little .NET school projects using Mono.

It's quite well supported as everything related to F# developed by Microsoft
is open-sourced (compiler, libraries, PowerPack).

Moreover Mono fully supports F#, as the compiler is sometimes bundled in some
releases.

Also, F# is really a pretty sweet language (as for an heavy Haskell user with
a little C# background). French love inside.

~~~
mjt0229
I have been hoping to pick up some F# with Mono, but I'm having a hard time
getting started - not with the language itself, but with the development
environment. For instance, MonoDevelop seems very flakey on the Mac. I'd love
to try out FsharpX, but I can't find instructions for how to build or install
it on Mono.

Can you make any suggestions as to places to read up on this stuff? The
language seems so well put together!

~~~
rjzzleep
well, personally i use monodevelop(xamarinstudio) 4.0 and mono 3.0.3 in
archlinux.

you need a fork of the fsharpbindings project
<https://github.com/xamarin/fsharpbinding>

have you tried using fsharpx from nuget? monodevelop has nuget support as of
now. [https://github.com/squidge/monodevelop-nuget-
addin/tree/xs-n...](https://github.com/squidge/monodevelop-nuget-
addin/tree/xs-nuget-addin)

I also just built fsharpx.core and fsharpx.http with monodevelop(right now)
and it built fine for me.

~~~
mjt0229
MonoDevelop 4? I'm using 3.0.3, which seems to be what their website
advertises as the latest version. Maybe I'm missing it. Should I be building
from source?

~~~
rjzzleep
up to you really they released 4.0

<http://monodevelop.com/Download>

it looks a little prettier, but besides that nothing has really caught my
attention. it also seems to throw exceptions more frequently(throwing
exceptions, not crashing)

------
icey
There's a lot to love about F# (type providers are especially sweet, for
example). I'd like use it more, but the challenge seems to be more about
getting C# devs to embrace functional development. Which I suppose is the
challenge of functional languages everywhere...

------
rjzzleep
the way my coworker put it, if ml and python had a baby, and microsoft stole
that baby, that would be f#.

i don't like websharper. what is wrong with people wanting to write their
clientside in f#? anyway that's why i was looking at how the iis stack works,
so i can write my own framework.

there is an - in my opinion - pretty nice f# mvc template (not that i'm a big
fan of mvc) available here:
[http://visualstudiogallery.msdn.microsoft.com/3d2bf938-fc9e-...](http://visualstudiogallery.msdn.microsoft.com/3d2bf938-fc9e-403c-90b3-8de27dc23095)

it's also ironic that when Donna Malayeri talks about F# the first thing she
talks about is how verbose c# is compared to f#
[http://channel9.msdn.com/Blogs/Charles/C9-Lectures-Donna-
Mal...](http://channel9.msdn.com/Blogs/Charles/C9-Lectures-Donna-
Malayeri-F-30-Information-Rich-Programming-1-of-1)

~~~
toyvo
So how do you want to write your client-side? Does not using one language for
both the server and client make sense to you?

------
tkellogg
My favorite part - they use type providers to work with xaml code. They're
moving IDE features closer to the compiler.

------
east2west
I have been eying F# for bioinformatics work for a year, but a dearth of
bioinformatics library, difficulty linking existing libraries, and flaky tools
on Linus have held me back. Right now I am stuck with Python and R, which are
good languages with plenty of good libraries, but I want to branch out into
functional languages. It also does not help that I don't know C# and am
disinclined to learn it.

------
gtani
I was thinking of ordering the Expert F# 3.0 book, when i saw this (writer of
this review was the Tech Reviewer for the Expert 2.0 version of the book)

[http://www.amazon.com/review/R3VEMJVVPFSUNF/ref=cm_cr_pr_per...](http://www.amazon.com/review/R3VEMJVVPFSUNF/ref=cm_cr_pr_perm?ie=UTF8&ASIN=1430246502&linkCode=&nodeID=&tag=)

~~~
thomasz
Hum. That rant goes against F# itself, not against the book, notably the less
than stellar support for GUIs. The book itself is fine, albeit a little bit
expensive. The criticism of this review, as well as the optimism expressed by
the blog post both miss the wood for the trees: F# will _never_ outshine c# or
VB.net in areas where tooling matters more than the language itself. It is
tremendously useful for developing libraries and services to be glued together
by c#.

------
opminion
It's like building Python projects with SCons.

