Hacker News new | comments | show | ask | jobs | submit login
[dupe] Announcing a pre-release of F# 3.1 and the Visual F# tools in Visual Studio 2013 (msdn.com)
35 points by profquail 1485 days ago | hide | past | web | 16 comments | favorite



Who uses F# and why?


I'm not sure if I'm being trolled or not but I'll bite...

A simple 5 second google search would answer your questions.

http://stackoverflow.com/questions/179332/anyone-actually-us...

http://fsharpforfunandprofit.com/why-use-fsharp/

http://msdn.microsoft.com/en-us/vstudio/gg634701.aspx

To be honest as to why the answer is often anyone who wants to use an OCaml like syntax but have access the debugging tools of visual studio or mono and access to the libraries written for .Net.

We use it to write our proprietary trading system.


Financials like it a lot. Because it is the simplest and easiest way to do FP in a .NET stack. And it is quite a nice meld of an uncompromising dialect of ML into an OO world.


http://blogs.msdn.com/b/dsyme/archive/2010/07/08/tabbles-org...

http://fsharp.org/testimonials/#tabbles-1 Completely in F# see comments above

http://www.rawbots.net/ are using F# in a very significant way and are in the process of making it their primary language.

http://fsharp.org/testimonials/#path-of-go whole AI logic in F#

http://fsharp.org/testimonials/#yan-cui backend in F#

http://www.galaxywarsthegame.com/ uses F# entirely

http://www.assettocorsa.net/ uses F# to prototype their vehicle dynamics.

and many more here http://fsharp.org/testimonials/


Plenty of different reasons. Personally, I'm looking for a solid language with broad library and interop, and fantastic tooling (from editors to debuggers, profilers, and more). .NET has a good ecosystem; MS loves developers (usually).

F# has nearly a superset of C#'s functionality, but with a far better fundamental design. It requires much less code, and results in far fewer bugs. And the biggest tradeoff is that Visual Studio's IntelliSense is a bit less capable with F# than C#. Performance wise, F# usually matches C#, but has more flexibility to outperform it in some cases.

The F# team has a strong background: They were the ones responsible for bringing proper generics to C# and the CLR. Without them, the CLR would probably have a lame generics system, such as Java. F# also demonstrated how to properly do async on .NET half a decade ago, which C# 5 finally picked up.

So if you're on .NET, there's little reason to not use F#, unless you're in a shop that needs replaceable warm-body programmers.

If you're not on .NET, there are perhaps better languages (Haskell), but that comes at a cost of having less tooling and libraries.


Who needs a functional programming language and wants, at the same time, to take full advantage of the use of the .NET framework.

examples: math, science, economic fields.


I know of at least one very smart/productive guy who uses it, but I couldn't say 'why' exactly. It might be because he works at an MS dominated company, that is nonetheless open to experimentation.


Being serous, who uses Go and why? The reasons are similar to why one should use F#


What? The use case for F# is simple: you have a body of existing .net (i.e. C#) code you want to interoperate with, but you want a modern functional language with all the benefits that brings (a real type system, a better steer towards immutability and purity, etc.). What's the use case for Go? It's certainly not that.


F# is general purpose and multi-paradigm, it even has OO classes and imperative for and while loops. I for one got into .NET because of F# and to me .NET is just like any other language runtime.


OOI why did you choose F# rather than Haskell, OCaml or Scala? I mean sure, it's a perfectly good language for the more general case (leaving aside the poor tool support outside Windows and limited deployment options - but conversely if you're already committed to Windows the tooling is very good), but there are plenty of comparable options there; the unique selling point is the .net integration.


Why over Haskell?

* Easy multi-platform targetting and platform bindings without fuss.

* Mature and supported BCL and 3rd party libraries

* Access to the .NET ecosystem tooling like profilers, debuggers etc

* Easy to use Native FFI without having to write boilerplate C stubs

* more predictable reasoning about performance because of strictness by default.

* Built-in Units of measure without perf cost.

* Type Providers allowing typed access to untyped data and much more

