An Interview With F# Creator Don Syme 267
OCatenac passes along an interview with Don Syme, chief designer of F#, which is Microsoft Research's offering for functional programming on the .Net platform. Like Scala, which we discussed last fall, F# aims at being an optimal blend of functional and object-oriented languages. "[Q] What is the best program you've seen written in F#? [A] I've mentioned the samples from F# for Scientists, which are very compelling... For commercial impact then the uses of F# in the finance industry have been very convincing, but probably nothing beats the uses of F# to implement statistical machine learning algorithms as part of the Bing advertisement delivery machinery. ... We've recently really focused on ensuring that programming in F# is simple and intuitive. For example, I greatly enjoyed working with a high-school student who learned F#. After a few days she was accurately modifying a solar system simulator, despite the fact she'd never programmed before. You really learn a lot by watching a student at that stage."
Checkbox marketing (Score:4, Insightful)
and the emotive language and buzzwords
*yawn* unconvinced.
F# is awesome (Score:1, Insightful)
As a longtime programmer in languages such as C++, Java, C# etc, and having explored many other dynamic and functional languages such as Perl, Python, Ruby, Haskell, and Lisp, I can honestly say that F# is now hands down my favorite language. There are a few reasons:
- it's like the best parts of all the paradigms rolled into one. Statically typed, but with automatic type inference to do most of the work for you. Fantastic generics - every function is generic without any of the scary syntax or mental overhead. First class functions, closures, all that good functional stuff. All the same objected oriented features you'd have in C#. All the garbage collection etc of the .NET platform. You can do things in almost any style you want and it never feels like you have to fight the language.
Of course, pick and choose your language, and you can find many of those features elsewhere. But here's the best part:
- it runs on .NET. You can use all of the .NET libraries, no need to hunt for and integrate third party libraries that are half implemented because of your wacky obscure language choice.
- you can sell it to your boss. Supported as an official MS product and included in Visual Studio 2010. Integrates flawlessly with C#. Has a great IDE already. Draw your WPF GUI in Expression Web if you feel like it and write the backend in F#.
Honestly I never want to go back. It's like that Paul Graham essay where he talks about how Lisp is so productive that his company killed the competition. Now I feel like every line of C#/C++ I write is a waste of my time.
Comment removed (Score:3, Insightful)
FParsec (Score:4, Insightful)
There's one particular reason to look at F#, and that's FParsec [quanttec.com]. Parser combinators are just awesome, and don't get me wrong - I like the original Parsec, and Haskell in general! - but its IDE support is minimal, and debugging it is a pain.
With F#, you get the same awesome tool, but in an environment where you can actually use it for day-to-day jobs - write any parsing code as an F# library using FParsec, and call it from the main body of C#/VB/IronPython code.
Not even going to RTFA (Score:1, Insightful)
Re:never programmed before??? (Score:3, Insightful)
He was probably modded as troll because, while he may be entirely correct about "marketing droids", the conclusion that "F# stinks" doesn't exactly follow from that - unless he has some specific horror stories to share. Or at least saw the language, and is qualified to judge on its merits (i.e. familiar with similar existing languages).
Re:The optimal blend... (Score:3, Insightful)
So why do we have so many unique languages?
It's because we don't have a clear idea on which language features are good, and which aren't. If you ask someone (say, me ~), you'll probably get a straightforward reply, but if you ask another guy, he is quite likely to strongly disagree on many major points.
There are many arguments both for and against dynamic typing, for example. There are similarly many arguments for and against OOP. There are advantages of having code pre-compiled to native, and there are also advantages of having a VM with a JIT compiler. Tracing GC vs manual memory management (+ smart pointers). The list goes on and on...
Within the static typing camp, there are still unsolved issues with the expressivity of type systems - some believe that typeclasses (Haskell-style) are the way to go, but there are still some unresolved problems there for more complex things. Some want effect typing [haskell.org]. Some decry both as overcomplicated, and say that they're overkill, and it's easier to simplify the code.
Then there are bleeding-edge language features. Do we need STM? Do we even want it - can it be efficiently implemented at all?
Consequently, you get different languages, depending on which of the above (and many other) points are emphasized. Lately, we're starting to get more "kitchen sink" languages combining all approaches in hope that all of them are useful to one extent or another. F# is actually such a language, in a sense, being hybrid FP/OO (it also has "duck typing" member access, though no means to define true dynamic classes as in Python or Ruby). Scala is even more so.
Existing languages are also heading in the same direction - C# is a good example of that, starting its life as Java-like OO language, then getting some FP features in 2.0, a major FP'esque facelift in 3.0, and now duck typing in the upcoming 4.0.
By the way, F# isn't really a new language. The base language is ML, which is over 30 years old now. The specific ML dialect from which F# is derived is OCaml - that one is still in active development, but got started 14 years ago.
Re:Checkbox marketing (Score:3, Insightful)
Somebody wrote a bad program in C# that crashed and somebody else wrote a better program at another company on Java and it didn't crash. What more evidence does one need that .Net is crap?
Re:never programmed before??? (Score:4, Insightful)
F# version is essentially the same as OCaml version. In practice, you will notice that there are a lot of people who prefer OCaml to Haskell even today, and that has to do with quality of implementation. Haskell is a nice language on the paper, but its laziness makes it both hard to implement fast, and insanely hard to debug.
With F#, you get language on par with OCaml (so less high-level and expressive than Haskell). But you also get the ability to directly call any existing .NET library - no wrappers or FFI declarations needed. Furthermore, you get an IDE with syntax highlighting, code completion, error checking as you type, and debugging.
Also, keep in mind that most people who get acquainted with F# today aren't familiar with Haskell. In fact, most of them don't even know it exists. They are C++, C# and VB users, who suddenly discover a new project type in VS2010, and are curious as to what this is all about. For them, the basis of comparison will be a typical imperative OO language, not Haskell - and most marketing materials are written with that in mind. It is generally assumed that people who know Haskell can judge these kind of things on their own :)
a fully productized and supported language (Score:1, Insightful)
Re:a fully productized and supported language (Score:3, Insightful)
There is a basic rule about writing programs - choose not a vendor specific language, and the useful lifetime of your program will surpass the life of your hardware.
F# is really just an OCaml variant anyway. Why should I buy something that is locked into a particular vendor and OS when I can get the same thing for free and run it on all the systems I own?
This article smacks of marketing to developers too much for me to feel comfortable with it... ok for Microsoft tards but not for people who haven't sold their souls.
Re:Checkbox marketing (Score:3, Insightful)
I've learned Turbo Pascal as my first language back then in 1991. Currently I develop in C for embedded Linux, but I still like Pascal better because I happen to like comfort better than hardships.
Re:Checkbox marketing (Score:2, Insightful)
"it's not just *one* bad program in C# that crashes, it's everyone who works with computers that has come across one badly written .NET system after another."
Obviously your claim for "everyone" is not valid. I guess in this case the plural of anecdote is fabrication.
Knee-jerk moderation? (Score:3, Insightful)
As one might expect, you can get moderated as Flamebait if you say the same thing about opensource as somebody said about .Net.
The funny thing is that the moderator missed the point. The AC was mocking the logic of the other poster, not really making a statement about OSS projects.