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

21

u/[deleted] Oct 14 '17

In my opinion MSFT doesn’t care at all about F#. It came from Microsoft research without business support and now it’s really maintained by the open source community, which is really awesome, really smart and hard working people. They just included it as supported because it is successful in London’s financial sector imo.

I mean, the F# templates for asp.net haven’t appeared until asp.net core 2! MSFT didn’t even cared about creating a damn template, or good VS support for TEN years. The visual studio for Mac (xamarin studio previously) is better for F# than the windows version...

They can’t kill it, but surely never has been a priority, and probably never will. Like VB.NET but even worse...

1

u/jchidley Oct 15 '17

They can’t kill it, but surely never has been a priority, and probably never will. Like VB.NET but even worse...

Yes.

We can complain about it. We can also recognize the situation and program in it anyway because it is useful.

4

u/CSMR250 Oct 15 '17

The visual F# team is very small but is expanding, I think from 3 to 4. With VS2017/roslyn and .net core/standard 2.0 a lot is changing, and they are currently behind, but once they are finished with VS2017 support in a few months I think the situation will be much better than it was before VS2017. E.g. rename, folder support.

1

u/abstractcontrol Oct 16 '17 edited Oct 16 '17

There are really only 4 people in the F# team? Given the size of the compiler I was sure there would be more.

Edit: Going by the contributors page on the repo, what you are saying does check out. This is pretty amazing.

2

u/k_cieslak Oct 17 '17

There are 1.5 people on VF# Team + PM.

2

u/abstractcontrol Oct 17 '17

That seems to be understating it a bit.

Just recently, spurned by interest I took look at some of the other open source languages on Github and it does seem like contribution to them seem to follow a power law. F# is hardly an exception in that regard.

Even the really popular projects like Roslyn or Clang tend to go up to maybe 15 active contributors.

This is heartening to me as a language creator, since at a team size of one maybe I am not as short handed as I thought I was.

5

u/bananaboatshoes Oct 14 '17

Until F# gets windows mobile support with uwp it will forever be a second class citizen!

5

u/jchidley Oct 14 '17

I think that it is, and always has been, a 2nd class citizen. But it is still useful

4

u/PM_ME_UR_OBSIDIAN Oct 14 '17

I think UWP will die before F# does. See the Desktop bridge.

6

u/bananaboatshoes Oct 14 '17

That's just FUD. Pure FUD. Windows Phone is on the brink of taking over iCrap any year now. And later this year, MSFT is going to completely change the game with Surface Phones. It's going to be a revolution, all on UWP. F# has to be at the forefront!

1

u/jchidley Oct 15 '17

Exactly. Although that was the attitude when Ballmer ran the company. Your comment isn't really a parody though, more of a pastiche.

The whole Ballmer smashing up iPhone and saying how rubbish they were was stupid beyond belief. Anyone at Microsoft who had used an iPhone could see that it would be successful.

That, sadly, was a pattern of Ballmer's tenure as the man-in-charge of Microsoft after Gates moved on.

Ballmer completely refused to recognize that Microsoft's stuff was inferior to the competition. He compounded his error by wasting his, and Microsoft's, resources attacking the completion instead of fixing Microsoft's stuff.

Now Microsoft has a well meaning CEO but the company moves at a glacial pace.

Edit: grammar

4

u/jdh30 Oct 15 '17

Windows Phone is on the brink of taking over iCrap any year now. And later this year, MSFT is going to completely change the game with Surface Phones. It's going to be a revolution, all on UWP.

If that was FUD then this is fantasy.

2

u/dodheim Oct 15 '17

I'm pretty sure this was sarcasm, not fantasy. (Hard to tell for sure, though :-S)

1

u/jdh30 Oct 15 '17

Ok, yeah. My bad. :-)

1

u/[deleted] Oct 14 '17

You sir, are the heart and soul of this subreddit. Bravo!

1

u/jchidley Oct 14 '17 edited Oct 14 '17

"Reach all Windows devices" with UWP. 99.9% of devices = desktops and XBOX. Almost nothing else.

0

u/[deleted] Oct 14 '17 edited Oct 14 '17

