5 ms·
Announcing a pre-release of F# 3.1 and the Visual F# tools in Visual Studio 2013
- inzax 13y agoCan anyone answer me why specifically should I use F#?
- Jaecen 13y agoThe biggest draw would be if you wanted to work in a functional language on the .NET platform.
- 7manr82h 13y agothe 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
- deleted 13y ago[deleted]
- mattchamb 13y agoBecause it is an awesome language. also, http://fsharpforfunandprofit.com/why-use-fsharp/ http://fsharpforfunandprofit.com/why-use-fsharp/
- virtualwhys 13y agoMost accessible functional programming blog. Love his monad tutorial: http://fsharpforfunandprofit.com/posts/why-i-wont-be-writing-a-monad-tutorial/ http://fsharpforfunandprofit.com/posts/why-i-wont-be-writing...
- virtualwhys 13y agoF# Type Providers should be illegal. If there is an equivalent in any other language than F#, do tell.
- tikhonj 13y agoGosu[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/ 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.
- virtualwhys 13y agoInteresting, 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 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.
- tikhonj 13y agoI 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.
- tikhonj 13y agoThere'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.
- Associat0r 13y agoF# 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/ http://fsharp.org/
- 7manr82h 13y agoi 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.
- virtualwhys 13y agoWhat'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.
- rauljara 13y agoYou 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.
- 7manr82h 13y agonote: there is optional laziness via seq or 'lazy'