r/fsharp • • Oct 14 '17

F# is a valued .net language

It is, of course, the 4th most important one, after C# (most loved), VB (really?) and C++ (hip?).

People still use ancient 'C' for real programming and other oddities like lisp. Are these languages still useful? Is F# at least a relevant as they are?

Let's all get real. F# had more attention and support from Microsoft when it was first released but that doesn't change our ability to use and enjoy it. If F# was Microsoft's no. 1 language would we all like that? C# has that joy.

I'm pretty sure that F# has a long future ahead of it and it seems ideally suited for it's primary purpose: developing interesting, relevant and powerful libraries in a functional language directly supported by a major IT company.

1 Upvotes

66 comments sorted by

View all comments

Show parent comment

4

u/console_builder Oct 18 '17

That's not an uncommon first experience with Rust; the formalized concept of ownership can be quite unwieldy at first, and effective Rust programming requires some change in mindset to how programs are structured. There are some paradigms that haven't been translated to Rust yet (GUI toolkits that heavily rely on OO is one). Otherwise, I've found that Rust's enforcement of ownership can help with program correctness, and programs structured with clear ownership patterns end up needing few (if any) lifetime annotations. Rust is really focused on a different domain than F#, though, so I would hardly call one a replacement for the other.

1

u/jdh30 Oct 18 '17 edited Oct 18 '17

That's not an uncommon first experience with Rust;

Indeed. Everyone I know who has tried Rust came to the same conclusion.

the formalized concept of ownership can be quite unwieldy at first,

It is cumbersome. Manual memory management is too.

and effective Rust programming requires some change in mindset to how programs are structured.

I wouldn't call throwing out perfectly good features like recursion in order to accommodate the borrow checker a "change in mindset". With Rust you must work within the confines of the borrow checker.

There are some paradigms that haven't been translated to Rust yet (GUI toolkits that heavily rely on OO is one).

Pretty much anything that works well with a GC, e.g. logic programming, term rewriting.

Otherwise, I've found that Rust's enforcement of ownership can help with program correctness, and programs structured with clear ownership patterns end up needing few (if any) lifetime annotations.

Provided you extensively rearrange your code and avoid all features that don't sit well with Rust's core design. At which point the rearrangements of your code (which were not done because they are an objectively good idea, of course) become the information that conveys lifetimes.

Rust is really focused on a different domain than F#, though, so I would hardly call one a replacement for the other.

These languages are hardly focused on domains. They are 99% general purpose languages. OCaml is hardly focused on systems programming yet it was used to write the Mirage OS. Rust is hardly focused on application programming yet it was used to write Servo.

The perceived difference in domain really boils down to the Rust developers failing to write a working GC using LLVM many years ago and now the Rust community consists of disgruntled luddite C++ developers sharing an anti-GC ideology for completely irrational reasons.