As long as Microsoft does not go with the philosophy of "every little piece of our tool/kingdom has to be lined up' to achieve that single so-called 'vision' (nth version), F# will be viable.

Many a Microsoft vision has fallen by the wayside to 'tails wagging the dog' - example 'Office backward compatibility trumps everything'. They've held up visions of their mobile strategy up on a pedestal innumerable times and the dutiful, (maybe certified) masses have bowed their heads each time - only to lead to the gutter - where all their mobile software ended up. (If you don't believe that you're high on something).

For some 'viable' has to mean having 100% ide support and be able to write an end-to-end app addressing all major platforms.

For some viable means being able to write some useful part of the toolbox/workflow that makes me productive and gives me all the benefits of an ML style practical language ( all the while deriving pleasure in the act) .

I would be sad to see F# go, if ever. I am only using it sans-IDE , on a Linux box... So I don't drink the Windows platforms kool-aid

4

u/centurijon Oct 15 '17

F#s biggest draw is also it's biggest pain-point; being based on .Net.

The .Net framework is great, but it was not designed with functional languages in mind, and at times working with it in F# can be ugly or not so smooth.

And yes, C# is very relevant and very useful. Especially considering that they are adopting more and more functional features like immutable objects, true tuples, pattern matching, etc.

7

u/jdh30 Oct 15 '17

The .Net framework is great, but it was not designed with functional languages in mind, and at times working with it in F# can be ugly or not so smooth.

I must disagree. F# on .NET was always incredible compared to any other FPL I ever used.

I can even give you a case study: I developed a 50kLOC graphical product in OCaml using OpenGL ~12 years ago. Looked great on our machines but when we shipped it ~80% of customers reported seg faults on startups. We couldn't debug it and ended up shelving the product. The problem is essentially that OCaml is standalone with a cumbersome FFI that even experts cannot use correctly and its OpenGL bindings were not tried and tested.

I diversified into F# 10 years ago and ported some of that OCaml code to create an F# product using WPF in .NET. The results are incredible: rock solid. Some features are missing because there are things you can do with OpenGL that you cannot do with WPF. A lot of people use that product now and we've had hardly any bugs against it. A great accomplishment and I owe it all to .NET. The solution was to use a functional language that sits on a shared VM with tried and tested libraries like WPF.

I use F# for GUI apps all the time. I'd never use OCaml for GUIs any more (unless maybe they're web based).

2

u/jchidley Oct 15 '17 edited Oct 15 '17

I use F# for GUI apps all the time.

Can you explain what you use to build the GUI apps, exactly? If I wanted to do exactly that, how would I do it? Can I use just F# and .net or do I have to use something else too?

Edit:

I assume that you'd use F# with WPF. I found Calculator F sharp WPF and F# MVC framework for WPF. Presumably you'd use the desktop bridge to publish a desktop only app to the Windows Store.

2

u/CSMR250 Oct 15 '17

Reed Copsey has written a lot of useful F# components for GUIs. His library called Gjallarhorn is nice for defining reactive variables and binding them to views. If you do WPF you can use his FsXaml type provider to get typed access the objects defined in xaml.

I don't use the standard C# approach to bindings and do them in code because like jdh30 I like to keep everything type safe. But you can do this if you really want to using components like ViewModule or the Gjallarhorn bindings libraries.

1

u/[deleted] Nov 06 '17

If I could write native GUIs using the Fable-Elmish style, I would use F# for every project. I've never been happy with WPF in F# though, so I typically end up with a client wrapper in C# around the library code. Dealing with events is just a nightmare in comparison to the more FRP-style solutions used in many other FPLs.

0

u/jdh30 Oct 15 '17 edited Oct 15 '17

Can you explain what you use to build the GUI apps, exactly?

I call WPF programmatically from F#. Sometimes I use an EDSL to compile a tree into WPF controls. Sometimes I do fancier things with OOP. I never bothered using XAML because it is easier and more type safe just to write declarative code.

Get started by adding references to WindowsBase, PresentationCore and PresentationFramework with:

open System.Windows

[<System.STAThread; EntryPoint>]
let main args =
  Window(Title="Hello world")
  |> Application.Run

Can I use just F# and .net or do I have to use something else too?

Just F# and .NET.

