3 ms·
But look at C# - since after they shipped version 3, they practically stopped doing anything neat with it. They haven't cleaned up any of the v3 features introd
by MichaelGG 13y ago
But look at C# - since after they shipped version 3, they practically stopped doing anything neat with it. They haven't cleaned up any of the v3 features introduced (like type inference or expression trees) - it's just sitting there. In fact, from some of the statements I've read, it sounds like MS has purposely stagnated C# to avoid alienating their enterprise customers.
They mismarket F#, preferring to say it's for scientists and financial programmers. Instead of marketing it as what it is, a much more capable language all-around, unless you need certain GUI/tooling support.
These kinda things don't help .NET's reputation. If a non-MS affiliated company marketed a language as lean as F#, with as good a runtime and editor/debugger, they'd be a huge amount of "hipster" cred and praise.
- Mikeb85 13y ago> If a non-MS affiliated company marketed a language as lean as F#, with as good a runtime and editor/debugger, they'd be a huge amount of "hipster" cred and praise. OCaml? Which is what F# is based on, compiles to anything (including fast native code), and is open-source?
- MichaelGG 13y agoAre OCaml's main libraries even threadsafe yet? Is there a smooth editor/debugger like Visual Studio? Just a quick look says the Windows version of OCaml doesn't even have a debugger. OCaml is neat, and more advanced than F# in some aspects, but I'm not sure the dev experience is nearly as slick. Another thing not mentioned: libraries. Anything half-well designed on JVM or .NET has access to a massive amount of libraries (and both stdlibs are pretty complete). Depending on the project, that's not a trivial consideration. More info from a biased source: https://www.quora.com/Functional-Programming/How-does-F-compare-to-OCaml/answer/Jon-Harrop-2?srid=OjRF&share=1 https://www.quora.com/Functional-Programming/How-does-F-comp...
- gaius 13y agoYou can get a fairly complete stdlib on OCaml too, as long as you are willing to commit yourself to using Jane Street Core rather than the one that comes with the language.
- nbevans 13y agoF# is open source too. </minor pedant>
- Mikeb85 13y agoThe runtime (.NET) isn't...
- MichaelGG 13y agoThe runtime is actually the CLI, which is a standard and has open source implementations.
- nbevans 13y agoI assume you're referring to the CLR here? As in: http://en.wikipedia.org/wiki/Common_Language_Runtime http://en.wikipedia.org/wiki/Common_Language_Runtime Whilst no, the Microsoft CLR is not open source. It doesn't need to be. Because the CLI is a ECMA standard and known-good third party implementations (Mono) already exist. The only thing to be gained from open sourcing the Microsoft CLR would be to benefit Mono. As Mono is the defacto official cross-platform port of the CLR. Since the Microsoft CLR almost certainly contains IP and trade secrets that they wouldn't want their commercial rivals to see, it would be more beneficial if Microsoft merely gave a fairly open code sharing and IP license to the Mono / Xamarin team so that they could benefit in the exact same way as though it were OSS MIT.
- profquail 13y agoI suspect F# can also be compiled to nearly anything OCaml can be -- that is specifically the point of the Code Quotations feature of the language. F# is also open-source (https://github.com/fsharp/fsharp https://github.com/fsharp/fsharp). Why do you keep implying it isn't?
- Mikeb85 13y agoThe .NET runtime isn't open source... I like how this is down-voted as though it isn't true...
- MichaelGG 13y agoPerhaps because you're being pedantic about .NET versus the CLI? The CLI spec is a standard and open source. Microsoft's own version isn't open source (well, they did release an "open" source version, Rotor). But Mono's is.
- profquail 13y agoCorrect -- the .NET runtime isn't open source. F# has a very strong following on Mono though. In fact, I suspect a higher percentage of F# developers develop and/or deploy on Mono than any other language does. You may not know this, but F# ships with the Mono distribution for OS X, and it may well ship with the Linux packages before long. BTW, I maintain the F# port for FreeBSD, and the combination of F#, Mono 3.2.x, FreeBSD 10, and emacs is extremely fast and stable. http://fsharp.org/use/freebsd http://fsharp.org/use/freebsd
- platz 13y agoI think the performance of Mono on Linux is a bit lacking though, compared to other Linux VM's/Runtimes or the Windows CLR runtime.
- profquail 13y agoThat's true. Mono is generally slower than the CLR, though it has been improving ever since Xamarin took over. There's also an option now to use LLVM as the JIT compilation engine in Mono; for server-based applications (where steady-state performance matters more than start-up time), this can greatly improve the performance thanks to LLVM's optimizer. With the improvements in the latest 3.2.x branch, I think Mono's performance is at least "good enough" for many use cases. FWIW, I do a bit of F# + Mono development on FreeBSD 9 (and now FreeBSD 10) and have found the performance to be quite good. I wrote an installation guide (http://fsharp.org/use/freebsd http://fsharp.org/use/freebsd) if you want to give it a try, e.g., in a VirtualBox VM.
- stevecooperorg 13y agoC# 4 added serious dynamic typing, so that you can make ruby/pthon/js-style dynamic objects; // properties not declared anywhere; runtime property definitions dynamic myObject = new JavaScriptStyleObject(); myObject.firstProperty = "hello"; myObject.secondProperty = 1; C#5 added async/await, which I think is one of the most 'integrated' ways I've seen of doing async programming. Think node.js with a lot less syntactic cruft around the callback functions; in C#5 you could write, say; // evented I/O using the 'await' keyword; var fileContent = await ReadFile(@"c:\foo.txt"); Console.WriteLine(fileContent); rather than; fs.readFile('c:\\foo.txt', 'utf8', function (err,data) { console.log(data); }); This eliminates the need to write lambdas while retaining the evented I/O style. Both of these seem pretty significant.
- MichaelGG 13y agoBoth of which have been in F# for years, and C# re-implemented them later, poorly. F#'s dynamic is extensible (and around since 2007? 2008? earlier?)). If you wanted to implement a "dynamo" object, go ahead. If you want loosely typed CSV-reader access, go ahead. (You get the ? and ?<- operators to define as you'd like.) C#'s async comes from F#'s async (available since Oct 2007), which in F# is just a library. That's because F# supports workflows aka computation expressions aka warm fuzzy things. What F# does as a library feature, C# requires baking into the compiler. So for 5 years now, MS has added these two features. They've still yet to deliver a REPL, or finish implementing type inference, or any such stuff. It looks like Anders Hejlsberg, the main C# designer, seems more interested in adding some basic features to JavaScript, lately. C# seems fairly abandoned, language-wise, to me. They seem to be content to have put Java in its place, and leave it at that. P.S. C#'s a great language, and I'm not trying to insult the people that have done great work on it. As a popular language, it's one of the nicest ones out there IMO.
- stevecooperorg 13y agoI would dearly love for the C# type system to get a bit stronger and less verbose. It's also confused, I think, because you have explicit classes, anonymous types, and dynamic, and they aren't always very well put together. I actually also like what Anders did in TypeScript around structural types, and wouldn't mind some of that mojo in C#. I take your point about pace, though. I wonder how it compares over the same timeframe vs other languages? In the 5 years for C# to cover that distance, what have other languages achieved? The biggies are particularly interesting (JavaScript, Python, Ruby, Java, C++, etc) because users probably demand more in terms of support and compatibility. (For others contributing, I'm thinking language-specific, so not libraries, frameworks, or runtimes, just pure syntax.) It's also worth throwing uptake into the mix here; it's not much use if there's a version of the language defined in a spec but everyone's using the compiler from 1999 (JavaScript, I'm looking at you) I'm not a pythonista but I understand Python 3 has struggled with uptake, too. Not too sure of the details; happy to be corrected.
- nbevans 13y agoThey've admitted that progress has slowed but have also explained why and it's got nothing to do with enterprise customers. The reason is that they're rewriting the C# compiler using, er, C#. It's as part of an initiative called "Roslyn" that aims to make the compiler a pluggable component with a public API for the compilation AST. They did a blog post recently explaining that whilst this work is ongoing they are trying not to change the C# language too much to aid them with testing and verification. But that once Roslyn is released they will start a fresh wave of language enhancements for C#. I think we all have some ideas on what those will be to start off with... proper tuples support, and probably some form of pattern matching.
- junkyarddog 13y agoSo basically, the plan is to turn C# into F# with curly braces.
- spo81rty 13y agoWhat?? Visual Studio 2013 just shipped a week ago. They have released 5 versions of the MVC framework in the last 3 years or so. The new async/await stuff is fantastic. EF6 is new. SignalR is new. We get new Windows Azure SDKs every 3 months or so. They are constantly improving everything.
- MichaelGG 13y agoNone of that, except async, is a C# feature. And that was taken from a 6-year-old F# feature of the same name, except in F#, it was implemented as a library, not baked into the compiler. MS is moving .NET ahead as a platform, but C# doesn't seem to be doing much. As another comment said, they're rewriting the compiler and then are supposed to make it take off again. Still, 5 years with minimal additions seems "stagnant" to me.
- overgard 13y agoIf you look at how much has been added to say, python or ruby or java in the same time frame it seems comparable. .NET 4 (released in 2010, so really only 3 years ago) added a ton of new features (dynamic, better generics, better expression trees, optional paramters, etc.). NET 4.5 was comparatively a more quiet, but I think that's just a consequence of the language maturing.
- MichaelGG 13y agoC# 4 did bring forward the covariance/contravariance feature that's been in the CLR since v2, yes. And they did add dynamic, which was the big major feature of v4. Better expression trees, as I understand, aren't accessible from C#. That is, the C# compiler doesn't allow you to write arbitrary code as an expression. What shipped was the DLR-based expression trees, which are more flexible, but require a cumbersome API. So that's not really a feature. (Correct me if I'm wrong; I haven't used C# extensively since 3.0 as I moved to F# for .NET tasks.) Optional parameters were a mistake to leave out of the original spec. MS insisted that providing a ton of method overloads was a more elegant approach, for some insane reason. And at any rate, the C# implementation C# is the same, lame, VB/C-style callsite embedded optional parameters, which hampers their usefulness (but it's still much better than overloads!). Perhaps I have unrealistic expectations from C#, as I certainly don't appreciate the effort required to design a language for such widespread use.