Slashdot Mirror


Inside Microsoft's New F# Language

robyn217 writes "There's a new language being formed in the bowels of Microsoft. Recently I got word that the language F# (pronounced F Sharp) is nearing workable stages at Microsoft Research. So, I went in for a look-see. What I found was an interesting blend of imperative (Java, C#) and functional languages(it's ML-based, too!). It looks pretty enticing to me from a computer science perspective, but I'm not sure it would fly in the professional market. I can see the ease of development that a language loosely based on ML would bring, but I can't see coders switching over in droves since it's a tough learning curve." Our previous story on F#.

8 of 606 comments (clear)

  1. Re:Well... by henbane · · Score: 5, Insightful

    F# will be learned by people when managers and not university lecturers decide that it is something that coders need to learn or even when coders decide it's necessary for something.

    Stop thinking that the world is out to make you use MS products no matter what. The businesses that do the employment and the people who should be advising them (cough -you- cough) are the people who make those decisions.

    Anyone learning Computer Science should in no way be gearing themselves with any particular product

    Any university offering courses in computer science is doing students a dis-service if it sends them out of the institution without an MS-centric, Linux-centric or any other square peg solution to fit any hole they come across.

    I always thought the aim of education and particularly any discipline that considers itself a science was to teach skills and thinking which could be applied across the field so the graduates would find themselves able to adapt to any language or equipment that they found it necessary to use.

  2. Re:Wrong... you couldn't.... by xenocide2 · · Score: 4, Insightful

    Which only goes to show how much cleaner mapping functions to lists is.

    map (fun x -> x*x) list

    --
    I Browse at +4 Flamebait

    Open Source Sysadmin

  3. Re:Gee Flat by sammy+baby · · Score: 3, Insightful

    I'd hesitate to say it's a "bright scale" in and of itself. The intervals between tones are the same in F# as in C#, which is why the whole circle-of-fifths thing works in the first place. The brightness or moodiness of the scale is entirely dependent on the range and tonal qualities of the instrument on which it's played - try it on a piano, and one doesn't really sound brighter than the other.

    And besides, everyone knows that D minor is the saddest of all keys.

  4. Why I like Java... by Eric_Cartman_South_P · · Score: 3, Insightful
    ...the way I wrote a file to a disk 5 years ago is the same way I write it today. And I know how to write a file to a disk on Solaris, Linux, Mac, BSD and Windoze since I know the little bit of code that does it in Java. Although a simple real world example, it is pretty powerfull stuff when you think about it. And remember, NO RELEARNING.

    I know, AWT->SWING and a bunch of other examples, but a CORE PART of Java does not change. It remains the same as much as possible, in regards to the API.

    MS goes ahead and changes things completely every few years. Java, for the most part, does NOT require tons of relearning. The API's are there if you need them, but a majority of them do not change. They might get "cleaned up" a bit, or a few deprecated here or there, or in my opinion a few too many may be created to do the same task, but if you could knock up a Java prog years back, it's the same way today for the most part. SIMPLE.

  5. Re:It's OCaml for the .NET CLR... by Zeinfeld · · Score: 3, Insightful
    It's OCaml for the .NET CLR. Not a new language. Nothing to see here. Move along.

    Yes, but the problem with most ML implementations is that they are academic toy languages. You can't do anything useful with them because you can't connect them to real I/O and if you can you can't distribute the code as noone else has the environment.

    Adding the dotNET classes to ML means you have a real programming environment for a functional language.

    --
    Looking for an Information Security student project suggestion?
    Try http://dotcrimeManifesto.com/
  6. Re:It's OCaml for the .NET CLR... by arkanes · · Score: 5, Insightful
    There's a signifigant inertia to overcome with the acceptance of any new language. One of the barriers is the creation of a useful runtime, porting that runtime to common platforms, keeping it supported, etc. There's a whole bunch of languages out there, but probably 90% of applications are written in less than a dozen of them (Java, VB, C, C++, Delphi... am I missing anything else major?).

    One way to overcome that inertia is to provide bindings for your niche language against a major runtime - like compiling it to Java bytecode, or, in this case, IL.

    Now, .NET has it's own inertia to overcome, but because it's Microsofts baby, it has alot of advantages that the language/runtime that Joe Programmer makes doesn't have.

    This is interesting for a couple other reasons - it's been reported before that it should be easy to port functional languages to .NET - and that it's apparently hard to have them compile to Java (I don't know crap about functional languages, I'm just parroting here), so here's the proof of that. Also, like it or not, .NET is very big and is being very heavily pushed by the single most influential company in IT - and if you're a fan of functional languages, I don't see how this is a loss for you or why you're bitter about it.

  7. Re:Funny quote of the day by Dan+Ost · · Score: 3, Insightful

    Seriously, though... I was discussing the future of programming languages with some friends and we agreed that a real step forward would be to provide features such as higher order functions in a mainstream language... could this be it?

    If you consider Python to be mainstream, then there's already a mainstream language that supports both functional programming and advanced types like lists and associative arrays (aka dictionaries).

    I stumbled on to Python about a year ago and have been so impressed by it that it's becoming my languange of choice for new development.

    Check Python out. Really

    --

    *sigh* back to work...
  8. Re:Funny quote of the day by jaoswald · · Score: 3, Insightful

    What's "wrong" (rather, missing, or inconvenient) is the ability to fill f with pointer to functions that were not defined when the compilation happened.

    In Lisp, I could take the contents of a Web form, for instance, and use that to make a function that would encode, for instance, your preferences in music, then use that newly-formed function to rate MP3's as your are browsing.

    (defun make-rating-function (web-form-contents)
    (lambda (music)
    (+ (* (country-rating web-form-contents) (country-genre music))
    (* (rock-rating web-form-contents) (rock-genre music))
    (* (classical-rating web-form-contents) (classical-genre music)))))

    Then, that rating function can be stored in a variable for later use on the music.

    You could implement this in C, by storing the array of three values, but it is much less flexible. My make-rating-function could return one out of any number of functions, which take different information out of the web-form-contents. For instance, classical music listeners have very different ways of choosing music, so you would give them a music-rating-function that looked at composers more than performers, while rock fans would look more at bands that groups of people tend to rate similarly.

    (defun make-rating-function (web-form-contents)
    (if (classical-music-lover web-form-contents)
    (make-classical-rating web-form-contents)
    (if (rock-music-lover web-form-contents)
    (make-rock-rating web-form-contents) .....

    where make-rock-rating is written as above.

    Once you make the choice of functions depend on the data, it becomes cumbersome to do in C. It's like doing polymorphism in C: you need to start making case statements all over the place to check what kind of customer you are dealing with. Lisp makes this kind of stuff easy to express---dealing with functions is as easy as dealing with integers and floats.