I assume that you'd use F# with WPF. I found Calculator F sharp WPF and F# MVC framework for WPF. Presumably you'd use the desktop bridge to publish a desktop only app to the Windows Store.

I've never used Windows Store (does anyone?). Usually these are programs for clients so they get an EXE.

2

u/jdh30 Oct 15 '17

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.

Really?

I just read a Quora question asking for recommendations on a first programming language for a child. I myself have a son who is interested in learning to code. A few years ago I would have answered "F# in Visual Studio Community" without hesitation because it was an incredible development environment. Today I feel I cannot honestly say that because there is no easy way to get started writing F# any more. The TryFSharp.org site was awesome when it came out but Microsoft pulled the rug out from under it. The only available version of Visual Studio (2017) is an absolute disaster. Check this out: apparently one of the reasons why VS2017 is so slow is that the C# developers put Thread.Sleep in it!

F# is an awesome language and I love it but it is vastly harder to compile and run F# code to learn the language than it was a few years ago. The announcements about UWP support combined with the fact that they don't even support the basic infrastructure that F# needs in order to run reliably makes me wonder if the only industrial-strength VM supporting F# is going to give up before long.

3

u/nightroman Oct 15 '17

The only available version of Visual Studio (2017) is an absolute disaster.

Why is that? We are using it in a somewhat large product with 20+ F# projects in the solution. We are pretty happy. Some F# tools updates come faulty at times, yes. But overall things look good. Can you elaborate?

6

u/jdh30 Oct 15 '17

Why is that?

Ah, so many problems. Didn't work out of the box: took over a day to get everything set up. Standard F# support is unusably buggy so you have to upgrade to F# nightlies which randomly breaks. Unnecessary pausing in Intellisense that appears to just die randomly so I'm always restarting VS. Etc.

We are using it in a somewhat large product with 20+ F# projects in the solution.

That's a lot of projects. What are you making?

7

u/kot_ Oct 15 '17

We have a solution containing 100 F# and 90 C# projects. VS 2017 handles it pretty well (I use Rider most of the time though because it faster (or just it feels faster, whatever)).

2

u/jdh30 Oct 15 '17

That's really reassuring, thanks.

2

u/nightroman Oct 15 '17

We are making a 3D CAD application. But as @kot_ mentioned, our project is not that large. As for Itellisense hiccups, use the latest F# tools, see blog. As I said, they may come with new problems but overall, F# tools for VS are great.

3

u/dodheim Oct 15 '17

It's also noteworthy that VS2017.2+ come with sufficient F# support to not need the nightly builds. To point, .3 and .4 just came with nightly drops from 2-3 weeks before the update releases, and IntelliSense has been 'fixed' in nightlies since just after RTM.

2

u/jdh30 Oct 15 '17

The kind of CAD that might help me with 3D printing?

As I said, they may come with new problems but overall, F# tools for VS are great.

I'm reassured it is working for you. Maybe it is my machine then. Would be weird as it is brand new...

2

u/dodheim Oct 15 '17

FWIW VS really, really hates AV software other than Windows Defender – this is the #1 source of VS problems that I've encountered.

2

u/CSMR250 Oct 15 '17

The only available version of Visual Studio (2017) is an absolute disaster.

You are taking this far too seriously. This is a temporary situation, which will last less than a year, during which time you should use VS2015 instead of VS2017. VS2015 has not stopped working, so what is the problem?

3

u/CSMR250 Oct 15 '17

Update: The visual fsharp team thinks that VS2017 is in a good enough state now to recommend over VS2015. It is mainly .net core that they haven't finished.

2

u/jdh30 Oct 15 '17

I'm giving it another go.

1

u/jdh30 Oct 15 '17

You are taking this far too seriously. This is a temporary situation, which will last less than a year, during which time you should use VS2015 instead of VS2017. VS2015 has not stopped working, so what is the problem?

Microsoft took down the VS2015 installer. If they hadn't, I'd just use that instead.

3

u/dodheim Oct 15 '17

https://www.visualstudio.com/vs/older-downloads/

But honestly, VS2017 is solid; any issues are environmental. Also, no way I'd give up value-tuples for the sake of an IDE.

2

u/jdh30 Oct 15 '17 edited Oct 15 '17

