Hacker News new | ask | show | jobs
by kornish 3408 days ago
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 like Microsoft Research has such a tool: http://www.tryfsharp.org/Create. Unfortunately looks like you have to create an account of some sort to share scripts, so these alternatives might be better:

https://repl.it/languages/fsharp

http://tryfs.net/

9 comments

A more recent Microsoft offering for trying F# (or Python, R) is:

https://notebooks.azure.com

Click on the Intro to F#. Or try the user contributed notebook:

https://notebooks.azure.com/library/HorsesForCourses

[msft]

Literate Programming with Notebooks is where no other .net based language comes close to F#. I will spend more time on F# notebooks, this is great!
Check out Xamarin Workbooks* for the C# equivalent.

(*): https://developer.xamarin.com/guides/cross-platform/workbook...

Sadly I'm neither able to clone or open an existing clone for the F# notebook :(
Hmmm... when I click on the Horses link, I see its 3 notebooks, with a blue clone & run button. When clicked, I get prompted to sign in (requires any msft account like outlook, xbox, hotmail, ...). Once you sign in (or create an account), you'll end up in Docker/Jupyter instance with the 3 notebooks. Clicking on the first one and doing a Run All, should give you:

http://imgur.com/a/JgcqP

What happens when you click the Intro to F# sample on the front page? It should render the notebook and if you clone, it should prompt to sign in as above. Hope this helps.

When I choose to connect to an existing notebook nothing happens. When I choose to clone I get to the login screen by clicking the login button does nothing :|

EDIT: I'm now able to login. It brought up a little redirect modal after entering my user name which due to my typing was apparently getting canceled. The notebook load, but I get now chart.Plot output.

I haven't used jupyter notebooks much. They seem cool, but not as cool as light tabels insta-repl.

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 based environment mechanism. It has some advantages for large programming projects, but the way it runs counter to many programmer's expectations is seen by many as a wat!?

If Go had some way of mitigating that and the lack of generics, then the Hello World experience would be better for more people. (For admittedly shallow reasons, IMHO. I think that Go is pretty good the way it is. I haven't yet felt a need for generics yet in my MMO project.)

> 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.
I definitely agree with you that I prefer having generics to not having them and would consider that in my evaluation of a language; I just found it strange that a random reference to the lack of generics was dropped in the middle of an otherwise cohesive description of the pros and cons of the "hello world" experience.
No, but if you believe the ramblings of the standard HN commenter who complains about Go, very soon afterwards the lack of generics has driven them to gnashing teeth and rending hair.
What's the default behavior now? This greatly annoyed me when I first started with Go.
GOPATH now defaults to $HOME/go or the equivalent for your OS.
If you want to try an F# to JavaScript compiler. Try Fable:

http://fable.io/repl.html

I like this one https://dotnetfiddle.net/ (F# needs to be selected as a language)
I like playing with F# in a Jupyter notebook.

https://notebooks.azure.com/

I tried tryfs.net, but the Hello World sample doesn't work in Chrome: uBlock Origin blocks some scripts, but even after disabling uBlock it still doesn't render anything to the output area, it just flashes.
I've wrote a java REPL that runs locally but can upload to remote: http://jpad.io/example/1E/fetch-headlines-using-jsoup

My issue with the online editors is that it restricts your ability to access files, add dependencies and modify your local machine. If anyone would like an online version I'd be interested to hear why?

there is also http://try.websharper.com/ for toying with the language and websharper.
Glot.io includes F# https://glot.io/new/fsharp
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/