News for hackers. Stuff that matters.
Re:Introducing .NET Core by dominotw on Thursday December 04, 2014 @07:47PM (#8702562)
I am betting on F# taking off big time.

None of the existing functional languages on linux could deliver on functional programming hype. Clojure is too ugly, Scala is too complicated, Haskell too arcane.

Re:Introducing .NET Core by MichaelGG on Thursday December 04, 2014 @10:23PM (#8702887)
I thought the same too, back when I really started into F# (2007 or so). But is it really taking off? People are still scared, worried that "it's hard to understand" (despite it being the opposite). Or that "it's hard to find F# developers" (which isn't true, a: anyone good can easily pick it up, b: advertising F#, like Haskell, will get a lot of people to fight for the jobs since it's rare to get paid to work with a great language).

Microsoft itself does not seem to give F# much resources. It's there, they've made some feature additions, improved VS support a bit. But not even 10% of what the C# team has for features. Microsoft refrains from telling people "you should use F#" which is good advice for all but the most terrible of enterprise environments.

F# is amazing because it's a solid language with great tooling support and fantastic interop (C, .NET) for excellent library access. I honestly believe there's nothing that quite matches it. Scala might be closest with tooling and JVM access.

Re:Introducing .NET Core by pjmlp on Friday December 05, 2014 @03:37AM (#8703466)
> But is it really taking off?

In Europe yes.

Check Skills Matter webcasts, Norwegian Developers Conference or Øredev.

It is mainly used at financial and insurance industries for data modeling and big data.

This is why type providers were so big for the language.

> Microsoft refrains from telling people "you should use F#" which is good advice for all but the most terrible of enterprise environments.

I already saw some presentations where this was explained as not wanting to scare the traditional enterprise guys.

I kind of understand them, for our customers JVM == Java, .NET == C# or .NET == VB.NET for projects that used to be VB 6 shops.

So how to sell F# to these guys? By making it easy to integrate into their exiting code, as library code not full stack replacements.

Re:Introducing .NET Core by CmonDev on Friday December 05, 2014 @06:00AM (#8703842)
It just doesn't have too many selling points for an enterprise app today. I have looked at it many times but it doesn't offer enough for me to start persuading people to switch. Terse ML-based syntax, lack of ReSharper and C# moving towards the functional side all make F# a less attractive choice. And I don't care about type-providers and all that other jazz they are adding lately too much. I tried to be excited about units of measure, but there isn't even a way to annotate third-party libraries (no, I am not going to rewrite e.g. third-party physics libraries from scratch)!
Re:Introducing .NET Core by latkin on Friday December 05, 2014 @09:04PM (#8708082)
You can certainly annotate 3rd-party libraries. You basically just copy the signatures of the relevant APIs, and decorate arg types and return types with units that enforce the semantics of the problem domain.

Say you have some unit-free external library like this, which you can't modify:

    type RectLib =
        static member Perimiter(w:int, h:int) = 2*w + 2*h
        static member Area(w:int, h:int) = w * h
Wouldn't it be great if we could enforce in our code that `w` and `h` have the same units? Or that the result of `Area` has squared units compared to the result of `Perimiter`?

You can do exactly that, by defining extensions like so:

    module UnitExtensions =
        open LanguagePrimitives
     
        type RectLib with
            static member Perimiter(w:int<'u>, h:int<'u>) =
                RectLib.Perimiter(int w, int h) |> Int32WithMeasure<'u>
                
            static member Area(w:int<'u>, h:int<'u>) =
                RectLib.Area(int w, int h) |> Int32WithMeasure<'u^2>
Now units are enforced by the type system:

    open UnitExtensions

    RectLib.Perimiter(1<m>, 2<ft>)   // error - <m> doesn't match <ft>
    RectLib.Perimiter(3<m>, 4<m>)    // ok

    RectLib.Area(5<m>, 6<m>) + RectLib.Perimiter(7<m>, 8<m>)    // error - <m> doesn't match <m^2>
    RectLib.Area(9<ft>, 10<ft>) + RectLib.Area(11<m>, 12<m>)    // error - <ft^2> doesn't match <m^2>
    RectLib.Area(9<ft>, 10<ft>) + RectLib.Area(11<ft>, 12<ft>)  // ok
Re:Introducing .NET Core by CmonDev on Saturday December 06, 2014 @05:40AM (#8708901)
What about third party types?
Re:Introducing .NET Core by latkin on Saturday December 06, 2014 @03:38PM (#8710118)
I don't think I understand the question. If you prefer, I whipped up a gist on this, we could discuss there. https://gist.github.com/latkin/909d6f88493f049d7f81
Re:Introducing .NET Core by chii on Thursday December 04, 2014 @10:47PM (#8702936)
> anyone good can easily pick it up

with emphasis on 'good'. A SME might not have 'anyone good', and if it's just a back office data entry application, you don't want to use F# (or any of them fancy stuff). You want something any dumb coder can change and add to.

Re:Introducing .NET Core by fsloth on Friday December 05, 2014 @12:14AM (#8703087)
A subset of F# can be used (more or less) as a terser C#. Functional languages make writing correct programs easier. I don't think modifiability of an existing program depends on the language as much from the quality of the code. F# is not difficult, just a bit different.

Functional languages seem to have this odd halo around them that for some reason they are thought to be obscure and non practical. It's probably due to a historical baggage. If Ruby was originally picked up by compiler experts and language afficionados and the only resources that one could find were references to topics in those domains I bet people would be saying the same thing about it.

The main problem for adoption IMO is not language complexity, but rather lack of educational resources that display how easy and nice it's to do simple things on the language.

But since the simple things are so nice and easy it's really straightforward to do something a bit more complex and most of the published examples focus on these more advanced things.

Re:Introducing .NET Core by hga on Friday December 05, 2014 @11:24AM (#8705265)
I would suspect that learning functional programming itself, after pretty much everyone gets started with imperative, could take as much effort as learning OO from the same imperative base (but of course a lot more people now start with something like Python and at least dabble with OO).

I.e. more than an afternoon or probably a month to get good, vs. the few days it takes to learn another language with familiar paradigms.

Not sure from personal experience because I learned functional style Lisp/Scheme really early, more than a decade before OO, which made learning Clojure a relative snap. OO in the form of C++ was harder for me, but maybe functional is just easier for my mind to wrap around. The quality of the Lisp and Scheme texts I used, especially SICP, also probably made a difference (the OO texts I used were good, but not as great, with the exception of OOSE (http://www.amazon.com/Object-Oriented-Software-Engineering-A...), but that's as much about great design of your project as well as what the project is making).

Re:Introducing .NET Core by notduncansmith on Thursday December 04, 2014 @08:13PM (#8702630)
Is "ugliness" the main point of contention with Clojure? It's a Lisp, so sure people will love it or hate it, but I hadn't heard this criticism directed specifically at Clojure until now.
Re:Introducing .NET Core by kitsune_ on Friday December 05, 2014 @03:20AM (#8703423)
Objective-C is in my eye an example of an 'ugly' language (syntax wise), most definitely not Clojure.
Re:Introducing .NET Core by pjmlp on Friday December 05, 2014 @03:26AM (#8703435)
I learned it when NeXT still existed. Could never get around all those [] and using @keywords everywhere.
Re:Introducing .NET Core by teh_klev on Friday December 05, 2014 @12:18PM (#8705569)
All that sleek looking industrial design...and then...that. :)
Re:Introducing .NET Core by oscargrouch on Thursday December 04, 2014 @10:10PM (#8702858)
As someone who have tried clojure a little bit after it was launched , but after a while dropped; my personal view is that Lisps are great for small stuff, but once you need to go for something bigger, with big teams, the thing start to melt down.

And here is where OOP shines.. The probable "winners" of the languages of the next decade will be OOP ones that glue well with functional techniques and functional languages that are very good at OOP techniques.

F# is really good here, and from the OOP side C# and Java are also running for this trophy (again).

Maybe swift.. but we need to see if the adoption will have a limit, given its tied to a closed platform, and its also closed source

(But Rich Hickey is a bad ass and the framework design behind clojure is a piece of art)

Re:Introducing .NET Core by jared314 on Thursday December 04, 2014 @10:26PM (#8702896)
> but once you need to go for something bigger, with big teams, the thing start to melt down.

The people in the Clojure community have already started exploring this issue. Component [1] [2], Jig [3], and others are trying to add just enough OOP back for the reasons you mentioned.

[1] https://github.com/stuartsierra/component

[2] https://www.youtube.com/watch?v=13cmHf_kt-Q

[3] https://github.com/juxt/jig

Re:Introducing .NET Core by nickik on Friday December 05, 2014 @12:54AM (#8703156)
> after it was launched

That is quite a while ago, back then it was mainly one guy who write a compiler, by kmow we have a awesome build and project tool, pretty good editor options, CSP, logic prrogramming, static typesystems, awesome validatiin librarys, a fantastic pattern match ...

In terms of organisation, I would suggest looking at the 'components' library, it takrs the good things of OOP design for things like managing services. Clojure has great namespaces also.

Re:Introducing .NET Core by dominotw on Thursday December 04, 2014 @08:42PM (#8702703)
Well, thats my personal view. I suspect thats how lots of people feel too, given it has not seen any major adoption despite being relentlessly hyped for last couple of years[1].

Also, F# is already in top 20 with relatively little fanfare.

http://www.tiobe.com/index.php/content/paperinfo/tpci/index....

Re:Introducing .NET Core by dmix on Friday December 05, 2014 @12:46AM (#8703143)
Github most popular languages 2014:

Rank 19. Clojure Rank 46. F#

Source https://jaxbot.me/articles/github-most-popular-languages

FWIW on that TIOBE list Delphi/Pascal is listed as more popular than F#.

Re:Introducing .NET Core by pjmlp on Friday December 05, 2014 @07:32AM (#8704156)
It baffles me people use Github to measure anything.

Most of the enterprise projects are not even using Git!

Re:Introducing .NET Core by dmix on Friday December 05, 2014 @11:54AM (#8705444)
Nor is Clojure particularly aimed at the TIOBE audience. So they're both pretty useless metrics. But it is disingenuous to say Clojure has reached a mass adoption when it's one of the most popular languages on an OSS site. That it said not popular 'in the enterprise' or 'in the business world' then I'd agree.
Re:Introducing .NET Core by CmonDev on Friday December 05, 2014 @06:06AM (#8703867)
Yes, financial industry is rushing to put their F# projects on GitHub. And the size of the repository certainly doesn't matter.
Re:Introducing .NET Core by ak39 on Friday December 05, 2014 @04:31AM (#8703593)
There's some selection bias here. Github will promote languages that are classically open source friendly - or have a heritage in open source. Languages like Ruby, Javascript and Java will naturally feature higher in such popularity shootouts.

This may not be the case in the world of enterprise, closed-source software.

Re:Introducing .NET Core by cheepin on Thursday December 04, 2014 @08:18PM (#8702646)
Not usually. I usually hear that it's either confusing or that people prefer functional languages with static typing over the dynamic flavor.
Re:Introducing .NET Core by whateveracct on Thursday December 04, 2014 @08:19PM (#8702649)
F# won't draw especially draw people away from those three languages though. It doesn't have the sort of type system Scala and Haskell people love, it isn't a Lisp or dynamically typed so most Clojure people won't care, and it doesn't work with Java so it won't draw people away who are using Scala on top of older Java systems.
Re:Introducing .NET Core by adambard on Friday December 05, 2014 @02:51PM (#8706482)
I'm no expert, but I have the impression that F# has a strong type system, being an ML variant (perhaps sacrificing a bit for CLR compatibility).

I'm a big fan of Clojure and a dabbler in OCaml/Haskell, and I feel that F# has a lot to offer in terms of library access, same as Clojure/Scala for the JVM. In any case, I'm certainly happy its there in case I ever have occasion to work with .NET.

Re:Introducing .NET Core by jimmaswell on Thursday December 04, 2014 @09:24PM (#8702781)
There are efforts at Java/CLR runtime interop
Re:Introducing .NET Core by thomasz on Friday December 05, 2014 @03:38AM (#8703469)
http://www.ikvm.net/ runs java bytecode on the CLR
Re:Introducing .NET Core by hga on Thursday December 04, 2014 @07:59PM (#8702597)
Doesn't Linux have a relatively close relative to F# in OCaml? Which has had some successes, like on top of Xen and at Jane Street, but as far as I can tell has taken the world less by storm than your other mentioned options.
Re:Introducing .NET Core by cheepin on Thursday December 04, 2014 @08:16PM (#8702639)
F# is very close to OCaml (each language has a few features the other doesn't have). I love OCaml, but Visual Studio's F# integration is why I use F# now. The tooling for other functional langauges has seemed lacking to me, but having a legitimate debugger and intellisense and error highlighting as I type has been a delight.
Re:Introducing .NET Core by arjunnarayan on Thursday December 04, 2014 @10:24PM (#8702892)
Having access to the .NET libraries is huge. Despite Jane Streets efforts with Core, the OCaml standard libraries just don't cut it.
Re:Introducing .NET Core by hhandoko on Thursday December 04, 2014 @10:32PM (#8702909)
I actually find Scala quite pleasant to use. What aspect do you find it being too complicated?

I've seen Scala code styles within a wide spectrum of OO <---> FP, which can be both positive and negative. My only complaint, is that compilation takes longer than Java code. I learnt to live with it for now, and I am sure the Typesafe team are working hard to address it.

Re:Introducing .NET Core by actsasbuffoon on Friday December 05, 2014 @07:36AM (#8704172)
I like Scala, but it seems like it tries too hard to accommodate every possible programmer. If you stick to the OO side of Scala and avoid FP then it's similar to Java. Add some higher order functions to the mix and you'll get a mixture of OO and FP that dynamic language users will love. If you don't like higher order functions then you can sugar them with for-comprehensions, and suddenly it looks familiar to Pythonistas. Pull in Scalaz and now you've got monads, monoids, applicative functors, and all the other goodies you'd hope to have in Haskell-like languages.

On my team we've got a mix of backgrounds. We've got people who've done Java, a gaggle of diehard Pythonistas, our CTO is a badass Rubyist, and I can't seem to shut the hell up about Haskell. Our Scala looks like it suffers from multiple personality disorder at times.

Scala: we like you. You don't have to try so hard to impress us. Just tell us how you really feel instead of trying to figure out what we want to hear.

Re:Introducing .NET Core by Rapzid on Saturday December 06, 2014 @03:36AM (#8708726)
Clojure is beautiful. EDN is beautiful. I've honestly never known anyone to start learning Clojure and not become enthralled with its syntax.

I don't even use Clojure outside of Riemann for work but when I was learning Clojure the more I learned the more fantastic I felt it's syntax was.

I have also started investing a lot of my spare time into learning F# which I also really like. It's my first ML and the aspects that assist with domain modeling are fantastic(discriminated unions, option types, etc, etc). Fsharp interactive opens up a lot of possibilities too. While I like it's syntax better than Scala's and it's very terse, it still just bolstered my opinion on the elegance of Clojure.

Re:Introducing .NET Core by ploxiln on Friday December 05, 2014 @12:28AM (#8703110)
This is a pretty weird opinion. How could the idea that F# "delivers where other functional languages didn't" be anything but strange Microsoft hype? or is this a joke?

The existing functional languages (which also notably include ocaml and common lisp on SBCL), "on linux", happen to also run on OS X, BSD, and some of them on Windows too. Could you really think those all suck, but F# is great?

Re:Introducing .NET Core by fsloth on Friday December 05, 2014 @02:41AM (#8703341)
Respectfully, there is a difference between "It is feasible to compile an executable" and "has industry grade support and tooling".

If we discuss just tooling on windows, I heartily concur with the assessment that "F# delivers where other functional languages didn't".

I've tried those other languages. I've not yet met anything that would compare with the integration in Visual Studio with the F# command line, project tooling and the .Net ecosystem.

Unfortunately I've not tested F# on my Ubuntu boot, but on Windows as functional languages go it is an absolute joy to develop with. Clojure's toolchain comes pretty close, but not quite. For example, FFI to C is much nicer in .Net.

Whatever the overall company culture may be, Microsoft actually has lots of bright and well intending software folks working for them, and F# is clearly a labour of love brought to fruition there.

Re:Introducing .NET Core by melling on Thursday December 04, 2014 @11:04PM (#8702969)
F# does look exciting. How are the Linux and Mac Mono implementations? Are they usable for production code?
Re:Introducing .NET Core by g8gggu89 on Friday December 05, 2014 @01:13AM (#8703192)
It's an almost-verbatim copy of OCaml. How is it going to deliver any better?
Re:Introducing .NET Core by fsloth on Friday December 05, 2014 @02:47AM (#8703358)
Caveat: I can vouch for the following only on Windows desktop.

I would say F# is an implementation that includes all the good parts of Ocaml the language and .Net the ecosystem.

Very good tooling. A feasible multithreading story. Industry level support.

A pet of mine: Has ecosystem support for real time graphics (OpenTK, Monogame, etc).

Re:Introducing .NET Core by lpw25 on Friday December 05, 2014 @06:47AM (#8704017)
> I would say F# is an implementation that includes all the good parts of Ocaml the language

I like F#, but this just isn't true:

- Polymorphic variants

- GADTs

- Module system

The last one, in particular, is one of the best features of OCaml.

Re:Introducing .NET Core by fsloth on Friday December 05, 2014 @08:03AM (#8704274)
Sorry, I was a bit imprecise. I was thinking only about basic stuff like list operations being supported in the basic syntax, algebraic datatypes, pattern matching and optional mutability.
Re:Introducing .NET Core by danieldk on Friday December 05, 2014 @02:43AM (#8703346)
Instant availability of the entire .NET ecosystem? Good IDE? Support for parallelisation within a proces?
Re:Introducing .NET Core by dragonwriter on Friday December 05, 2014 @01:32AM (#8703228)
How is F# any less arcane than Haskell or any other ML-famiy language?
Re:Introducing .NET Core by fsloth on Friday December 05, 2014 @02:52AM (#8703368)
F# was developed from day 1 as an industrial tool. The point is to bring the practical stuff from those... ahem... 'arcane' languages to a platform with industrial tooling and an existing ecosystem.

F# can be used almost exactly like C#, and the ML-features can be used once understood.

While F# encourages immutability it can be used as a mutable language which means lots of familiar algorithms are easy to implement in it.

Re:Introducing .NET Core by danieldk on Friday December 05, 2014 @02:45AM (#8703352)
It can leverage the .NET ecoystem.

Downside (on UNIX) will be that it fits in less with the UNIX philosophy than OCaml or Haskell will (though, with AOT compilation it will probably get closer).

Re:Introducing .NET Core by Paradigma11 on Friday December 05, 2014 @08:55AM (#8704461)
strict eval and mutable state.
Re:Introducing .NET Core by dragonwriter on Friday December 05, 2014 @10:10AM (#8704871)
That's different than Haskell, sure, but in exactly the same way virtually every other ML-family language -- including Standard ML itself -- is different from Haskell.
Re:Introducing .NET Core by e12e on Friday December 05, 2014 @12:28AM (#8703109)
I see you left out ocaml?