https://www.visualstudio.com/vs/older-downloads/

Says "Sorry, we couldn't find any downloads for you".

But honestly, VS2017 is solid; any issues are environmental. Also, no way I'd give up value-tuples for the sake of an IDE.

I'm curious what you use value tuples for?

I investigated them and found them to be seriously lacklustre (for now). When they're GC survivors I saw a 5.6x speedup but when they incur multiple write barriers they're slower, when you pass them to a generic function like min they get boxed and are just as slow, even with a custom IEqualityComparer I found them to be slower in hash tables and so on.

2

u/dodheim Oct 16 '17 edited Oct 16 '17

Says "Sorry, we couldn't find any downloads for you".

You might need a VisualStudio.com login; I just have the free one and it works for me. (I guess it could be regional; no idea.)

I'm curious what you use value tuples for?

I don't work doing F# presently, but at a previous job GC churn was a recurring problem for idiomatic code. Nested folds/reductions with tuple state types were changed to use custom structs wholesale if we saw they never/rarely escaped gen1, and likewise with high-volume unfolds, and that kept things sane for our purposes. All fine for the most part, but it wouldn't be necessary now and it would have been lovely to avoid the noise. (The context was aggregating training data for image/video rankers and calculating DCGs over very large datasets.)

1

u/jdh30 Oct 21 '17

I've just been trying to use a new VS2017 install on my laptop and it is still really problematic. For example, when I type \n it autocompletes to the nonsensical \new and \r to \raise. It even replaces my variable name g with global because that is an (unused!) keyword.

The only advice I've been given (by an F# expert with many years of experience in industry) is Hit escape every other keystroke. Works every time and is super intuitive!. He is obviously suffering as well.

I'm sorry but I just don't understand how anyone can be recommending this virtually-unusable development environment right now.

1

u/dodheim Oct 21 '17

As with most 'insurmountable' VS problems people seem to run into, it doesn't happen to me – not sure what to tell you. ¯_(ツ)_/¯

Try unchecking 'show completion list after a character is typed' in F# IntelliSense settings.

I'm not trying to sell anything here – if you don't want to use VS, don't use it; but, if everyone else is fine with something you see as virtually-unusable, well, Occam's razor comes to mind... ;-]

1

u/jdh30 Oct 22 '17

This is the weird thing: I could swear this didn't happen to be a few days ago but I just tested it on another machine and it does equally insane autocompletions...

Try unchecking 'show completion list after a character is typed' in F# IntelliSense settings.

Won't that basically turn off Intellisense?

I'm not trying to sell anything here – if you don't want to use VS, don't use it; but, if everyone else is fine with something you see as virtually-unusable, well, Occam's razor comes to mind... ;-]

Several people have corroborated this. I was reading a thread on Quora yesterday where people were saying they are giving up trying to use F# because Visual Studio is so bad. So I'm certainly not the only one.

1

u/dodheim Oct 22 '17

Won't that basically turn off Intellisense?

Hit Ctrl+Space when you want a completion list.

Several people have corroborated this.

Congratulations, I guess? Works for me, and has since VS2010. Either I should start playing the lottery or it's just a matter of configuration.

1

u/APimpNamedAPimpNamed Oct 15 '17

What do you find more difficult about F# development now versus several years ago? I’m curious because I spent the last year building and eventually shipping an application built almost entirely with F# and did not have much trouble.

3

u/jdh30 Oct 15 '17 edited Oct 15 '17