[F# 3.0: Data, Services, Web, Cloud... at Your Fingertips] (http://channel9.msdn.com/Events/TechEd/Europe/2012/DEV338)

http://www.navision-blog.de/2012/03/25/typed-access-to-json-...

http://www.navision-blog.de/2012/03/22/wpf-designer-for-f/

http://blogs.msdn.com/b/dsyme/archive/2012/08/03/access-stat...

* Built-in support for runtime code quoations, with code inspection

* Built-in support for runtime reflection

* Subtyping without greenspunning around.

* Easier to fallback to imperative code.

* Extensible computation expression syntax for more than just monads.


Why over Scala?

* .NET runs everywhere now without problems, the JVM doesn't have a reliable IOS implementation and Dalvik on Android is too slow for the things I'm doing and many desktops don't come with a JVM installed.

* Better type inference

* FP isolated from OOP

* Lighter indent aware syntax.

* Easier to reason about performance because of lower abstractions

* Pattern matching can be used in performance sensitive situations.

* Easier equational reasononing because FP and OO are isolated from each other.

* Initialization order bugs can't happen easily by design due to the way class ctors work.

* Easy to use Native FFI without having to write boilerplate C stubs

* A generics aware runtime so cross language .NET interop is seamless and without perf cost.

* Built-in Units of measure without perf cost or having to wait for a mature macro'ed implementation..

* Built-in Type Providers allowing typed access to untyped data and much more without having to wait for a mature macro'ed implementation.

* Built-in support for runtime code quoations, with code inspection

* Extensible computation expression syntax for more than just monads.


Here's a comparison of OCaml and F#[1], as F# is "descended" from OCaml.

Mono provides full support for F#. The F# compiler is open source (Apache license). MonoDevelop has some support for F#, but I haven't used it.

I don't fundamentally see the difference in deploying a runtime like the JVM over Mono. Mono even lets you pre-compile to native code (that's how the run on iOS, for instance), so you don't need to install the Mono runtime.

I use F# in production on Linux machines (telephony applications) and have so for many years. We use Windows to develop, test, build, etc. and then copy things over to Linux and it just works.

1: http://stackoverflow.com/questions/179492/f-changes-to-ocaml


>I don't fundamentally see the difference in deploying a runtime like the JVM over Mono.

It's not a fundamental difference, it's about being confident the tools and support you need will be available. With the JVM you've got the full weight of IBM and Oracle behind you, and thousands of vendors selling things like latency-optimized JVMs, heap analyzers, managed hosting services. Likewise with the CLR you've got MS and a whole ecosystem of companies building tools around their VM. With Mono I don't get the same level of confidence that I'm moving with the herd, that there are many other businesses who will have hit any possible problems, that I can hire people who've used the platform before...

But my tooling comment was mostly about the development tools. I'd be super-nervous about developing on one OS/VM and deploying to another; don't you find you hit VM bugs that weren't present when you tested?


Why over OCaml?

* Easy multi-platform targetting and platform bindings without fuss.

* Mature and supported BCL and 3rd party libraries

* Access to the .NET ecosystem tooling like profilers, debuggers etc

* Easy to use Native FFI without having to write boilerplate C stubs

* Active Patterns

* Built-in Units of measure without perf cost.

* Built-in support for Unboxed Structs with Layout control and operator overloading

* Unboxed floats, not just for 64 bit ones syntactically present in arrays

* Built-in control over inlining

* 32 bit ints not 31

* Type Providers allowing typed access to untyped data and much more

[F# 3.0: Data, Services, Web, Cloud... at Your Fingertips] (http://channel9.msdn.com/Events/TechEd/Europe/2012/DEV338)

http://www.navision-blog.de/2012/03/25/typed-access-to-json-...

http://www.navision-blog.de/2012/03/22/wpf-designer-for-f/

http://blogs.msdn.com/b/dsyme/archive/2012/08/03/access-stat...

* Built-in support for runtime code quotions, with code inspection

* Built-in support for runtime reflection

* OOP abstractions without perf loss

* Built-in support for Operator overloading

* Polymorphic print function

* Mature Multicore friendly runtimes

* mutable local variables on the stack

* Cleaned up offside-rule indent based syntax with optional OCaml style override.

* Partial application of Discriminated Unions like List.map Some [1; 2; 3]

In OCaml you have todo List.map (fun x -> Some x) [1; 2; 3]

* Methods on Records and Discriminated Unions

* Extension Methods

* Built-in syntax for Array slicing

* Built-in syntax for sequence based for loops

* Built-in syntax for List / Array range construction like [1 .. 10]

* Extensible computation expression syntax for more than just monads.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: