Hacker News new | past | comments | ask | show | jobs | submit login
Announcing a pre-release of F# 3.1 and the Visual F# tools in Visual Studio 2013 (msdn.com)
23 points by Associat0r on June 28, 2013 | hide | past | favorite | 18 comments



Can anyone answer me why specifically should I use F#?


You in particular? No, I cannot answer that question. I don't believe there is a single language which all programmers should be using.

In general? It is a strongly typed functional language with excellent type inference that isn't lazy and support imperative programming. I think (and this is opinion) that it much easier to reason about an program written idiomatically in a dialect of ML (such as F#) than one written in idiomatic Haskell, basically just due to the lack of laziness. I also think I prefer Haskell to the ML variants, but I also found the hump which one has to get over in order to be productive significantly lower.


note: there is optional laziness via seq or 'lazy'


There's really two separate sets of reasons: one set for using .NET and one for doing functional programming.

.NET is a good technology if you don't mind being somewhat tied to the Mircrosoft stack: it's well designed, reasonably performant, strongly supported and relatively stable. It has good integration with other Microsoft products, good tooling with Visual Studio and an extensive set of libraries. (The libraries are what would probably tie you the most strongly to Microsoft.)

Functional programming is a much deeper topic, so I'll give my condensed and unabashedly biased summary: functional languages tend to be more expressive (and, transitively, more productive) while producing code that's easier to support--F# has a good type system, and functional programming leads to much lower coupling than OO much less procedural programming. This happens without sacrificing performance too much. Sure, you won't get C speed (or even C# speed), but it's more than good enough for most tasks. I'm pretty sure F# is at most a couple of times slower than C#--much faster than the popular dynamically typed languages! I'm really only familiar with OCaml and Haskell, both similar languages, and they can certainly produce fast code.

So if you're convinced by functional programming and somehow tied to .NET, F# is the perfect choice. If you're not tied to .NET, I would recommend Haskell or maybe OCaml instead.


F# is general purpose and multi-paradigm, it even has OO classes and imperative for and while loops and I get the same perf as C# and even more in some cases. I for one got into .NET because of F# and to me .NET is just like any other language runtime.

It's not just tied to MS, it runs on every major platform thanks to Mono see the left bar on this site http://fsharp.org/


i would like to point out that i am using F# with emacs on linux with mono, i made this transition recently from windows and i have no complaints yet.


What's the latest and greatest in terms of M$ feature availability on Mono these days?

A couple of years ago whatever the successor to LINQ to SQL was at the time, was not available/not implemented (maybe Entity Framework?)

Anyway, curious about doing equivalent of Scala + Play + Slick on Mono, which I assume is F# + .NET + Type Providers/LINQ to SQL.


i think i just haven't had anything that hasn't worked yet, and by this i mean, i wrote my codebase for various projects in .net in vs2012, copying them over to linux and just fsharpc, and it just works (although i confess i have not touched linq\sql things), my advice, git clone and try. edit:spell


Because it is an awesome language.

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


Most accessible functional programming blog. Love his monad tutorial: http://fsharpforfunandprofit.com/posts/why-i-wont-be-writing...


F# Type Providers should be illegal.

If there is an equivalent in any other language than F#, do tell.


Gosu[1]has a very similar feature--I think it might have even had it for longer than F#! Too bad almost nobody uses it: it's a nice language that makes a perfect complement or replacement for Java.

[1]: http://gosu-lang.org/

Gosu was actually the first language I ever used at a real job (well, an internship), which is not a common distinction :P. That also means that my current OCaml internship actually uses a more common language! I bet none of the other interns here can claim having professionally used a language markedly less popular than OCaml.


Interesting, assume you are referring to Gosu's open type system; in practice how does work?

I'm skeptical that Gosu's equivalent comes anywhere close to: http://vimeo.com/user18356272/review/66548723/a0d91288e1

It's fucking ridiculous, look at what is happening there and ask yourself, does a similar feature exist in my primary development language?

As a Scala user I cannot answer yes.


I think it offers the same functionality: you can create new types from any source you want. This includes everything from automatically parsing and loading database model files in your path to adding structural subtying as a library feature. It also integrates with the tooling, although I only ever used it from Emacs and so didn't see that myself.

The API for actually using the open type system was quite awkward and undocumented back when I used it, but it's probably improved by now.

My main language is probably Haskell or maybe OCaml. We don't have anything quite like that, but we can get quite far just with Template Haskell or Camlp4. E.g. I'm sure I could implement the regular expression example with a Template Haskell quasiquoter. Maybe not quite as slick, but certainly serviceable. I also don't know about tooling support because I'm still using Emacs for everything :P.


nice video, that was a good watch.


Not that it's a popular language, but a type-provider-like feature was recently added to the dependently-typed language Idris (see https://github.com/edwinb/Idris-dev/commit/46964d7d57c18826d...).


The biggest draw would be if you wanted to work in a functional language on the .NET platform.


the biggest draw? i hated .net (just at a glance), reason i chose F# is because its multiparadigm, i get my OOP, Imperative (for speed) and started to learning functional too, which helps with the other paradigms




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: