Introducing F# 4.0(infoq.com) |
Introducing F# 4.0(infoq.com) |
Additionally, there's an F# room on http://fpchat.com/ (a Slack group dedicated to functional programming) and you'd be more than welcome to come and ask questions there too - I recommend that venue in particular as it's very active at the moment.
Hopefully that's enough to have a play - reply here if I can help at all too.
A nice and very good online tutorial to learn the language is http://fsharpforfunandprofit.com/
https://majecty.wordpress.com/2015/04/19/making-fsharp-proje...
This sort of conciseness is found all over the language as you keep digging deeper. I really recommend Scott Wlaschin's (link author) entire site. The best online resource for learning F#, IMO.
Plus the hiring mentality is "oh no, we won't find an F# developer". The problem is that they're looking for "language" developers in the first place. Who the hell cares if a hire knows F#? If they don't but worth hiring, they'll easily learn it. This is true for most languages, but extra true for F# as you still have the CLR, the whole .NET Framework, Visual Studio, etc.
The biggest thing holding F# back apart from that, and apart from people that are well, scared of it, to put it kindly, has been .NET itself. Mono's been flaky for F# development I hear, and people have been suspicious of .NET overall, I feel. Though I do have long-running server apps at high volume working fine with F# on Mono on Linux, ASP.NET and other experiences are suboptimal.
With Microsoft's new stance on open source and shipping .NET everywhere, hopefully a lot more people will give it a spin. F#'s probably in the top spot for the combination of tooling, libraries, and language - so long as you don't mind GC.
As far as the language itself, it does a pretty good job at doing multi-paradigm. In fact, it does OO better than C# in some cases (object expressions).
What's to stop a young developer from going against the grain and adopting .NET?
(Here come the downvotes. Shun the "hipster." But really, I'm looking for a subjective perspective from somebody on "the other side." I don't even know how to search for ".NET" on Github. For instance, is NuGet anything like npm or gem?)
I think it's just a matter of timing. Now that the F# community is getting bigger (see number of user groups at http://c4fsharp.net), more stable (see the F# Foundation http://foundation.fsharp.org), and Microsoft is becoming more open (reinforcing the already much more open F# space), it is just a good time for looking into F#. And F# 4.0 announcement is a good excuse for that :-).
Though F# 4.0 is the first version of the language designed and developed in a fully open way, which is pretty amazing change - and more important than many language features that could be added to F#.
Anyway, thanks for all the work you have put into making the F# community one that is thriving and active! I see your name everywhere when I'm Googling for F# stuff and it's obvious you are one of those 20-percenters doing 80-percent of the work!
http://blogs.msdn.com/b/dotnet/archive/2015/04/29/rounding-o...
http://blogs.msdn.com/b/fsharpteam/archive/2014/11/12/announ...
For me the most welcome change is the vastly improved consistency of the Seq/List/Array APIs.
This is now fixed. Although there is not yet support for creating and manipulating high-rank arrays, the compiler will now properly handle these types up to rank-32."
Has anyone here ever used "high-rank" arrays? The deepest I've ever gone was 4 for a lookup table, but I'm wondering what the use-case is for super high depth arrays as well as why there is a limit at all.
The only purpose I can see for expression trees is implementing a DSL with F# syntax.
Quoted code is nice, but it's not a real substitution real macros.
I'm not sure the F# community is the same as the broader .NET community. I think at the moment, with functional programming being a little more niche still, it's perhaps quite self-selecting. It has a lot of people in who really care. I think that's a good thing - I hope - but obviously the broader .NET community is perhaps more heterogenous - it can feel quite enterprise-y or business-y in places, unsurprisingly.
I hope the F# community wouldn't be found lacking, unfriendly, etc. We certainly try hard to be welcoming and inclusive, and I think generally do OK - although we could do better I'm sure, as could every community. There probably isn't as much open source in the .NET world as there is for Ruby/Node as much as anything else because of the backgrounds of the languages and communities (Microsoft has a strong influence over certain parts) but there is still quite a lot, with some very enthusiastic smart folk.
What's stopping people adopting it? Probably too long an answer for here. I would say that I think there are fewer and fewer things preventing adoption as time goes on, especially with F#, and there are some cool startups trying to do big things.
I'd like to think it's friendly, and I'd also like to think it's always open to ideas from other communities. If you wanted to chat as Ruby or Node dev (or anything else) I hope you'd be welcomed.
(Final note - NuGet is kind of like NPM yes - it's a common binary packaging form for dependency management. It has flaws, but is commonly used, and is certainly better than nothing. In the F# world at least, Paket is doing very well - it's compatible with NuGet packages, but perhaps slightly more accurate about using and managing them!)
After I re-read your comment it seemed you might be saying Microsoft tech intimidates you, perhaps because of the perception of it being big enterprise, dominated by Chief Poobah Architects, etc.
Ambiguity's a funny thing. :)
I'd say learn the MS ecosystem for the same reason I learned Linux way back when: a different perspective.
You'll see all the same things, but sometimes done a different way. Not necessarily better or worse, just different. I'm pretty confident you'll have at least one "that's a great way to do that" moment.
Maybe you'll come away from the experience much as I have: I don't really care what the tech is. Will it do what I need it to? It also has made picking up "new" tech (ain't nuthin' new) really easy.
Oh, and search for "dotnet". Most places use that. Google will search for ".net" if you add in "C#" or something.
The more platforms and languages you get exposed to, the more informed choices you'll be able to make in the future.
If you're interested in F#, or even if you just want to dip your toe in, I recommend checking out your local F# meetup. I've learned a lot there over the years and made some great friends too.
For a young developer in 2015 really no reason not to use .NET. Other than its just not as popular, which is good enough reason.
For older folks the main stumbling block is... Microsoft has run long and brutal cons before. If your memory is long you just don't trust them.they are doing everything right... But still.
You mentioned NuGet, which is like `gem`. Well, the build tools in .NET land suck really badly. You've got MSBuild, which is like Ant or Make and that's what everybody uses, because development in .NET-land is Visual Studio driven. What you don't have for example is something like Maven (or SBT, or Lein). There's been nothing like it in .NET land. The ASP.NET developers have been building an alternative, in the form of dnvm / dnx / dnu, but it's just getting started, being a work in progress and feeling hack-ish and incomplete. Fingers crossed.
Anyway, in spite of the fact that there are companies that have built their own build tools because the current status quo sucks so badly (and I know more than one), the .NET community is filled with closed-minded folks that will never admit that their tooling sucks and I'm even including Visual Studio itself in this mix, since an IDE that needs extra investments into ReSharper is not that good in my opinion.
And then there's Mono, the current cross-platform implementation and the answer to folks that want to develop and deploy on Linux, OS X, Android or iOS. Except that Mono is and has historically been full of bugs. Like if you want to do server side development and deploy on Mono, just forget about it. And these days Xamarin is focusing only on mobile development and the community is dead.
> Would, say, a Ruby or node.js-oriented web developer find the F#/.NET community lacking, incomplete, unfriendly, uncool? Is there even a community to speak of?
The answer in my opinion is yes. This may change, given recent efforts by Microsoft, however evolution will be slow because the whole ecosystem has to change, not just Microsoft.
This is blatantly false. Just on my current project I'm using :
* OpenTK - opensource API around OpenGL
* ReactiveUI - opensource MVVM framework using RX for databinding
* Command Line Parser Library - opensource, does what it says
* NLog - logging library
* sqlite-net - micro ORM for sqlite
I excluded :
* RX - opensource but comes from Microsoft so not a community, but also a nice counterexample of porting from .NET to JVM as RX was innovated on .NET and later ported to other platforms
* system.data.sqlite.org - opensource .NET sqlite implementation, arguably a port from a bigger project
And that's just the references I have in my current project, there are a bunch of open source .NET projects that do cool things, for eg. MonoGame, bunch of MVVM frameworks, etc.
As for open source community, we have real data available so there's no need for debate: http://githut.info/
As of Q4 2014, C# was number 10 in langs by number of active repos, with 56k (compared to, say, 85k for C++). Came in ahead of ObjC, R, Go, and others.
It may not be JavaScript, but it's active. If you look at the other stats you'll see these really aren't dead repos either.
A lot of people choose ReSharper for "nice" things that often times aren't buying them a whole lot in terms of productivity (e.g. "turn this foreach() loop into a Select() statement" really doesn't buy one much). I'd hardly say that one needs ReSharper to get the full Visual Studio experience.
That's a fair point, but even so, I've yet to find an IDE/editor/whatever that compares favorably to the combination of Visual Studio + Resharper + NCrunch.
I am really a total C# fanboy, though was reared on unix and c/c++/python/java.
> The answer in my opinion is yes. This may change, given recent efforts by Microsoft, however evolution will be slow because the whole ecosystem has to change, not just Microsoft.
A suspicion gnaws at me. I try to rid myself of it but alas, it holds fast and unyielding. That suspicion being: you know very little about the F# community. What statements you make, they seem descendents of generalizations from your experience with the .Net community. Happily, F# is not like the stereotypical .NET community (I must be so specific, in order that I not offend the subset to whom your claims do not apply). There is a strong culture of embracing open tools and code; Microsoft is not looked at for direction beyond what basic support they provide.
The community is neither lacking nor is it unfriendly. It is small, yes. Uncool? Opposite of! But opinions run with tastes. Incomplete is a tricky matter. Certainly it's not going to have as many libraries as Python or the JVM, but neither is it some kind of backwater.
There are excellent build tools like FAKE and paket. Awesome ideas like—why, take a look at how fantastic the HTML type provider is, and it works in real life too! Most of the time =) [http://fsharp.github.io/FSharp.Data/library/HtmlProvider.htm...]
There are tons of cool libraries available, most of them open source, with generous licensing terms. Stuff with Haskell heritage like fparsec, fscheck, the blazing fspickler combinators (serializer) or more computation oriented tools that let you target and run on the GPU or Here: Automatic Differentiation (after which, loss minimizing Machine Learning algorithms are made much easier) [http://gbaydin.github.io/DiffSharp/]. Or the DataFrames library: http://bluemountaincapital.github.io/Deedle/
Type providers also allow easy use of UI builders. Web frameworks and also, js targeting can be reached here: http://fsharp.org/guides/web/. You can target Unity3D and apparently, also the Unreal Engine.
There are interesting projects looking at distributed computation (https://github.com/fsprojects/Cricket and ilk) or light weight concurrency, in Hopac's take on the Pi Calculus.
F# was one of the earlier languages with light weight threads, a solid async story and first class events (pre-reactive trend). Active Patterns (not unique to F# but more common in) take us close to Predicate Dispatch (http://c2.com/cgi/wiki?PredicateDispatching). There is much more I could list and hopefully, I have piqued some interest.
But it's not perfect. Adding Functor support would be very useful. A while ago, in an early Active Patterns paper, there were hints that generalized algebraic datatypes might soon be introduced. Nothing came of that. Higher kindedness is nice but not as much missed—it is my suspicion that, the gains from each level of types that can be parameterized over, quickly saturates.
There are lots of cool projects going on in F#, and while, as a language it's definitely not as powerful as say Scala or Haskell; the tools, libraries and environment, alternate ideas as well as breezy syntax, do make up. Having used them all, I wouldn't say it is any less expressive, it just...prioritizes differently beyond the core functional ideas (REPL, sum/product types, currying, closures, point free application where possible, Hindley Milner inference, immutability by default, pattern matching and deconstruction, etc., etc.).
It strikes a lot of middle ground across many planes, in terms of pragmatism vs functional purity—that is its ML heritage (but perhaps even more so, bargained in exchange for the .NET ecosystem). Most functional languages focus on types in terms of algebra, F# does too but only basically, instead it focuses more on the easy bridging of types with unruly data.
Shame on whoever downvoted you. Add knowledge to the discussion instead of downvoting someone you disagree with. [0] http://stackoverflow.com/questions/849416/evaluate-quoted-ex...
And you could always feature gate them if you needed to have syntax breaks.
The main reason for the fix was because F# pre-4.0 can't reference overloaded methods where one or more of the overloads has one or more parameters which is an array of rank 5 or more. I had a 3rd party DLL I wanted to reference, where a class had generic overloads for all of the array ranks, e.g.,:
MyClass.Foo(T[])
MyClass.Foo(T[,])
...
MyClass.Foo(T[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,])
Even though I was only trying to use MyClass.Foo(T[]), the F# compiler's overload resolution failed due to the presence of the higher-ranked array types.I'm not planning to use such arrays any time soon, but I wanted to make sure that if other code was using these arrays I could reference it from F#.
It's true that they have changed over the last couple of years and have adopted open source, etc., but it seems to me that this isn't really because they've become intrinsically "less evil" - it's just because the market has forced their hand, and they now have to choose between future irrelevance and not being evil now.
I am pretty confident that if they once again gain a powerful monopoly like they used to have, they'll abuse it just like they did the last time.
One way they could do that is to bait and switch on open source/linux versions of .NET.
I've looked at F# and it is a nice language, but I don't really want to do any OSS development on it unless Microsoft somehow convinces me with a license that handcuffs future Microsoft so that they won't be able to do that (e.g. GPL, assuming that would work. IANAL).
Regarding the LINQ refactors you mentioned, I'd say those are less about gaining productivity than it is to educate the developer in how code can be refactored. A lot of times, those LINQ refactors turn out considerably less readable, but it's a moment to learn other ways of solving problems.
ASP.NET 5 still runs Mono by default on OS X, but you can switch to .NET Core with the DNVM tool [2].
Note the blog post from yesterday by the F# team on F# 4. [3]
[1] https://github.com/dotnet/coreclr#get-net-core
[2] https://github.com/aspnet/home#os-x
[3] http://blogs.msdn.com/b/dotnet/archive/2015/04/29/rounding-o...
brew tap aspnet/dnx
brew update
brew install dnvm
dnvm upgrade
From https://github.com/aspnet/Home/blob/dev/README.md#os-xThere are some hello world examples in the repo listed above as well. If you'd like, you can develop with the recently announced Visual Studio Code, announced ~yesterday.
I think this is still Mono, but full MSFT support of *Nix is said to be underway.
A job search on indeed.com (a job listing consolidator) within 25 miles of my area, Santa Monica, CA reveals
2,477 jobs for .NET
2,083 jobs for Java
1,284 jobs for python
685 jobs for Ruby
Here are # of questions with following tags on StackOverflow:
Java: 845,330
C#: 786,850
Python: 417,737
Ruby: 132,074
I can't speak for the rest of the world, but I would guess if you looked at 200 of the largest companies in Los Angeles, 90% of them have at least some .NET code running for something. It's pretty ubiquitous.
Games and business software are two huge industries which are almost entirely Windows. Everyone using the massively popular Unity engine is a C# developer.
http://blog.xamarin.com/xamarin-passes-1-million-developer-m...
I agree that .NET has less opensource tools because a lot of things are just provided by Microsoft out of the box, and there are many areas it's not popular - but there are many OSS projects and they match the things I saw in Python and Clojure community.
I would say his posts proves another point - a lot of people in open-source are unfriendly to .NET because of Microsoft origin and they like to spread FUD. I remember when Mono was getting started and every thread on every news board would bring up how it's "patented/copyrighted" even when Microsoft gave .NET community patent promise and made CLI a standard.
When I contributed patches to Mono and talking to other .NET developers on social networks I never saw this "unfriendliness towards OSS".
Where's the Django for .NET?
- IDE Visual Studio 2012 & 2013
- Framework Microsoft ASP.NET (version 4.0) on .NET 4.5
- Web Framework ASP.NET MVC 5 with MiniProfiler
- View Engine Razor 3
- Browser Framework jQuery 1.7.1
- Data Access Layer LINQ to SQL and Dapper
- Cache / Additional Data redis 2.8.4 via StackExchange.Redis, with serialization via protobuf-net
- Source Control Git using a self-hosted GitLab instance (previously Mercurial from 2010–2014, Subversion from 2008–2010)
- Compare Tool Beyond Compare 3
Disqus on the other hand (originally based on python/Django) sounds like they've rewritten a lot of their core components into Go. [3] At the end of the day any solid web framework will still need caching thrown in front of it along with high levels of custom tailoring. Both Disqus and SO have done that. Either way the .NET stack has long since proven itself as a capable foundation.[1] http://meta.stackexchange.com/a/10370
[2] http://stackexchange.com/performance
[3] http://highscalability.com/blog/2014/5/7/update-on-disqus-it...
I said that Django is a better framework for this reason, not your straw man reason.
Scalability is barely an issue. You can horizontally scale both frameworks virtually endlessly if you maintain application statelessness. Dick measuring contests about which company uses what and has the most pageviews do not contribute much to the discussion. Are you going to argue that PHP is a good language because Facebook has a billion users?
You're going to have to link me to the comment where you "referred to" and "said" all of that, because this was all I saw:
Where's the Django for .NET? and Does the same sort of thing, but is not nearly as good.
So maybe I got foolishly got myself into this by bothering to respond to two zero-effort comments. It wasn't a dick measuring contest, the point of the exercise was to examine that a .NET stack (including ASP.NET MVC at its core) can be executed upon with finesse and tuned to efficiency at high operational capacity. Futhermore, other frameworks (i.e. Django) aren't short of their own troubles.