Live data from Hacker News

Tour of F#

docs.microsoft.com

41–50 of 140 posts

Re: Tour of F#

#41
> /// Conditionals use if/then/elid/elif/else.

The "elid" intrigued me and I tried to look it up but couldn't find anything. Is this just a typo?

Re: Tour of F#

#43
I realize that .NET is F#'s biggest strength from the perspective that Microsoft probably holds of trying to push C# more functional, and trying to attract talent from R, Ocaml, Rust, Julia, Haskell, etc, but it also feels like its biggest weakness.

I'd love to see some sort of bootstrapped version that makes use of .NET Native or CoreRT or whatever they use today, and I'd REALLY like to see a strong Stdlib for F# that takes into account what functional programmers are used to.

I've been doing functional programming for several years, and I feel like a moron working with F# because I don't know half of these dumb .NET classes and some of the domain problems don't really leave me able to budget enough time to bootstrap my own solutions OR learn all the .NET stuff I need. Especially not when I can jump into several other languages and have a working prototype often in days or hours.

Re: Tour of F#

#44

So much like OCaml... but I like the ability to annotate units! That's very cool.

Unit annotation is F#'s secret killer feature.

I did a small video game in F# using unit annotation and was shocked at the number of bugs that unit annotation picks up at compile time.

If you work with a lot of unit conversions (pixels, inches, whatever), I highly recommend giving F# a shot on a small project.

Unit annotation + access to the .NET ecosystem has made this language a personal favorite for any project heavy with numbers.

Re: Tour of F#

#45
post #22

Earlier quoted context omitted.

Visual Studio on Windows is good for F#, though it kind of needs the power tools plugin for F# to make it better. It's definitely not as awesome as the C# experience is, but still better than most! https://www.visualstudio.com/vs/visual-studio-mac/ for mac is pretty good. It's less than visual studio for windows, but still ok. Easy to get started. Visual Code, this seems a highly preferred option, and a lot of Fsharp…

Note that in VS2017, many of the Visual F# Power Tools features are in-box and use the same UI that C# and Visual Basic do. The folks behind the VFPT have been porting a lot of that code over and making many improvements along the way. There will be even more features and improvements in future VS 2017 updates, as well!

I'm really looking forward to VS2017 update 1. I've been following the activity in the visualfsharp github repo and some of the new Roslyn based tooling looks fantastic (albeit with alot of churn at the moment).

F# has always had good tooling 'for a functional language' but it looks like we're getting close to good tooling period.

Re: Tour of F#

#46

The problem I had going into this without a strong functional background is that often times to do practical things you're forced to work with .NET libraries - these .NET libraries are not nice functional libraries and don't encourage you to think functionally. Eventually I felt like everything I wrote was wrong and I just gave up on it.

Thing is that putting together short helpers for the "nasty" bits often revolve around 1 line helpers.

You can do so along the way without focusing so much on doing idiomatic FP and achieve both pragmatic and palatable results.

Designing solutions with the type system enabled by F# and it's ability to interop with whole .NET ecosystem is really a powerful combination.

Re: Tour of F#

#47

How difficult is it to get an F# kernel for Jupyter running on my Mac?

It became easier recently with droping a dependency on libgdiplus.

IIRC you just need to install mono, python, jupyter and ifsharp: https://github.com/fsprojects/IfSharp

All but last one should be on brew, for last one, you should be able to build it out of box with mono installed.

Don't hesitate to report issue on the repository if that fails.

Re: Tour of F#

#48

I realize that .NET is F#'s biggest strength from the perspective that Microsoft probably holds of trying to push C# more functional, and trying to attract talent from R, Ocaml, Rust, Julia, Haskell, etc, but it also feels like its biggest weakness. I'd love to see some sort of bootstrapped version that makes use of .NET Native or CoreRT or whatever they use today, and I'd REALLY like to see a strong Stdlib for F# th…

Edit: just before somebody starts whining about it, I ain't got no problems with NET on its own, but the barrier to proficiency in it from a functional universe is needlessly high, and if F# had a stronger core it would be something non NET programmers could pick up along the way rather than continuously bash their heads into while doing rather menial work.

I don't want to sound whiny either but it's such a punch in the gut when someone sees me struggling with basic FP stuff in F#, just because I guess I'm so proud of what I've learned about FP in other languages.

There's also some stuff that F# is missing, but it hasn't screwed me yet because I still haven't figured out enough about all the NET classes.

Re: Tour of F#

#49

The problem I had going into this without a strong functional background is that often times to do practical things you're forced to work with .NET libraries - these .NET libraries are not nice functional libraries and don't encourage you to think functionally. Eventually I felt like everything I wrote was wrong and I just gave up on it.

Sounds like the same issue I had with Clojure and Scala. As soon as you touch anything Java or mutable, it's like WTF?

Come to the Elixir/Erlang camp; our functional turtles go all the way down! The only jarring thing is having to write to a mutable database. They even borrowed the |> operator! And it has great pattern matching of course.

Re: Tour of F#

#50

So much like OCaml... but I like the ability to annotate units! That's very cool.

Unit annotation is F#'s secret killer feature. I did a small video game in F# using unit annotation and was shocked at the number of bugs that unit annotation picks up at compile time. If you work with a lot of unit conversions (pixels, inches, whatever), I highly recommend giving F# a shot on a small project. Unit annotation + access to the .NET ecosystem has made this language a personal favorite for any project he…

Is there a writeup somewhere of this feature?
Post reply on HN