Live data from Hacker News

Tour of F#

docs.microsoft.com

111–120 of 140 posts

Re: Tour of F#

#111
post #2

One observation from watching Go and Rust gain popularity is that having an online code evaluation tool like https://play.rust-lang.org/ or https://play.golang.org/ can do wonders for adoption. People can experiment in a sandbox without having to hop into a development environment, and peers have an easier time debugging by easily sharing and reproducing problems. For anyone interested in trying out F# online, looks…

You might also want to look at Pex4Fun which has a bunch of little coding challenges (you'll need to select F# if it isn't already). Hit 'Ask Pex' to get going.

http://www.pexforfun.com/Page.aspx#learn/

Re: Tour of F#

#112

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.

Or use both: https://www.youtube.com/embed/HLs6WgAmX64

Re: Tour of F#

#113
post #103

Earlier quoted context omitted.

Can you go straight to this book or do you need to get a certain comfort level with f# first? I have the latest edition for F# 4 but haven't read it yet, plan to as part of my learning the language but haven't figured out order.

It's pretty good.

I certainly looked at the cheat sheets, played around a lot, read lots of online tutorials. Only once I had a basic understanding did I read Don's Expert F#, its great, but not for beginners.

Re: Tour of F#

#114
post #22
post #16

What's the quick start for using F# on the Mac? Can I get a good native development environment? Am I better off running a Windows VM to get better tooling?

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…

About .net core and f#, just see wiki https://github.com/dotnet/netcorecli-fsc/wiki/.NET-Core-SDK-... for more info

Re: Tour of F#

#115
post #58

Earlier quoted context omitted.

F# works fine for me on linux. what is it you're after?

well i mean there's all this stuff i vaguely see about .NET Core not being as good as the offering on windows but that eventually it will be? i don't know C# but i'm interested. i guess i'm just wondering if i should make the leap to starting to learn it even though i develop solely on linux.

About .net core and F#, see wiki https://github.com/dotnet/netcorecli-fsc/wiki/.NET-Core-SDK-... for info

Debugging in vscode is coming soon (before rtm), works already in dev version

Re: Tour of F#

#116

Author of the article here. Happy to see this up on HN! The article is actually more of an annotated version of the F# Tutorial Script[0] which ships inside Visual Studio 2017 (also in other version of Visual Studio, but the Tutorial script is a bit different there). You can get started with F# just about everywhere everywhere: * Visual Studio[1] * Visual Studio for Mac[2] * Visual Studio Code (via Ionide plugins)[3]…

even iPad http://continuous.codes

Big :+1: to continuous, the f#/c# ide for ipad, really slick

Re: Tour of F#

#117

Earlier quoted context omitted.

https://gist.github.com/jackmott/988b4742394cf5e7d331e31c0ee...

For starters this is enough and less confusing IMHO: open System.IO for line in File.ReadLines("/path/to/file") do printfn "%s" line

Or using awesome |> pipeline operator

    "/path/to/file"
    |> File.ReadLines
    |> Seq.iter (printfn "%s")

the printfn can be expanded as function, instead of partial app

    "/path/to/file"
    |> File.ReadLines
    |> Seq.iter (fun line -> printfn "%s" line)

Re: Tour of F#

#118
post #60

Earlier quoted context omitted.

One observation from watching Go and Rust gain popularity is that having an online code evaluation tool like https://play.rust-lang.org/ or https://play.golang.org/ can do wonders for adoption. One of the things Go does right is the download-hello-world-compile-run experience. Especially now, since they now default GOPATH. One of the things that Go does wrong for popularity is the opinionated directory structure base…

> If Go had some way of mitigating that and the lack of generics, then the Hello World experience would be better for more people. Does the lack of generics really impact the experience of "Hello World"? I don't think I've ever seen generics used in a "Hello World" example even in languages that have them.

Whenever I evaluate a language past the hello world stage, I try to do something more complex. Which is where the generics come in. Imagine for a second that I may want a hashmap with a custom key/hash function (most often it would actually be a set) for my own datatype. I can't just use the built in hashmap _language construct_ (the hashmap is it's own, very special type), I either have to write a hashmap implementation myself or wrap a hashmap in it's own type and have custom getters and setters which would extract a key from my custom type that is intended to be stored in the map. It might be more go to do said things, but then it just means that it's more go to write code that is more likely to be buggy.

Re: Tour of F#

#119
post #94

Earlier quoted context omitted.

I can't upvote your comment enough. Learning F# w/o .NET and Clojure without JVM knowledge is next to impossible. There is no good doc despite what people say (and I own several books in this space). Scott W's F# articles are great for foundational FP, but neither that, any of the F# books, or any of the online tutorials show me how to do even simple things like iterate through a file. I'd love to see "Basic Office P…

What problems did you run into with Clojure? I haven't missed JVM/Java experience. The Clojure standard library provides nearly everything and third party Clojure libraries wrap Java libs. Off the top of my head, the only Java thing normal code sometimes references is numerics, so you might glimpse Long/MAX_VALUE or Math/sqrt.

A lot of things require you to specify the Java namespace like the "swing" demo. Iterating through a folder was similar. There are several Clojure books explaining FP concepts, but not much in the realm of here is how you do basic task "x". This isn't perfect in any language, but I've never had trouble with Perl, Python, C#, Java, Fortran...etc.

Re: Tour of F#

#120

Earlier quoted context omitted.

https://gist.github.com/jackmott/988b4742394cf5e7d331e31c0ee...

For starters this is enough and less confusing IMHO: open System.IO for line in File.ReadLines("/path/to/file") do printfn "%s" line

If you could make about 50 more of these snippets...I'd be using F# everyday :)
Post reply on HN