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#.

89 of 606 comments (clear)

  1. That's how I feel about most Microsoft languages by The+Lord+of+Chaos · · Score: 5, Funny

    F#ing Visual C++
    F#ing VB.
    F#ing Win32 API

  2. It's OCaml for the .NET CLR... by Anonymous Coward · · Score: 4, Informative

    It's OCaml for the .NET CLR. Not a new language. Nothing to see here. Move along.

    1. 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/
    2. Re:It's OCaml for the .NET CLR... by Junks+Jerzey · · Score: 3, Informative

      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

      In all honesty, what are you talking about? You can pick up OCaml right now and I/O is just fine. Period.

      if you can you can't distribute the code as noone else has the environment

      So everyone has to use C forever and ever?

    3. 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.

    4. Re:It's OCaml for the .NET CLR... by Zeinfeld · · Score: 2, Informative
      In all honesty, what are you talking about? You can pick up OCaml right now and I/O is just fine. Period.

      Yeah, yeah and you could write programs in ANSI Pascal, problem was you could not do it without a lot of hassle.

      Under dotNET there are no second class languages (well apart from C++), they all can access the same runtime. That is a major advance. OK you could write to the Java bytecode but anything other than Java will always be a second class language in that environment.

      --
      Looking for an Information Security student project suggestion?
      Try http://dotcrimeManifesto.com/
    5. Re:It's OCaml for the .NET CLR... by esarjeant · · Score: 2, Interesting

      Check out the TIOBE Programming Community Index -- the current language frontrunner is Java, although the combination of C/C++ would be considered dominant.

      Your 90% list is probably more like Java, C/C++, Perl and VB...

      --

      Eric Sarjeant
      eric[@]sarjeant.com

    6. Re:It's OCaml for the .NET CLR... by bratmobile · · Score: 2, Informative

      C++ is not a second-class citizen under .Net. In fact, Managed C++ is one of the best-supported languages. Managed C++ can be used to generate, or access, nearly every aspect of the Common Language Infrastructure / Common Type System.

      It is, arguably, the most expressive language in .Net, because it can generate/access all managed language features, as well as still having full support for all unmanaged features -- normal C++ classes (malloc/free/new/delete semantics), templates, etc. Managed C++ is designed to be the ultimate bridge language, between the existing world of unmanaged C/C++ and managed .Net classes.

      Now, in some ways, that's not necessarily a good thing. C# restricts you from doing some stupid things, or at least you must knowingly enable unsafe operations (using the /UNSAFE command line argument, and then you STILL have to use the "unsafe" keyword in source code). But, still, Managed C++ gives you an amazing degree of interoperability with both worlds, and it's seamless.

    7. Re:It's OCaml for the .NET CLR... by TheGrayArea · · Score: 2, Informative

      >>Under dotNET there are no second class languages (well apart from C++), they all can access the same runtime
      Not true. You can use the Managed C++ extensions to access everything in the runtime. Heck, you can even host the runtime yourself if you wish.
      Check out:
      http://msdn.microsoft.com/library/default.asp?url= /library/en-us/vcmex/html/vcconMCOverview.asp

      --

      This space for rent.
    8. Re:It's OCaml for the .NET CLR... by MillionthMonkey · · Score: 3, Informative

      (DISCLAIMER: I didn't write this myself- we were having an email conversation about F# today at work, and this is what our CEO had to say about it. I got his permission to repost his email here but he insisted on editing a few comments disparaging to Microsoft because he wants to encourage them to keep working on it.)
      --snip--

      F# seems to be based very closely upon ocaml, which was the language that I used for day to day work before Java.

      I think ocaml is a fantastic language, although, like everything, it had a few significant problems five years ago:
      - obscure [ F# could fix this ]
      - not as many libraries as a mainstream language [ F# could fix this. ]
      - not great module support - if module A depends on B, then B cannot depend on A.

      Disclaimer: everything I say comes from personal, but old, experience, and a cursory look at the F# web site.

      Interesting properties of ocaml:
      1) Functions are first class objects. E.g..
      let add x y = x+y;
      let add3 = add 3;
      print (add3 4);
      -> 7
      2) Polymorphism works well. So you could define a function that takes an array of objects x and a function that maps x to y, and produce an array of objects y. Eg
      let a = [| 5,6,7 |] // an array of integers
      print (Array.map add3 a)
      -> [| 8,9,10 |]
      3) Type checking is strong, compile time, and usually implicit. All types in the examples above are deduced correctly. Disadvantage: You can't have operator overloading, even for the plus sign... so + means integer addition, and +. means double addition.

      4) You can return multiple values from a function
      let cis t = (cos t,sin t);
      let (ct,st) = cis (PI /. 2.0);
      print ct;
      -> 0.0

      5) Variables are final by default, but can explicitly be made not-final. There are also control structures that make many things that one does in Java by changing variables simpler. This can make debugging simpler, but takes a while to get used to.

      6) There is some very powerful pattern matching code - imagine a more powerful case where you could say

      int x;
      Point y
      switch (x,y) {
      case 7,null: do this
      case 4,Point(3,?) : do that
      case x,Point(y,x) : print y
      default:
      }

      [ Actually, there is no direct concept of null, but that is not the point. ]

      I particularly liked ocaml as it allowed imperative features, had GC and exceptions, and had a very good compiler that produced fast code. I was very impressed by the French academic group that made it and supported it.

      [ Note examples are not valid ocaml - they are ocaml features with a javaified syntax to make them easier to explain, and besides, I have not used the language for years. ]

      The current F# implementation does not sound very efficient for a variety of reasons. It is also not nicely polymorphic in the same way that ocaml is. This defeats a lot of the point of it. They need support for generics in the VM for these to work well. There is a different group at MS research working on this - I would be delighted if both the F# project and the generics project make it into the mainstream.

      It is not clear how well the ML view of types will match up with the C# view of types. ML programming feels different to Java programming, and this could make the .NET library matching clumsy. But if they could make it work, then that could get rid of two of the biggest perceived issues that have prevented widespread adoption of ocaml.

      --snip--

    9. Re:It's OCaml for the .NET CLR... by John+Whitley · · Score: 3, Interesting

      can't connect them to real I/O

      This used to be true ten years ago, but you are way out of date. OCaml works great for I/O. If available Debian packages are any measure, OCaml has had quite the active and growing developer base too.

      The major semantic hurdles for even (mostly-)pure functional languages (c.f. Haskell) were solved many years ago. (Look up the papers of John Launchbury, Simon Peyton-Jones, and others on State Transformers in Haskell. See also papers about how the use of the 'monad' from category theory introduced an incredibly powerful tool into languages such as Haskell). The Fox project at CMU used Standard ML to create a nifty layered TCP/IP stack and HTTP sever back in the mid 90's.

      The various current functional languages may have issues, social and/or technical, w.r.t. mass adoption... but the I/O problem definitely isn't one of them anymore.

  3. Obviously by somethingwicked · · Score: 2, Funny

    "nearing workable stages at Microsoft Research"

    What a softball on a Slashdot story. I bet

    21 joke made with reference to this phrase

    Let's watch and see :)

    --

    ---"What did I say that sounded like 'Tell me about your day?'"---

  4. F? by Tsali · · Score: 2, Funny

    F-pound?
    F-sharp?
    F-UD?

    Sheesh. Don't we have enough languages already? I thought C# was the absolute savior of the MS-centric tech world.

    Just learn how to program in one language before you hit another one.

    --
    This space for rent.
    1. Re:F? by Tsali · · Score: 4, Interesting

      Actually, after rereading, doesn't python's lambda or use of functions as objects address the same problem space as F#? (per the author's example on the "What's the purpose of F#?" page of the article? My python's rusty, but, isn't that one of the cool things about python? Couldn't a C# delegate do something similar? Can you tell VB is my native tongue? :-)

      --
      This space for rent.
    2. Re:F? by thermostat42 · · Score: 5, Interesting

      As one of the posters above mentioned, python's lambda is actually borrrowed from the Functional programming world. I believe it originally gets its name from Lambda Calculus, but mathematicians will have to correct me on that. (I first saw it in Scheme, the most beautiful programming language I've ever programmed in, if not the most practical.)

      If you've never done functional programming, it a different animal from imperitive programming, and if you do know python, it borrows a number of things from FP, not just lambdas. Look at python's map, apply, and reduce functions, along with list comprehensions (taken from Haskell, which I really need to learn). Although, it should be noted that python's recursion really isn't optimized for FP, but you can still do quite a few things that a functional programmer would be at home with.

      --
      no comment
    3. Re:F? by caluml · · Score: 2, Funny
      It's gotta be called F-sharp, if you ask me. Which you're not :o)

      I don't get how a # can be called a pound. What do you guys call £ then?

    4. Re:F? by jgerman · · Score: 4, Funny

      We call that the monetary unit soon to be known as the Euro.

      --
      I'm the big fish in the big pond bitch.
  5. Yes !!! by dago · · Score: 4, Funny

    I knew that someday Fortran will make its comeback and becomes the all mighty programming language !!!

    --
    #include "coucou.h"
  6. Figures... by da3dAlus · · Score: 4, Funny

    I usually use an F#-word or two when dealing with one of Microsoft's programming languages. This is great for marketing "See, everyone's shouting praises of F(sharp)!".

    --

    Sometimes I doubt your commitment to Sparkle Motion.
    1. Re:Figures... by AntonyBartlett · · Score: 2, Insightful

      I usually use an F#-word or two when dealing with *any* programming language. Even those who swear by computers also swear at them.

  7. This isn't all apparently... by CrazyJ020 · · Score: 5, Interesting

    A microsoft rep met with us a couple of weeks ago pushing .NET, win2k3, the whole enchilada. He mentioned they have MANY of these languages in development and are due to be released in the next year or so. They will still be pushing C# for mainstream development. The other languages will focus on niches where a modern OO language would be cumbersome.

    He wouldn't confirm whether they would have the X# naming convention ;)

    1. Re:This isn't all apparently... by esarjeant · · Score: 4, Interesting

      I like different languages, there are applications where Perl is more effective than C and where object oriented makes more sense than procedural.

      It looks like Microsoft is going to provide me a dream palette of languages to pick from. Maybe this will help make things like Design By Contract a little more mainstream?

      OTOH, there is a right way and a wrong way of approaching this. In the example of DBC, MS would do good by providing an Eiffel implementation for their CLR. In the example of F#, MS would be more correct to introduce Scheme and LISP dialects rather than invent their own.

      Not because these languages are perfect, but because developers are already familiar with these environments. We can't continue to "invent" new ways of doing things, the software industry has been introducing new standards at such an astonishing rate that we may jeopardize our ability to maintain legacy systems that are generationally distanced. Systems that were maintained 10 or 20 years ago rely on technologies that a recent college grad will be entirely unfamiliar with.

      Very few industries have this kind of halflife, let's not make it worse with [Aa-Zz]#.

      --

      Eric Sarjeant
      eric[@]sarjeant.com

    2. Re:This isn't all apparently... by Hard_Code · · Score: 3, Funny

      Customers don't pay for intractable problems to be solved. They pay for new icons.

      --

      It's 10 PM. Do you know if you're un-American?
    3. Re:This isn't all apparently... by MisterFancypants · · Score: 3, Informative
      OTOH, there is a right way and a wrong way of approaching this. In the example of DBC, MS would do good by providing an Eiffel implementation for their CLR. In the example of F#, MS would be more correct to introduce Scheme and LISP dialects rather than invent their own.

      Bertrand Meyer is one of the biggest .NET boosters on the planet, and he already oversaw a port of Eiffel to .NET. This was available like a year ago.

      There's also a Scheme compiler, called Hotdog, with a .NET backend:

      Keep in mind that F# is but one of MANY language research projects going on at Microsoft Research, and there are many more going on at other sites that Microsoft is tangentially involved with.

  8. F sharp or F hash? by SomethingOrOther · · Score: 4, Funny

    Heh
    In the UK we call that square thingy a hash

    Do you think C hash has done well here :-P Will F hash do any better?

    (Or does "making a hash of it" get lost in the translation?)

    --
    Anyone quoted by a reporter knows how little they understand
    Don't believe what you read is the truth.
    1. Re:F sharp or F hash? by Anonymous Coward · · Score: 2, Funny

      It's called a good number of things, as is Microsoft. There is no one official name for the #.

      Octothorpe is ugly, but we can shorten it to "ock" for C# and F#. ;)

  9. We have been working with it for a while. by ayjay29 · · Score: 5, Funny

    When developing for windoes "Microsoft F#&%", or "F#&%*!? .net" is the most common language our team uses.

    --
    Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated up.
  10. Gee Flat by snatchitup · · Score: 5, Funny

    Do you relize that an F# major has 6 sharps.

    But, an F# is the same as a Gb (G flat) which has as 6 flats.

    Now the C# scale has 7 sharps, but it's the same as a Db (D flat) which only has 5 flats.

    Most people think (D flat) instead of C#.

    F# is a very bright scale. It sounds very nice on an Alto Saxophone, whereas the C# scale is a little more moody, depressed.

    Maybe Microsoft is trying to back off the use of C#.

    1. Re:Gee Flat by mekkab · · Score: 2, Funny

      damn you and your circle of fifths!!

      --
      In the future, I would want to not be isolated from my friends in the Space Station.
    2. 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.

    3. Re:Gee Flat by Alioth · · Score: 3, Funny

      Now all they need is G# (or Ab) and you can play the blues with Microsoft languages. Somewhat appropriate :-)

    4. Re:Gee Flat by $carab · · Score: 2, Insightful

      Most people think (D flat) instead of C#.

      Most people think of the note as C# because it is the third sharp added as you move up the circle of fifths. The A major scale includes a C#. D flat, on the other hand, does not arrive until 4 flats, in the A flat major scale. As a string player, I can tell you we play in multiple sharps far more than multiple flats (Who ever heard of a violin concerto in A flat?).

    5. Re:Gee Flat by Rich0 · · Score: 2, Informative

      Uh - I'm a string player, and if you asked me to play either I'd stick my finger in exactly the same place.

      They are in fact the same note. Granted, no string player hits any note dead-on, so maybe some tend to hit a pitch a little higher or lower when going up or down a scale, but it has nothing to do with the notes actually being different.

    6. Re:Gee Flat by Old+Wolf · · Score: 2, Interesting

      Well the circle of fifths doesn't quite work .. if you go up a fifth on a piano (freq * 2^(7/12)) 12 times, you've multiplied frequency by 128, but if you go up an exact fifth (freq * 3/2) 12 times you've multiplied frequency by 129.7. Some older organs actually had a different key for C# to Db for this reason.

  11. Could be useful? by DrTentacle · · Score: 5, Interesting

    Our company has recently started to introduce .NET development alongside our core J2EE platform. One of the issues that has come up has been how useful the multi-language/single-platform support would be. Rather than taking a "best of breed" language for all development, the use of the right tool for the right job could potentially lead to interesting results - A mix of C#/ML/PROLOG/etc. as appropriate for the immesdiate task at hand. I don't think MS is far enough down the road yet to capitalise on the idea, but it's certainly an intriguing possibility - Even if it would lead to a maintenance nightmare :)

    1. Re:Could be useful? by brlewis · · Score: 4, Interesting

      In reality, Microsoft's CLR is only slightly better than the JVM at accommodating multiple languages. Better support is "planned for a future release", much like the 1993 promises of WinNT that came out in 2001. All the languages ported to the CLR had to be compromised somehow, same as those that compile to JVM bytecodes. I'm still hoping dotnet will push Sun to extend the JVM to be more acommodating of non-Java languages. For example, it would be fun to try full continuations in BRL pages.

    2. Re:Could be useful? by iabervon · · Score: 2, Insightful

      The .NET CLR was designed for C#. None of the other .NET languages are any better for anything than C#, because every feature that isn't in C# has been removed from the other languages to make it a .NET language. It's not actually more generally applicable than the JVM, it's just that there's a bigger marketting push to demonstrate that you can implement a bit of a lot of languages on it.

  12. Funny quote of the day by 26199 · · Score: 5, Interesting

    Map then applies whatever function we pass in to every member in the array (called a list in functional programming).

    So, all you functional programmers, remember... a list is just another name for an array :-P

    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 so then it's a little worrying... I'd rather not see any revolutionary languages come out of MS, if at all possible...

    (Cambridge's Computer Science degree teaches ML followed by Java in the first year... would they switch to teaching just F# if it became popular?)

    1. 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...
    2. Re:Funny quote of the day by Ed+Avis · · Score: 2, Interesting

      You can get higher order functions in C++, just about (eg for_each in the standard library). But the syntax is awkward and without anonymous functions (lambda) it gets more awkward.

      Perl has higher order functions, and is reasonably 'mainstream'. So do Python and Tcl and most other scripting languages that let you pass around pointers to functions. But without typechecking it can get a bit error-prone to do the kind of really complex stuff you might do in Haskell or ML.

      --
      -- Ed Avis ed@membled.com
    3. Re:Funny quote of the day by Eudoxe · · Score: 3, Informative

      In France, students learn Caml during their first year before school of engineer. Maybe this will help the devel of ML in industry.

    4. Re:Funny quote of the day by doktor-hladnjak · · Score: 2, Interesting

      "Am I missing something? The author mentioned function pointers, but sidestepped the fact that the standard library handles the function pointers for you and lets you use (fairly) clean syntax to express the idea of "high-order" functions. Anyone with C++ and lisp/scheme/ML experience want to elaborate?"

      The term "high-order function" I think is probably referring to the property of a language, where functions are objects that are as easily passed around, created, used, etc. as any other type of data (say numbers or lists or strings). While you can essentially do things like map in C++ (even with function pointers), it's not as easy to do something like,

      > (define (make-adder n)
      (lambda (m) (+ m n))

      > (map (make-adder 3) '(1 2 3))
      (4 5 6)

      at least not semantically in the same way or in so few lines. In langauges like scheme, lisp, and really even python, functions are really just another form of data that can be manipulated. Heck, in Python, functions (and methods) are even objects with their own methods.

    5. 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.

    6. Re:Funny quote of the day by RevAaron · · Score: 2, Interesting

      Python certainly isn't the first semi-mainstream language to provide higher-order features. Smalltalk has been around in one form or another for 30 years. Smalltalk may not be the flavor-of-the-day like Python, but it's a proven, mature system which probably has been used for more 'mission-critical' systems at businesses than Python. As Python mature and Smalltalk evolves into something else, this is bound to change.

      Anywho, Perl has more users than Python, has been around for longer and boasts the same higher order techniques and advanced types that support FP well.

      Not that I'm telling you to switch to Perl or Smalltalk- everyone has their preference.

      I stumbled on to Python 6 years ago and was seriously impressed. A year and a half or two after that I found Squeak Smalltalk and was utterly blown away. Contained all of the stuff I liked about Python, but had more of it! Utter simplicity and total consistency. A hacker's dream- you can change anything about the Smalltalk system within the system itself. Want to experiment with changing the way the language works? No need to drop down to C as you would with Python.

      If you like Python or Ruby and have an open mind, it's definately worth checking out Smalltalk. If you'd like to try out an implementation that has good Unix integration, check out GNU Smalltalk; if you'd like to try an implementation that takes computing to the next level with a truly innovative GUI toolkit, check out Squeak. Both are open source, naturally.

      I suggest the open mind because Smalltalk isn't Java. It isn't C++. Even Python can look like legacy compared to Smalltalk sometimes. Just like an old C hacker or C++ fan needs an open mind to be able to look at Python without immediately dismissing it because it doesn't look like C/C++/Java, a Python or Ruby user must keep her mind open when looking at Smalltalk for the same reason.

      For those interested in trying out an open source Smalltalk that has access to all the .NET libraries and compiles to IL, check out #Smalltalk. And no, nothing was sacrificed to run Smalltalk on .NET as is done with some .NET languages. The #S developers implemented what the CLR didn't support, and made sure it still worked sensibly with .NET. A good example of how new languages on the .NET CLR don't have to just be "syntax skins."

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    7. Re:Funny quote of the day by jaoswald · · Score: 2, Insightful

      I have just scratched the surface of Lisp's dynamism. Sure, for any fixed set of example functions, you can create the same structure in a static language.

      However, in Lisp, I can *redefine* functions continuously, and previous references to those functions remain intact.

      At any point, in my web server example, I could change the definition of any one of the generating functions, *as* the program is running, without stopping and recompiling the whole program. This kind of dynamism is pervasive throughout the language, and not just in some special libraries one can decide to use. Moreover, I don't have to fit my problem into the framework of inheritance, if it isn't natural.

      Conceptually similar does not mean equivalent in power. Lisp has been doing functions for almost 50 years now. The C++ community is just beginning to get the vaguest idea. It's the difference between real French cheese, for instance, and "american" "pasteurized processed cheese product." Big difference between the real thing and a crude imitation.

  13. I like the idea by Anonymous Coward · · Score: 5, Informative

    My first year CS classes were taught in ML. It's a very potent language. I especially liked the type inference system. What other languages do in templates comes naturally in ML. Our CS prof gave us an example of Quicksort in 3 lines of readable code. As an academic language ML has problems interfacing with real life systems. OcaML was a step in the right direction and MS is building F# on it. I'll certainly try this one.

    1. Re:I like the idea by slackergod · · Score: 2, Interesting

      You should take a look at Erlang .

      It's much in the style of ML, but with ideas from many other languages thrown in.
      And it definitely isn't an "academic" language... it's developed and used by Ericsson
      to drive telecommunications systems which have to handle a huge load, and cant be allowed to crash.

      Luckily, it's now open source (sorta), and the basic Erlang OTP package
      contains about as many side features as Python does :)

      It's inherently parallel (a single program can easily distribute itself across multiple computers),
      with concurrencies, and all kinds of other fun 'academic' features...
      don't get me started on it's vm's model... it brings tears to my eyes in a way only LISP ever could (that's a good thing).

      At the moment, I prefer Python, but only because it's got better C integration...
      Erlang works best when only the lowlevel drivers are written in C...

      -slackergod

  14. Related to Harlequin ML by shic · · Score: 3, Interesting

    I wonder if F# has any relationship to the "ML for Microsoft" (I forget the name) efforts from Harlequin Software a few years ago? ML has always seemed an ideal fit for many single-user RAD developments, it just needed an appropriately stable, complete, clearly specified component library and professional quality IDE in order to reap productivity benefits over Java/C# et al.

  15. 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.

  16. Re:What will they do? by Galaxie · · Score: 2, Funny

    Maybe they will start using Symbols like in Super Mario Brothers :)

    --
    <end/>
  17. Microsoft Attempt to Own the RIAA by dduardo · · Score: 5, Funny

    If they can patent/trademark/copyright all the notes used in music, they will be able to own the RIAA.

    The have: C#,F#
    Left: A,A#,B,C,D,D#,E,F,G,G#

    Can't wait for the other 10 programming languages

    1. Re:Microsoft Attempt to Own the RIAA by Mocenigo · · Score: 2, Funny
      If they can patent/trademark/copyright all the notes used in music, they will be able to own the RIAA. The have: C#,F# Left: A,A#,B,C,D,D#,E,F,G,G# Can't wait for the other 10 programming languages

      A, B and C have been already been used for programmin languages, so this leaves out only 7 available names.

      OTOH, they can still use flats, and if they pretend that the equal temperament is not used at MS (today, different tunings are used also to perform music of the past in an authentic way) then C# and Db would be different languages.

      Not to speak of the possibility of using quarter-tones! That would be AVANTGARDE PROGRAMMING LANGUAGES. And what about even smaller intervals?

      Later, they must go directly to frequences. THey could call a language 440 instead of A, for example.

      I fear, however, that this is typical MS monopolistic strategy. They are clearly trying to steal the professional music market away from Apple. And the fact that they do not fear to use strange intervals, not to speak of the possibility to use microtonal intervals, might even suggest an attempt to court music institutions like the IRCAM, which are almost standardised on Macs.

  18. Re:Well... by Anonymous Coward · · Score: 2, Insightful

    I don't buy this for a minute. There's tons of comp sci programs that never even made the switch to Java as their "learning" language. People will learn what the job market dictates. There will ALWAYS be a need for COBOL and C programmers and I think that Java has, sadly enough, become ubiquitous enough that we'll always need Java programmers.

    You'll lose your job if you only know a handful of trendy technologies and nothing more. If you know some languages that are passsing into the "legacy" category, you're better off.

  19. Filters by alexjohns · · Score: 2, Insightful
    Considering that most corporate mail servers filter pretty much all email containing variants of 'F*', 'F#', 'F###', etc., I really don't see how this could possibly catch on. Certainly not in large corporations. Maybe MS will need to start a grass-roots campaign.

    And, you know, I've been working for a very large financial institution for 2.5 years. I've seen no sign of C# anywhere. Going to the programming racks at Borders would make you think differently. I honestly think there's more C# books out there now than all other programming language books put together. It's amazing.

    1. Re:Filters by zero_offset · · Score: 2, Informative
      Insightful? Please.

      First of all, I've been working in a probably-much-larger (one of the largest) financial institutions for six years, and I see C# all over the place. So much for anecdotes.

      Second, I've been working for various large companies since Internet-based e-mail started, and I've never seen anything that would filter F#. So much for speculation.

      Now if I just had some moderator points. :P :)

      --

      Slashdot quality declines as the number of hot grits posts decreases. - Provolt's Law, Apr-09-2005

    2. Re:Filters by alexjohns · · Score: 2, Informative
      OK, I see your large financial institution, and raise. I work for Wells Fargo, in one of their divisions. 130,000 employees. I doubt it's the largest one in the world, but still pretty large. Back to you. Call?

      We have a common Tech Library (in San Fran) where you can check out books. I see 3 C# books in the online listing. I imagine some division somewhere is toying with it. Everyone I know about in the company is doing C/C++/Perl/Java.

      I was a sysadmin for a few years. I've seen several instances where filters on "f-junk", where -junk is some subset of characters like '!@#%*', were implemented. Don't know what country/jurisdiction you live/work in, but not only is it a politeness issue, it's a sexual harassment issue. Just because some PHB somewhere decides to let the f-bomb slip in an all-employee email doesn't mean the company wants to open itself to a lawsuit. I never implemented one myself, but I've been on mailing lists/fora where the necessity and implementation details were discussed. (Also, internally, we've had emails from the Exchange people about inappropriate language. I don't know specifically that they filter on that word, but I'm pretty sure there's a flag somewhere that gets raised. Not sure what happens. No desire to find out, I like my job.)

      So then, if you had moderator points what would you moderate me as? Offtopic? Nope, on-topic. Flamebait? Nope, don't think I qualify. Troll? No, not even. Best you could do is overrated, I guess. The coward moderator's choice (since it doesn't get meta-moderated.) I always like the guys who down-moderate you because they disagree with you.

      HAND.

  20. Re:What will they do? by NeoSkandranon · · Score: 4, Funny

    No, they'll go A through G, then start making chords and arpeggios.

    --
    If you can't see the value in jet powered ants you should turn in your nerd card. - Dunbal (464142)
  21. Re:What will they do? by RayOfLight · · Score: 5, Funny

    ... the drive letters team is (still) working this one out.

  22. 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

  23. Re:What will they do? by BigJimSlade · · Score: 4, Funny
    What will MS do when they run out of letters in the alphabet for their language du jour?

    In newer versions of .NET, you will be able to mount new languages underneath the old language:
    C#:\NewLanguage
    This will eliminate the need for the old "Lettered Language" scheme that has haunted us since the DOS era. It will be revolutionary!
  24. Re:first post by Mocenigo · · Score: 2, Informative
    f # souns really good next to g

    Not really. F# and g form a dissonance, called a minor second. It happens though that I like g-f#, a major seventh. But maybe a listen to too much contemporary music.

  25. 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.

  26. The best man by FuzzyDaddy · · Score: 2, Insightful
    Hire the best man for the job.

    I certainly wouldn't hire an insecure prick for any job. Especially if he was so insecure he was grasping for straws as to why he wasn't succeeding. You think because someone doesn't speak english without an accent they're stupid? How's your hindi?

    --
    It's not wasting time, I'm educating myself.
  27. F-hash by wadiwood · · Score: 3, Funny

    The only time I read a # as "sharp" is when it is on a musical staff ie five parallel lines. Otherwise it is a hash as in #5 for number 5 or please press the hash key on the phone.

    hash definitions

    Of course when ever I see F# and Micro$oft together I read F#$%

    The description reads like F# is OCaml on hash ie dumbed down.

    --

    -- it must be true, it's on the internet.
    1. Re:F-hash by grahamlee · · Score: 2, Funny

      For some reason, British Telecom operators refer to the # key as "the square key". Well on my phone the two upright lines are not perpendicular to the two horizontal lines, so it's more of a rhombus than a square, but when I explain that to the ops, they hang up...

  28. Gee C# was so flawed that its already superceded by crovira · · Score: 2, Interesting

    There are three levels to programming.

    The first is for the silicon scrapers. Guys who write device drivers and who are amply served by assembler (for the real propeller-head bit-twiddlers) and and by C (Not C++, C) There is no sense of reality at this level.

    The second level is for the tool makers. The guys who bring you APIs and services like TCP/IP, Tuxedo, database managers, OpenGL, compilers, browsers and the like. Those folks use C++ and Java. Its a mistake to think that you can make an application in C++ or Java or Smalltalk. You can cobble something together that will cost too much and be too brittle for real-world use and eventually break (or break the bank.) The world becomes real.

    The last level is integrative. There aren't any languages which assimilate the concepts which programmers are confronted with in the real world.

    The best we have to date is sort of the second and a half level with languages which, with the support of a whole bunch of other third party systems (both code and manual procedures,) are sort of capable of some mimetic link between soma (the code) and extro (the specs.) (Sort of like CICS COBOL on mainframes.)

    From what I saw, F#, uh, isn't. Its better but still, its like C++, ObjectiveC or Smalltalk or any other container based language where contained objects have no clue that they contained unless the programmer creates and maintains explicit references to the container.

    The flaw starts there and gets carried forward.

    And computing is so fundamentally simple. Its a game of N-Dimensional topology bounded by finite vectors in every dimension. There's no mystery involved. You just need to maintain a meta-model of the system and you can generate the rest.

    What do you think programmers are and what do you think they're doing? They're code generators that fetch their own meta-model. Some do itbetter than other and some such at code generation too.

    --
    MSBPodcast.com The opinions expressed here are my own. If you don't like 'em... Think up your own stuff.
  29. After reading this article... by Shant3030 · · Score: 4, Funny

    I strongly suggest that Microsoft stick to making operat...(um), office pro..., (no thats not it...), web brow...(nope), how about video game...(nah)..., programming platfor...(not it either)...

    --
    100% Insightful
    1. Re:After reading this article... by alexjohns · · Score: 4, Funny

      They make pretty good Mice and Keyboards.

  30. Re:What will they do? by Medieval · · Score: 2, Funny

    Same thing they do every night, Pinky. Try to take over the world.

  31. Caml by Eudoxe · · Score: 2, Informative

    F# looks like OCaml. You can have a look on the libraries already present for this fabulous language on the hump http://caml.inria.fr/humps/index.html

  32. # == Hash by Anonymous Coward · · Score: 5, Funny

    Microsoft says it:

    F#ism is finally back in F#ion.

    I guess this means all Microsoft programmers are F#ists.

    Oh well, they're only in it for the C# anyway.

  33. Re:Gee C# was so flawed that its already supercede by swb · · Score: 4, Funny

    And computing is so fundamentally simple. Its a game of N-Dimensional topology bounded by finite vectors in every dimension. There's no mystery involved. You just need to maintain a meta-model of the system and you can generate the rest.

    Christ, if that's simple, I'd hate to hear you describe complicated.

  34. Haskell next? by axxackall · · Score: 5, Informative
    While I like ML (whole family) so much more than any imperative legacy (Java, C++, C, Perl), I see the main problem that any ML has with for modern RAD and with scripting is its static typing. And that's why I like (more than ML) Haskell - it's dynamically typed and thus it's much more appropriate both for operating scripting and for big app RAD.

    Until today, both ML and Haskell had a common problem: a lack of commercial and real world interest in it and therefore a lack of real-world libraries and supporting frameworks. But now things are going to be changed.

    First Ericson came with Erlang, an excelent essence of FP, LP, scripting and networking. Now M$ (I know - evil, but anyway) came with F# bringing OCaml to the real world saving from being forgotten somewhere in Inria.

    What next? I think that would be Haskell, the language even more suprior to ML, with already OOP, Parallel and Cuncurrent extensions. Also I like its Functional-Logical dialect - Curry. But who will bring it to the real world? IBM?

    --

    Less is more !
    1. Re:Haskell next? by KieranElby · · Score: 5, Informative

      I wouldn't bet against Microsoft bringing Haskell to the real world - their research department (which would put many universities to shame) has some top Haskell people, such as Simon Peyton Jones.
      There's some interesting papers by him over here.

    2. Re:Haskell next? by milesegan · · Score: 4, Informative

      Haskell is most certainly not dynamically typed. Like ML, it is a statically typed language with a compiler that does type inference at compile type. You don't usually have to manually declare types but you still have to get them right at compile time. There are some differences between ML's type system and Haskell's but they're basically the same animal.

      ML and Haskell differ mainly in that ML is an eager language, which evaluates all arguments to functions before evaluating the function. Haskell is a lazy language which delays evalution of function arguments until their values are needed.

      Erlang, on the other hand is dynamically typed.

  35. The process now understood by carlos_benj · · Score: 5, Funny

    There's a new language being formed in the bowels of Microsoft.

    This may help explain Microsofts process for developing new software. How are things "formed in the bowels" anyway? A simple understanding is that good stuff is essentially chewed to pieces and then deconstructed in an acidic bath. Once the good stuff reaches the bowels then an attempt is made to remove everything that is of value. Once that has been accomplished we are, I suppose, left with a Microsoft product that is ready to (careful here now) ship (Whew! Now that was one major Freudian slip just waiting to happen....).

    --

    --

    As a matter of fact, I am a lawyer. But I play an actor on TV.

  36. Re:Gee C# was so flawed that its already supercede by deacent · · Score: 2, Insightful

    The second level is for the tool makers. The guys who bring you APIs and services like TCP/IP, Tuxedo, database managers, OpenGL, compilers, browsers and the like. Those folks use C++ and Java. Its a mistake to think that you can make an application in C++ or Java or Smalltalk. You can cobble something together that will cost too much and be too brittle for real-world use and eventually break (or break the bank.) The world becomes real.

    I take issue with this. I have designed and implemented apps in both C++ and Java that were flexible enough that we were able accommodate unexpected customer requests. And they didn't break the bank, considering their feature set.

    Funny. I remember a time when folks used to believe that Java and C++ (and other OOLs) weren't fit for such low-level work because of the compilers/linkers tended to make the code pretty inefficient. I guess I'm showing my age. :)

  37. Re:That's how I feel about most Microsoft language by Unominous+Coward · · Score: 2, Insightful

    I think that if you examine the C# and F# languages, you'll find that they both fall flat.

    --
    "Smoking helps you lose weight - one lung at a time" -- A. E. Neumann
  38. Imperative and functional lanuages by jfengel · · Score: 4, Interesting

    It's usually a very bad idea to include imperative aspects in functional languages.

    Functional languages are amazing creatures. They're really strange to work in. They take a serious change of mindset. They can be very slow to execute. I/O is really odd when side effects are forbidden.

    They have astounding benefits, too. The localization of effect means that they're really easy to debug. The lack of side effects means that some really enormous optimizations are open, which is crucial since the naive execution is slow.

    Once you throw in any imperative aspects at all, these effects go right out the window. Even a single imperative statement potentially interferes with every optimization. ("Can I eliminate this execution branch? It seems like a redundant call but it might branch to that imperative statement.")

    I think that this got in the way of ML. It can be easy to want to add just a tiny imperative element to make something easier, but that small crack opened up a lot of headaches for me. I greatly preferred the purity of Haskell.

    I haven't read the F# spec, so I may be overreacting from the notoriously inaccurate Slashdot summary. That's next.

  39. Yes, I can't wait for G# by protein+folder · · Score: 2, Funny

    'Ghash!' muttered Gandalf, 'I wonder if that is what they meant: that the lower levels are on fire? Still we can only go on.'

    'Ai! ai!' wailed Legolas. 'A Billrog! A Billrog is come!'

    --
    Your mind is squeezed by a blast of pain!
  40. Functional Programming by jefu · · Score: 4, Interesting

    Functional Programming is a Very Good Thing to learn.

    After being interested in functional programming languages for a while I had the opportunity to spend some time reviewing a textbook using ML. I figured that was the time to learn the language. Got frustrated quickly, I got several ML systems (including the one mentioned in the book) and no two worked alike. Hell, the syntax varies enough that there are ML dialects that look like completely different languages.

    A while later I decided that perhaps it was time to spend some energy seriously learning Haskell. I got and installed Hugs (Haskell.org is a wonderful resource with several Haskell systems listed, tutorials, documentation, libraries and so on). Hugs implemented pretty much all of the Haskell described in the manual I found and the tutorials. (Today, I'd probably use the interactive GHC.)

    It took a while, some dedication and a lot of grumbling to figure out how things worked and I'm still learning bits and pieces of the language and associated libraries and stuff.

    Now Haskell is one of my favorite languages and I want to use functional tools (higher order functions, laziness, and so on) in every language I use. I'd say that Haskell changed my ideas about programming, my approach to problems, and my toolset both deeply and widely - and for the better. Probably as deep a shift in technology and technique for me as OOP (I started programming in Fortran, APL, Algol...) - but then OOP just always seemed Right to me.

    Part of what made the learning process so effective was that Haskell makes it very hard to have side effects - so where in ML the books/tutorials often introduce mechanisms for building variable that work more or less like those in C - in Haskell this is very difficult.

    So, while F# may be an interesting language, if you want to learn a new language, try Haskell. You may have to be obstinate. And if it works with you as it did me, it will drive you crazy until it clicks (and I remember exactly the problem that did it) and then you'll just kind do one of those quiet awestruck "wow"s and watch your view of programming change.

    Haskell isn't the right language for everything. I also use Java, C and Python (and a few others) often - but for lots of problems, for doing a quick model of something to try it out, for just helping your mind think about a problem a bit differently ... Haskell is great.

    But remember - you may well have to be stubborn about persisting till it clicks.

    And on a related note...
    Does anyone know if anything ever came out of the development of the functional scripting language "Sheep" for the amiga?

  41. Microsoft's next language by Webmoth · · Score: 3, Funny

    Rumor has it that Microsoft is working on a "lite" version of F# to be called "F Micro" or "Fu" for short.

    Oh wait, their lawyers already use it. Must be past beta then.

    --
    Give me my freedom, and I'll take care of my own security, thank you.
  42. Mapping functions on lists can be done in C++ too! by 3770 · · Score: 2, Interesting

    So he talks about how you can implement that Map function on a list.

    fun Map f [] = []
    | Map f (h::t) = f h :: Map f t;

    And this is beautiful. I love functional languages. But just for completeness, this can also be done in C++.

    The following code should compile with the proper headers on any platform that supports C++

    //prepare the vector
    vector<float> v_i;

    v_i.push_back(1);
    v_i.push_back(3);
    v_i.push_back(5);

    //And here we map sqrt on all elements in the vector
    transform(v_i.begin(), v_i.end(), v_i.begin(), sqrt);

    //And this is another type of mapping to print the vector
    copy(v_i.begin(), v_i.end(), ostream_iterator<float>(cout, ", "));

    --
    The Internet is full. Go Away!!!
  43. Nickle by po8 · · Score: 2, Interesting

    Want an "interesting mix of imperative and functional features" in a language any C/C++/Java programmer can start working with immediately? Try Nickle.

  44. Re:That's how I feel about most Microsoft language by paranode · · Score: 2, Interesting
    While I agree with the sentiment among most Slashdot readers that Microsoft's languages are less than perfect, they do have some use. Yes they tend to throw standards out the window and follow their own path. However, having used several of Microsoft's languages, I must say that they are actually surprisingly easy to learn. They are quite powerful in the realm of Windows programming. Many of the conveniences one finds in a modern open language like PHP can be found in just about all of Microsoft's programming languages. I understand that most real hardcore programmers would prefer to have more control and bypass APIs, but Windows programming is not quite as convoluted as many would claim. It has progressed quite a bit since the days of Visual Basic 5.
    I don't work for a company that programs for Windows or anything, I've simply used the tools in my spare time to make useful little Windows programs. So I can say firsthand that it isn't really so bad. I still get my hands dirty with small Linux apps from time to time and I stick with C/C++ for all that (as if there was a huge choice). Seriously, though, I doubt it could be easier to learn how to make a full-fledged X-capable app with widgets in Linux than it is to just open up Visual Studio and whip up a simple app that does the backend stuff for you. On the same note, I understand that many people hate the abstraction that goes on here and that makes sense.

    The bottom line is that if you've got to do some Windows programming, the tools are easy to use and there is plenty of documentation for learning.

    Just my two cents.

  45. Re:Why I like C... by MisterFancypants · · Score: 2, Insightful
    C isn't as portable as perl, python, php or java. C and C++ suffer from either incomplete or random interpretations of the specifications.

    That is one of the most ridiculous things I've ever read. What are Perl, Python, php and Java implemented in? C! If C wasn't portable enough to run on all the platforms those languages do, those language's runtimes wouldn't compile on those platforms!

    Find me a platform that runs any of those languages that doesn't also have a gcc port that allows you to write portable code in C.

  46. Strange then by Julian+Morrison · · Score: 2, Interesting

    ...that Ocaml is speed competitive with C when compiled, and with java when bytecoded. Meanwhile haskell is more in the same speed category as awk and tcl.

    Data here.

  47. Undermining search engines? by mooman · · Score: 2, Interesting

    is it just a coincidence or is Microsoft picking langauge names that a lot of search engines can't handle? C#? F#?

    I just did some tests with C# and less than half the search engines I looked at actually used the full string for the query. The rest dropped the # as punctuation and gave me any generic "C" results it could find.

    Was there any thought put into this? Have we heard any statements or interviews from Microsoft about this?

    Personally, with C, C++, and C# all looking identical to some search engines, I think they are going to make life rough for developers trying to look up documents/tips/errors/FAQs about their respective languages...

    --
    In the Portland, Ore area and like card games? Check out: http://groups.yahoo.com/group/portlandgames/
  48. Re:That's how I feel about most Microsoft language by Dwonis · · Score: 2, Insightful
    If you don't like it, submit a patch to the API!

    Oh, wait...