Live data from Hacker News

A whirlwind tour of object-oriented code in F# (2012)

fsharpforfunandprofit.com

111–120 of 130 posts

Re: A whirlwind tour of object-oriented code in F# (2012)

#111

Unlike most commentors my experience with F# hasn't been stellar. I feel the language itself is well designed and the community is great but there is just so much of it. Any source code that i try to go through is sprinkled with so many new keywords, so many different way of combining stuff, that there seems to be so many syntactical stuff going on. It is really making me struggle. It just feels like a language where…

I agree, F# is hard to learn. It took me a few months of tinkering to be able to express myself in it.

Good entry points: Don Syme - his "F# Code I Love" talk has been recorded a few times: https://www.youtube.com/watch?v=aw2BAxG3bdM. I recommend catching a few versions.

Scott Wlaschin - His talks are also great: https://www.youtube.com/watch?v=srQt1NAHYC0. He also runs https://fsharpforfunandprofit.com/ which is a treasure trove.

And I found Isaac Abraham's book excellent and breezy to read: https://www.manning.com/books/get-programming-with-f-sharp

Now that I'm over the hump, I think F# code is far more readable than other languages I'm well versed in (C++/C#). Probably my favorite thing about F# is the strict top-down dependencies. You can open a project and read it in order, and understand it without having to hop around a bunch.

And since most programs can be written in far fewer lines in F#, code written in it ends up feeling very small and economical.

Re: A whirlwind tour of object-oriented code in F# (2012)

#112
> Anything C# can do...

Yes, yes, you can do anything in F#, but what should you do?

My opinion is that that what F# is missing is a good set of idioms and a strongly opinionated set of guidelines. To my beginner's eyes, every F# codebase I've seen feels like it's written in a completely different language; it's like the opposite of Python's "one right way to do everything".

I've heard that F# is great for domain-specific languages, but in most cases a DSL is the cardinal opposite of what I want. I want a common language that I can use to express a multitude of different concepts. It seems like all of the guidance out there about F# is about showing off features, being extremely clever, or using F# to teach functional concepts, not actually about writing useful applications.

Re: A whirlwind tour of object-oriented code in F# (2012)

#113
post #95

Earlier quoted context omitted.

There are C# programmers like that I suppose. There are also many C# programmers who buy into multi paradigmism, they fee no ideological conflict between using OO or FP as needed. C# supports FP well enough, and gets better every release (eg pattern matching). It’s difficult to compete with C#, especially when F# is feeding features into it.

Hopefully F# feeds the ability to have functions at the root of a module into C#. It's a small thing, but needing to put pure functions on static classes gets old after a while. I know local functions are a recent ish addition to C#. Hoping they keep going down that road.

C# has a set of design constraints that can be annoying, but they make the language consistent and extremely resilient. It isn't up to the whimsies of the designers either, Anders and company went one way with C# and a completely different way with TypeScript (given its need to fit in with Javascript).

They can be annoying, I guess, but once you are used to it you don't really notice they are missing. It is annoying if you have to switch languages often, I'm pretty sure I would need a few weeks to get re-acclimated if I had to go back to C# from using TypeScript for so long.

Re: A whirlwind tour of object-oriented code in F# (2012)

#114

Earlier quoted context omitted.

I find this to be an interesting cultural phenomenon, this thing where people in .NET-land are skittish about F# because it's not so tightly controlled by Microsoft. Meanwhile, I'm pretty sure nobody even wants Oracle to be getting involved in Kotlin or Scala or Clojure.

> this thing where people in .NET-land are skittish about F# because it's not so tightly controlled by Microsoft. Microsoft's great tooling is what has made (traditionally) it sticky for a lot of developers. F#'s tooling from Microsoft has been a half-hearted effort (organizationally, not speaking of the effort that the F# guys have put in.)

The irony is that F#s releases are in lock-step with the Visual tools team releases and schedule.

Re: A whirlwind tour of object-oriented code in F# (2012)

#115
post #55
post #4

F# is a joy to use. After a certain time, many C# developers find themselves writing in a functional style. F# makes this the default, but lets you continue using all of your existing code. Better yet, Linux and macOS support via .Net Core is excellent. F# on .Net Core is now a powerful alternative to Node.js.

> After a certain time, many C# developers find themselves writing in a functional style If you can't move to F# or find its tooling abysmal and slow then I have a library [1] that makes the inertia flow positively in the functional direction in C# https://github.com/louthy/language-ext/

Would love to use F# with Unity, but the typical high allocation rates that come with the functional language territory scare me. Looked at your library, it's very interesting. I saw your docs note about the allocation efficiency of Map, would like to hear more. Could you characterize the library's general allocation story?

Re: A whirlwind tour of object-oriented code in F# (2012)

#116

Earlier quoted context omitted.

C# was usable in VS Code even 3 years ago

How is it these days? Is it “usable” or actually something you want to and enjoy using? Will I be left wanting Visual Studio? I mean I really enjoy IntelliJ, it makes programming Java like slicing butter. But I do want to try F#, people talk so highly of it.

My background is mostly .NET and web. I like VS Code a lot for JS/TS, but I hesitate to recommend it for C#. Using it about a year ago, I felt like I was missing a lot of the power of "real" Visual Studio and many language features were fairly buggy on my Mac.

Re: A whirlwind tour of object-oriented code in F# (2012)

#117
post #101
post #79

Earlier quoted context omitted.

As C# gradually becomes F#, I have to wonder, why not just use F#?

Ah, the same old refrain [1] [1] https://github.com/louthy/language-ext/wiki/%22Why-don't-you...

Nice article, thanks for sharing.

I'm sure there are people out there debating F# vs C# for a new project, and might not realize how many future C# features are already in F# though.

Re: A whirlwind tour of object-oriented code in F# (2012)

#118
post #92

Earlier quoted context omitted.

I'm not saying it's a replacement for either F# or OCaml, and I've only glanced at it, but F*[1] looks pretty neat. It's higher-level than F# (a lot) and has a syntax more similar to Haskell's. You can even extract programs in F# and OCaml. [1] https://www.fstar-lang.org/

My experience with F* is several unsuccessful hours of trying to compile hello world thanks to a complete lack of instructions for configuration and installation. I hope it's gotten better.

F* or F#? They are very different.

Re: A whirlwind tour of object-oriented code in F# (2012)

#119
post #114

Earlier quoted context omitted.

> this thing where people in .NET-land are skittish about F# because it's not so tightly controlled by Microsoft. Microsoft's great tooling is what has made (traditionally) it sticky for a lot of developers. F#'s tooling from Microsoft has been a half-hearted effort (organizationally, not speaking of the effort that the F# guys have put in.)

The irony is that F#s releases are in lock-step with the Visual tools team releases and schedule.

I must vehemently disagree.

From: https://github.com/dotnet/fsharp/issues/2400

"GiorgioG commented on Oct 19, 2017 @masaeedu - Not to beat a dead horse, but we've been waiting for an RTM release of this since May when VS2017 first RTM'd. We were then told it would likely come in the July release of VS, we're now nearing the tail end of October with no clear idea when we'll get it. It's not @cartermp 's fault, just the reality that MS has not made it a high priority (judging by their actions, not their words.) In summary, if you want to use F#, use VSCode, it has excellent support for F#, as long as you realize it's not Visual Studio, it's a souped up text editor."

Re: A whirlwind tour of object-oriented code in F# (2012)

#120
post #114

Earlier quoted context omitted.

The irony is that F#s releases are in lock-step with the Visual tools team releases and schedule.

I must vehemently disagree. From: https://github.com/dotnet/fsharp/issues/2400 "GiorgioG commented on Oct 19, 2017 @masaeedu - Not to beat a dead horse, but we've been waiting for an RTM release of this since May when VS2017 first RTM'd. We were then told it would likely come in the July release of VS, we're now nearing the tail end of October with no clear idea when we'll get it. It's not @cartermp 's fault, just th…

Perhaps it's not the case anymore, but I meant more that F# language releases used to be delayed until the Visual Tools team was ready to release a new Version for Visual Studio. So essentially, the F# releases seemed to be held up. Perhaps I'm remembering wrong and/or this has changed since the .Net core support came in.
Post reply on HN