News for hackers. Stuff that matters.
Re:Microsoft takes .NET open source and cross-platform by rip747 on Wednesday November 12, 2014 @02:04PM (#8597460)
LINQ is _the_ only reason I tolerate .net
Re:Microsoft takes .NET open source and cross-platform by alkonaut on Wednesday November 12, 2014 @03:53PM (#8598072)
You mean C#? Let's keep those separate shall we?

Linq makes C# much better, especially compared to java. It's a whole different story in F# though.

Re:Microsoft takes .NET open source and cross-platform by Filligree on Wednesday November 12, 2014 @04:43PM (#8598410)
What's the story for F#?

I'm a Haskell enthusiast, but it's not so good at Windows support, or libraries. I've been thinking F# might be just the ticket.

Re:Microsoft takes .NET open source and cross-platform by alkonaut on Wednesday November 12, 2014 @05:05PM (#8598567)
F# has a huge momentum at the moment. Quickly rising in the Tiobe index. It's an ML-style functional lang for the CLR. It's not as powerful or pure as Haskell in terms of type system and style, and it is lacking (or is more pragmatic) in a few places to be interoperable with other .NET langs. It has some really cool features though that are quite unique, such as

Type providers http://fsharp.github.io/FSharp.Data/library/JsonProvider.htm... Code quotations http://msdn.microsoft.com/en-us/library/dd233212.aspx

Most importantly it has become a first class citizen of the ecosystem so the tooling is already great compared to a lot of similar languages.

http://fsharp.org/

Re:Microsoft takes .NET open source and cross-platform by ghuntley on Wednesday November 12, 2014 @10:21PM (#8599729)
F# 4.0 pre-release was just announced/shipped:

http://blogs.msdn.com/b/fsharpteam/archive/2014/11/12/announ...

Re:Microsoft takes .NET open source and cross-platform by louthy on Wednesday November 12, 2014 @05:04PM (#8598564)
F# has Query Expressions[1] which are just Computation Expressions[2], i.e. not a language extension, a library.

If you know Haskell then it's pretty easy to get into F#. The only thing you'll miss are higher-kinded types. Although they can be hacked in[3], it's not really worth the effort a lot of the time

[1] http://msdn.microsoft.com/en-GB/library/hh225374.aspx

[2] http://msdn.microsoft.com/en-us/library/dd233182.aspx

[3] https://code.google.com/p/fsharp-typeclasses/

Re:Microsoft takes .NET open source and cross-platform by platz on Wednesday November 12, 2014 @07:33PM (#8599274)
Agree - also I think f# can't dispatch on the return type of a polymorphic expression as I thought that was only possible with type classes?
Re:Microsoft takes .NET open source and cross-platform by louthy on Wednesday November 12, 2014 @10:32PM (#8599763)
I think it's possible by including the return-type in the argument list and using inline operators. You really have to jump through hoops though to make it work and the resulting code is damn ugly. Take a look at the source for FsControl[1]. It implements what they call 'type methods'. So there's types for Monad.Bind, Functor.Map, Applicative.Pure, etc.

I'm still trying to get my head around it; I thought I'd try to do so by implementing the core types and functions in Haskell's Pipes. So far I've managed to convince the F# compiler to take well over an hour to compile 70 lines of code!

The main argument against them has been lack of CLR support. But it seems that there's already the FsControl way, so I think some syntactic sugar would go a long way.

So yeah, until there's language support for type-classes I think it's probably not worth it.

[1] https://github.com/gmpl/FsControl

Re:Microsoft takes .NET open source and cross-platform by platz on Thursday November 13, 2014 @11:49AM (#8602484)
oh, this is such a great response to a question that I didn't think anyone would be able to answer - thank you!

I'll have to go study FsControl now ;)

Re:Microsoft takes .NET open source and cross-platform by louthy on Thursday November 13, 2014 @12:00PM (#8602563)
My pleasure :)