Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Programming

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."
This discussion has been archived. No new comments can be posted.

An Interview With F# Creator Don Syme

Comments Filter:
  • by Wingman 5 ( 551897 ) on Sunday February 07, 2010 @03:41AM (#31050946)
    Will D flat be the same language as c#?
  • Being an old fuddy-duddy, my first thought that Microsoft was doing a dot NET version of Fortran, but...

    Obvious retort is why?

    • Re: (Score:2, Interesting)

      by serps ( 517783 )

      According to wikipedia (yeah, I know, I know), FORTRAN is "a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientific computing. [wikipedia.org]".

      F#, on the other hand, is a "multi-paradigm programming language [...] that encompasses functional programming as well as imperative object-oriented programming disciplines. [wikipedia.org]"

      In summary, FORTRAN is for Formula Translation, I guess? F# is Functional, but with language support for OO or C-style programming.

      I admit

      • by johnlcallaway ( 165670 ) on Sunday February 07, 2010 @11:27AM (#31052558)
        Advanced??? Changed maybe. 30 years ago I taught myself BASIC from reference manuals in a few hours, enough to write a quadratic equation graphing program for my calculus class for extra credit. My second program was a password cracker so I could get higher priority on the university computer. I've modified code in languages that I had no experience in without any manual just by looking at syntax. So someone taking a few days to learn a programming language and modifying a planet simulator isn't all that impressive for a language ... they just found someone that learns quickly. I'm impressed in the person that picked it up, not the language. It mostly comes down to understanding if/then/else logic, loop constructs, and how to call methods after you learn syntax. Learning these constructs isn't too difficult, applying them takes a little more.

        So now .. instead of spending a few days learning syntax, and a few months mastering a language, we now take a few days to learn syntax, and YEARS to learn all the calls and libraries that go along with it. My first attempt at C++ resulted in my giving up, not because I didn't understand the language but because I was trying to write GUI programs and didn't have the right book to explain which libraries to use and why.

        Programming tools have definitely advanced. The days of punched cards and line editors like EDLIN are far gone for most programming needs. It's nice that modern languages don't let you overflow arrays anymore or have to deal with pointers.

        The biggest advances in programming??? Compilers, recursion, and object oriented syntax. I've seen far too many 'the next big thing' to get excited over something like this. Remember when C# was supposed to be the next big thing???

        But I'm still using the same if/then/else and loop logic that I did 30 years ago. No matter how much things change, they still stay the same....
    • It is, kind of (Score:3, Interesting)

      by _merlin ( 160982 )

      FORTRAN has dug itself into a corner where it survives quite nicely. It's used for mathematical, engineering and scientific libraries. FORTRAN just seems to lend itself to expressing these sorts of problems better. Mind you, the whole program probably won't be written in FORTRAN - any UI code and other glue will be written in C. F# is filling the same niche for .NET - the mathematical and analytic libraries are being written in F# while C# is used for UIs and other glue. So even if it's a completely d

    • by shutdown -p now ( 807394 ) on Sunday February 07, 2010 @05:40AM (#31051234) Journal

      Being an old fuddy-duddy, my first thought that Microsoft was doing a dot NET version of Fortran, but...

      Obvious retort is why?

      I've no idea why you'd want one, but it exists [lahey.com], nonetheless - made by Fujitsu of all things.

    • In reality it's just a .net version of Ocaml. Not that that's bad, mind you, but it's hardly revolutionary, or even innovative.

      I will give them props for doing it though; I'm surprised Microsoft would bankroll anything related to functional programming for at least 8 years from now.

  • by gad_zuki! ( 70830 ) on Sunday February 07, 2010 @03:49AM (#31050964)

    Sure, when everything works out. Something tells me F will mean something completely different when youre getting compiler errors or crashes.

  • Checkbox marketing (Score:4, Insightful)

    by Anonymous Coward on Sunday February 07, 2010 @03:55AM (#31050984)

    F# for Scientists ... F# in the finance industry ... F# ... statistical machine learning algorithms ... solar system simulator

    and the emotive language and buzzwords

    compelling ... impact ... convincing ... advertisement delivery machinery ... simple and intuitive

    *yawn* unconvinced.

    • Re: (Score:2, Interesting)

      You forgot "paradigm" [wikipedia.org]. My last shop was a C# shop. Never ceased to amaze me how the programs would prompt for the model number and freeze, then crash and and require a manual(Windows ctrl+alt+delete, of course) process kill before the operator had to enter the model number again.

      The impression given to the layman is that Microsoft technologies continue to enable idiocy. Hell, the code I dealt with at Java on Oracle shops was slow as fuck but at least it worked the first time around.
      • Re: (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: (Score:3, Funny)

          by mangu ( 126918 )

          What more evidence does one need that .Net is crap?

          Anecdotes [computerworld.com] aren't evidence, but their weight increases with decreasing distance. If your anecdote were about camel traders in some Central Asia mountains I would never give it a second thought.

          Computer programming, OTOH, is closer to home, 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.

          There must be something wrong about the whole .NET architecture, m

          • When crashes are a criterion then C must be the worst language ever existed.

            • crashes in C are deliberate - its the trials and hardships of learning from your mistakes that hardens you into being the best programmer young grashopper.

              or you can learn Java or vb.net as your first language, like a girl. :)

              • Re: (Score:3, Insightful)

                by dunkelfalke ( 91624 )

                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.

                • Pascal counts as one of those "hard" languages you know - its not 'everything done for you, with garbage collection, a huge class library, and objects that provide your functionality'. Try vb.net sometime, and you'll see what I mean - its more like a toy language than anything, but if you're writing the same old LOB apps that just grab data and display it with a bit of formatting, then its perfectly good enough, just not what I'd call satisfying.

    • by shutdown -p now ( 807394 ) on Sunday February 07, 2010 @05:15AM (#31051168) Journal

      If you don't want the marketing drivel, then the short story is that F# is ML [wikipedia.org] for .NET. If you know what that is, you should already know what it's good for, and when you'd want to use it. If you don't know what it is, then you might want to start from the basics [wikipedia.org].

    • I understand that it is popular to bash anything that burst forth from the loins of Microsoft, but c'mon! This is Don, The Don, this is one hard-core damned brilliant programming dude (for want of a better term). He was single handedly responsible for generics in c# (something I am greatly thankful for in my day to day work) F# is his baby; the guy is passionate about the idea of a real world practical functional language. Sometimes people use emotive language when they are talking about things that they ha
      • ...burst forth from the loins of Microsoft

        Thanks for the mental image of a squatting Steve Ballmer...
        *splorsh* [Steve gnaws umbilical cord]

    • Yes, but does it shift paradigms outside the box?

  • .NET Framework (Score:5, Interesting)

    by Yuioup ( 452151 ) on Sunday February 07, 2010 @04:26AM (#31051062)

    Last year I wanted to know what all the hoopla was about functional programming. I checked out Haskell, Scala, OCaML and F#. Coming from a Java/Delphi/C# background myself I had to go through it a couple of times before I "got" it. I'm glad I did because I banged out my first production IronPython lambda function on last Friday (yay!).

    I know that MS bashing is popular here on Slashdot, but I really want to take a moment to say that the .NET Framework really is excellent. The ability to mix and match different paradigms and languages in a clean an concise manner which is a joy to program in.

    Yeah I know patents bla bla mono bla bla Novell bla bla Miguel bla bla.

    • If you also know Java well, Groovy [codehaus.org] can also be an excellent tool, and is also useful in production environments.

      • Re: (Score:3, Informative)

        Groovy is not a particularly apt comparison, since it's more like a cross of Java and Ruby - particularly the fact that it's dynamically typed. On .NET, Boo [wikipedia.org] plays a similar role.

        The closest thing corresponding to F#/.NET on Java platform is Scala. It's actually a better language in terms of features, albeit with a slightly different balance - Scala tends to be more concise when dealing with OOP, and more verbose with FP, while F# is the other way around. However, a major difference is that F# has first-clas

        • Re: (Score:3, Informative)

          by Yuioup ( 452151 )

          I would say of all the functional languages I looked into Scala was the nicest, followed closely by F#.

          That is purely because it was easier to get up and running with Scala on Linux & Eclipse.

          I like to learn new languages using an IDE. When I've learned it well I start hacking away in a text editor.

          My primary IDE for IronPython on my Windows machine at work is vim ;-)

           

    • Re:.NET Framework (Score:4, Informative)

      by Paradigma11 ( 645246 ) <Paradigma11@hotmail.com> on Sunday February 07, 2010 @07:01AM (#31051514)
      Dr Eric Meijer from microsoft research has given a pretty nice 13 part lecture on functional programming in haskell based on graham huttons book:
      http://channel9.msdn.com/shows/Going+Deep/Lecture-Series-Erik-Meijer-Functional-Programming-Fundamentals-Chapter-1/
      there are also a ton of other videos about f# on channel9 like:
      http://channel9.msdn.com/posts/martinesmann/Don-Syme-FSharp-and-functional-programming-in-NET/
      http://channel9.msdn.com/shows/Going+Deep/C9-Lectures-Dr-Don-Syme-Introduction-to-F-1-of-3/
      or others specifically on asynchronicity and parallelism in f#....
    • by JamesP ( 688957 )

      I really want to take a moment to say that the .NET Framework really is excellent. The ability to mix and match different paradigms and languages in a clean an concise manner which is a joy to program in.

      Yeah I know patents bla bla mono bla bla Novell bla bla Miguel bla bla.

      I agree wholeheartedly. Even though I haven't played with IronPython yet, just C# but for me that's enough (even though it has its gotchas)

    • That's great and all but .NET is a library, not a language. It sounds like the fact that you enjoyed IronPython after coming from a C# background really has nothing to do with Python as much as it does the fact that you already knew the .NET library.

      If you don't know .NET? Well, thats another library to learn, and is no better or worse than anything else.

      • by Yuioup ( 452151 )

        I was looking for a good solution for automated tasks. The idea is to run tasks on a fixed shedule (like database maintenance, inbox reading and processing, etc...). Where we worked we tried all kinds of solutions (Windows service applications, COM objects, etc...) but nothing really worked.

        When I noticed that in the UNIX world there was something called CRON and it ran something called BASH scripts I basically drew an analogy. What would be a Windows version of CRON and BASH?

        IronPython and the Windows Task

    • Re: (Score:3, Interesting)

      by fredrik70 ( 161208 )

      If you like ironpython, check out Boo (http://boo.codehaus.org/) statically typed (or dynamic if you like) language which has borrowed most of the best features from from python.

  • The optimal blend... (Score:3, Interesting)

    by mandelbr0t ( 1015855 ) on Sunday February 07, 2010 @04:32AM (#31051076) Journal
    ...of object-oriented and functional programming languages would be one without any functional perspective. I've learned both, I've managed both, and OO didn't drive me insane. Functional-based programming languages are syntactically inferior to OO ones, just as natural languages have features that make some more primitive than others.
    • *head explodes*

    • by shutdown -p now ( 807394 ) on Sunday February 07, 2010 @05:28AM (#31051196) Journal

      Functional-based programming languages are syntactically inferior to OO ones

      Most likely just the ones that you've seen, and for the tasks you've thrown at them. I wouldn't write a line-of-business application in F#, sure, but I wouldn't write a parser in C# either.

      While we're at syntax - I've yet to see any non-hybrid OO language which has anything matching the power and beauty of classic FP pattern-patching. For any sort of tree processing especially, it's a god send - whereas in OO you have to deal with ugly visitor pattern hack.

      Then also, FP doesn't have to mean "alien syntax", either. Have you seen Scala? It has everything any self-respecting FP language needs to have, yet it's still very much OO-centric, and the syntax is broadly Javaesque.

      To conclude... one of the first two OO languages, and the one to which pretty much all OO languages today owe at least half of their design, is Smalltalk. Coincidentally, it's also a very potent FP language - blocks are nothing but first-class functions, and they were used so pervasively in the language and the standard library that even the most basic conditional statement was actually a method call with two blocks...

      And yet, Smalltalk is considered as one of the most pure OO languages ever.

      Which is to say that OO and FP is really orthogonal, and not at all contradictive. You can have both, and either one is good for something different - so there's no reason not to have both, and get the best of both worlds.

      • Re: (Score:3, Interesting)

        Okay everytime this kind of article comes up on slashdot people point to five or six other languages I have never heard of. Now smalltalk is an old language and I have heard of it and you make some good points about what it can do. So why do we have so many unique languages? Is it because people want to start from a clean slate? Surely working on virtual machines and calling standards is just as important.

        • Re: (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 comp

    • Funny. I'm just sort of getting into OO-based programming in Python, and it DOES drive me insane, compared to the functional perspective of Mathematica. I find functional languages to be much easier to read, faster to write, and just how I think.

            I AM happy with Python, and I'm trying to transition to it as my workhorse language.

  • If someone makes a debugger or syntax checker for it, will it be called 'F#CK'?
  • FParsec (Score:4, Insightful)

    by shutdown -p now ( 807394 ) on Sunday February 07, 2010 @05:38AM (#31051226) Journal

    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.

  • by otter42 ( 190544 ) on Sunday February 07, 2010 @06:16AM (#31051356) Homepage Journal

    I'm going to say something anathema to the /. crowd, but I'm looking into it with interest for replacing Python. I first teethed on FORTRAN, moved to Matlab 10 years lates, and have been using C extensively for the past 2 years. I'm starting into Python as a quick and dirty replacement for Matlab, and am quickly falling into a love-hate relationship with it.

    The love comes from all the cool things that Python can do, for free. Dynamic typing, .append() functionality, etc. It's just awesome.

    The hate comes from the sheer lunacy that is Python syntax. Forced whitespacing doesn't suit my debugging style (why not just have the compiler recognize either whitespace or accolades?); functions names like len() are just, frankly, idiotic (length() is much more readable to beginners, and takes only a few extra milliseconds to type for experienced users); and the way of working with indices is just weird (2:5 means the 2nd, 3rd, and 4th elements, but not the fifth; range(2 5) gives you 2 3 4, but not 5.).

    Python reminds me of many of these incredibly powerful scientific projects that never got used by a non-scientist until it was far too late to make changes. range() is a good example of this, as while it perfectly emulates "for i=2; i < 5; i++", it is NOT what you expect to get when you say, outloud, "I want a range of numbers from 2 to 5". Having contributed to Scilab, I should know as I'm equally guilty of this kind of thing.

    If F# can fill this void, by giving functional programming with functional syntax, I'll probably stop my Python experiments and move directly to F#.

    Although to be honest, I'd love to find a python front end that uses non-insane syntax and then simply precompiles it into python syntax at run-time. Then you don't have the MS, Windows, and .Net ickiness.

    P.S. I'm not looking to start a flame war about force whitespacing. There are really good reasons to like it. All my programs have consistent whitespacing, except when I debug (I like to put debug programming all the way against the margin, that way there's no possibility of ever forgetting it in the code)). However, you can't have it both ways on readability vis-à-vis function names and indices.

    • Re: (Score:3, Interesting)

      The love comes from all the cool things that Python can do, for free. Dynamic typing, .append() functionality, etc. It's just awesome.

      You do realize there's no dynamic typing in F#, right? It's very rigidly typed, in fact, more so than C/C#/Java - it won't let you use an int where a float is expected! (it's the price you have to pay for type inference - it doesn't play well with ambiguity)

      The hate comes from the sheer lunacy that is Python syntax. Forced whitespacing doesn't suit my debugging style

      F# is indentation-driven by default, much like Python (actually, more like Haskell, with more subtle rules). You can turn that off, technically, and use explicit semicolons - but that is considered legacy mode, and the community at large shuns it.

      functions names like len() are just, frankly, idiotic (length() is much more readable to beginners, and takes only a few extra milliseconds to type for experienced users)

      FP lang

    • by k33l0r ( 808028 )
      How about you give Ruby [ruby-lang.org] a try?
    • by selven ( 1556643 ) on Sunday February 07, 2010 @08:18AM (#31051780)
      I agree that Python has some strange things about it, but look at some sample f# syntax from Wikipedia:

      let rec factorial n =
          match n with
          | 0I -> 1I
          | _ -> n * factorial (n - 1I)

      What do those funny characters mean? What's the I after the numbers? Compare to the python one liner:

      def factorial(n): return 1 if n == 0 else n * factorial (n-1)

      That makes sense even to someone with absolutely zero experience in the language.
      • Re: (Score:2, Interesting)

        Your example includes some distractions like bigint literals (0I and 1I), and uses pattern matching, which doesn't exist in Python.

        You have to learn the language to be effective, the wikipedia article was showing the F#-onic way of writing it - it's perfectly possible to rewrite this in a more imperative form as:

        let rec factorial n = if n=0I then 1I else n*factorial (n-1I)

        but pattern matching is a key part of the language. The compiler can detect whether all possible pattern states have been caught, which i

    • I've never had a problem with python's whitespace parsing, but I read somewhere that python is so superior it has support for all the other schemes to denote blocks. For example, you can use 'begin' and 'end' keywords, you can also use braces {,} as well. Here's an example demonstrating python's superior syntax:

      if foo == 3:
      #begin
      ....block of code here....
      #end
      else:
      #{
      ....another block of code here....
      #}

      You say you don't like 'len' as a name for a length function, that you would prefer using the name 'length'. Well, python is so superior, that you can fix that problem really fast in your code:

      length = len

      From

    • I second the ruby suggestion.

      bash# irb

      >> (2..5).each { |number| puts number }
      2
      3
      4
      5
      >>

      >> (2..5).to_a
      [ 2, 3, 4, 5 ]
      >>

      >> (2...5).to_a
      [ 2, 3, 4 ]
      >>

      >> [ "apple", "orange", "banana", "peach" ].each do |fruit|
        puts "Yummy, #{fruit.pluralize}!"
      end
      Yummy, apples!
      Yummy, oranges!
      Yummy, bananas!
      Yummy, peaches!
      >>
  • nothing beats the uses of F# to implement statistical machine learning algorithms as part of the Bing advertisement delivery machinery

    Are you SURE you want to promote that as a productive use of the language? Bring together two things that people love to hate? Even Google's ads are merely tolerated at best.

    What's next, "F# for spammers"?

  • by El Cabri ( 13930 ) on Sunday February 07, 2010 @07:45AM (#31051656) Journal

    ...of a functional language, it is simply Microsoft's offering of a functional language. The former statement sounds like it's one of the dozens of functional languages fostered in academia, for academia to play with. The whole difference here is that, as of Visual Studio 2010, F# becomes a fully productized and supported language in the .NET world. That's really what's exciting for functional language geeks, because never before a real, modern functional language of the generation built in academia in the 90s, like OCaml and Haskell, had such a mainstream backing.

  • by thetsguy ( 1211146 ) on Sunday February 07, 2010 @09:11AM (#31051934)
    WTF#
  • Aren't all the functional techniques in F# being pulled into C#? Like DryadLINQ, and other components from Microsoft?

  • If this is a functional language, it presumably makes generous use of recursion. Which brings up something I'd be interest in /. comments on...

    There are a lot of algorithms that can best be expressed and (theoretically) most efficiently solved by recursion. However, (a) most programmers are not comfortable with recursion and (b) most programming languages (C++, C#, Java, etc.) make no optimization for recursion. In particular, they use a new stack frame for each recursion, even if the function is tail-rec

    • Re: (Score:2, Funny)

      by ascari ( 1400977 )

      Why are most programmers uncomfortable with it?

      Possible because:
      n1=1
      n2=2
      n3=6
      n4=24
      n5= "Segmentation fault. Core dump"

      What can be done to break this cycle?

      Try this:
      #define "Segmentation fault. Core dump" 120

For God's sake, stop researching for a while and begin to think!

Working...