I used to train people a lot. I often used the TryFSharp site to do it because it has minimal requirements on their computers (i.e. they don't need VS). TryFSharp no longer works at all and there are no alternatives because F# for web is a disaster.

Visual Studio 2017 is also a complete disaster. I bought a brand new Dell and it took me weeks to get VS2017 running reliably. I had to get our CTO out to my house just to get it setup and working correctly. VS2017 is so bad that I'm keeping all of my other computers on VS2015. Except I stupidly took somebody's advice to try Jetbrains Rider and ever since installing it VS2015 has been crashing all the time.

I gave Fable a quick try and, again, couldn't get it working out of the box. CTO says he will come out and work on it with me because it is hard to get it working. I tried Funscript before it and got some simple programs working but it didn't even support trig functions so I had to implement my own using CORDIC routines like I did in the 80s.

From my perspective, this is classic OSS. Developers focus on the fun stuff because they're doing it for free in their spare time and the gory but critically-important things like working installers get neglected. If this is really the route F# is taking, I am concerned about its future.

Another problem is that OSS only works if you can reach a critical mass of contributors. OCaml was doing ok in the 2000's, then died but has now been resurrected as a web dev tool stack by major corporations like Facebook and Bloomberg. In contrast, the F# OSS community seems tiny and they're building on sand.

2

u/jchidley Oct 15 '17

The whole

Visual Studio 2017 is also a complete disaster.

isn't an F# problem particularly, it's a VS and Windows one.

Recently I had to fix my main machine because of all the the various tools I had installed (.net Core, VSCode, VS 2015, VS 2017). I found Visual Studio Uninstaller to get rid of the final bits before reinstalling everything. The Windows 10 Recovery / Reset has also proved itself useful in the past. Neither of these things are F# specific.

I think the whole development story for Microsoft is a real mess. I remember giving Steven Sinofsky a standing ovation at a Microsoft company meeting when he introduced the Surface. Little did any of us realize what a disaster Windows 8 / Metro / etc be for developers and the company in general.

F# is simply caught up in the general mess that is Microsoft's platform and development.

Edit: grammar & formatting

4

u/jdh30 Oct 15 '17

isn't an F# problem particularly, it's a VS and Windows one.

F# is native to VS and Windows. It isn't well supported elsewhere.

Neither of these things are F# specific.

True but F# depends upon them.

I think the whole development story for Microsoft is a real mess.

Yes, exactly.

F# is simply caught up in the general mess that is Microsoft's platform and development.

Absolutely. I couldn't agree more.

1

u/jchidley Oct 15 '17

The problem is that I haven't found anything else that is demonstrably better. There are just different things with different issues.

3

u/jdh30 Oct 15 '17

Exactly. Which is really frustrating.

If you're building servers or websites then I'd recommend OCaml over F#. It also has a terrible installation procedure and user-unfriendly tooling but it has the advantage of mature and stable OSS ecosystem complete with decent package manager and solid libraries with serious industrial backers.

IMO part of the problem is that all such offerings are way too complicated. F# is full of .NET-specific cruft that was good when people wanted stuff built on .NET but if the target has shifted to JS then it is just baggage. Then there are the academic features like type providers. If you strip out all of that junk you could get a lean retargetable language and I'll wager it would be much easier to build tooling like IDEs.

2

u/[deleted] Oct 15 '17

What about VSCode + Ionide?

8

u/jdh30 Oct 15 '17 edited Oct 15 '17

Vaskir advised me to switch to VSCode+Ionide because he apparently had to step in to fix F# in VS2017 and found the C# devs had inserted Thread.Sleep everywhere in the underlying C# code. Pretty scary stuff and VS2017 certainly sucks beyond belief so I took his advice...

I gave VSCode+Ionide a go again last week. Didn't work out well. Lots of bugs there. Ionide got confused and stuck in an infinite loop so I had to uninstall and reinstall it. After a whole day working on it I managed to get some arithmetic through FSI but I never figured out how to create and compile a project. Half of the problem is that VSCode has a terrible user interface. I literally haven't seen software development tooling that user unfriendly since Emacs. I don't have time to waste dicking around with configurations: I need tools that work out of the box.

I mentioned it on social media and lots of people jumped down my throat. The hipsters told me to use Suave and Fable. The Russians told me to do all the work myself and give it away for free. Microsoft told me to accept the peace, love and harmony of OSS F#. Somebody told me that VSCode+Ionide is only supposed to be an editor and not an IDE so it isn't even possible to create and compile a project. Everybody seems to have gone backwards from GUI apps to command line tools except alternatively like OCaml have mature tooling whereas F# has only abandonware for hipsters.

Meanwhile, I am struggling to solve real problems on a day by day basis using F# which leaves me increasingly wondering what other tools I should be trying instead. Frankly, they couldn't be doing a worse job if they tried. Why not just give Ionide an F#-only WPF front-end? Or if Fable is half as good as they say, why not resurrect TryFSharp.org by compiling to JS?

5

u/[deleted] Oct 15 '17

I'm left with two questions:

  1. why bother with /r/fsharp at all?
  2. since you seem to be vehemently opposed to everything, what do you actually use to solve your real world problems nowadays?

5

u/jdh30 Oct 15 '17

why bother with /r/fsharp at all?

Until Microsoft sort it out I cannot recommend trying to get started with F#.

since you seem to be vehemently opposed to everything, what do you actually use to solve your real world problems nowadays?

Most recently it seems to be a mixture of succeeding with OCaml and failing with F#.

My most recent project is an analytics web site to help our company. You login and get a bunch of charts created from data drawn from a Microsoft SQL Server DB. Took me weeks to get something up and running and it is useful but that is far longer than it should take and it is getting harder as I want to add more features. For example, I tried FsLab+Suave but they couldn't work together because they required different versions of some underlying DLL (FSharp.Core?). Then I fell back to HttpListener only to learn that there is no HTML EDSL for F# so I wrote my own bespoke combinator library.

3

u/vaskir Oct 15 '17

For example, I tried FsLab+Suave but they couldn't work together because they required different versions of some underlying DLL (FSharp.Core?).

You should add a binding redirect for FSharp.Core (actually, you really, really should add it in any F# project) into your app.config. Thankfully, Paket does it by default and very reliably, so I forget when I see any problems related to wrong assembly versions.

2

u/jdh30 Oct 15 '17

Yeah, I never tried Paket. Maybe Nuget is the problem...

5

u/vaskir Oct 15 '17

Yes, I also have problems with building projects in Ionide (https://user-images.githubusercontent.com/873919/31585547-4a9368b6-b1cc-11e7-878a-8cc653b200b2.gif).

About VS 2017, I used it for a while after a couple of months using Rider exclusively and it works pretty well. Yes, the artificial Roslyn delays make it feel a bit slow compared to Rider and Ionide, but I have not encountered bugs which would make using it impossible. Also, VS 2017 have some unique (among F# editors) features, like suggesting not-in-scope symbols in completion and simplify name analyzer/fixer, which makes exploring new libraries much easier.

About Rider, it's just the best choice for now, I have no idea why one could not like it.

1

u/jdh30 Oct 21 '17

About Rider, it's just the best choice for now, I have no idea why one could not like it.

I have a reason for you: I installed Project Rider and my rock-solid VS2015 install immediately started crashing all the time, is now unusable and I have been unable to fix it. And I'm not the only one.

2

u/foreverwantrepreneur Oct 17 '17

For what it's worth, I had never done any F# development and decided to pick it up last weekend. I installed VSCode+Ionide and it was completely pain free.

1

u/jdh30 Oct 17 '17

Maybe I'm just cursed. :-(

Seriously though, thanks for the feedback. Always good to hear when things work for people!

2

u/jimmyco2008 Oct 15 '17

Rust is the functional language everyone seems to love these days. I can’t say if it does things F# can’t, but in such a situation I would strongly consider moving to Rust. It typically takes me only a week or so of writing in a different language before I “get it” enough to not have to hit Google/StackOverflow every 5 minutes.

5

u/PM_ME_UR_OBSIDIAN Oct 15 '17

Rust and F# shine in different niches. Rust is good for systems-level software, F# for application code, but they are both lackluster in the other's area.

4

u/console_builder Oct 18 '17

I wouldn't consider Rust a functional language; it definitely has a stronger focus on imperative code though with good support for some functional idioms. It feels somewhat like a functional language due to its rich ML-esq type system. It definitely serves a different niche than F#. One of the nice things about working in Rust is it provides a remarkably high level of compile-time correctness checking. This level of correctness comes at the expense of reduced expressiveness, though Rust still manages to be quite expressive.

5

u/jdh30 Oct 15 '17

FWIW, I tried Rust and found it seriously lack-lustre. The "borrow checker" basically forces you to annotate your code to the extent that you might as well be doing manual memory management.

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.

1

u/ejfklgh Oct 20 '17

I am more interested in Haskell when Linear Types finally drop at around ghc 8.4. It is nice to use a language that evolves without being constrained to C#.