Slashdot Mirror


An Interview With F# Creator Don Syme

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

267 comments

  1. There going to run out of musical notes soon... by Wingman+5 · · Score: 4, Funny

    Will D flat be the same language as c#?

    1. Re:There going to run out of musical notes soon... by Anonymous Coward · · Score: 5, Funny

      In music theory, F# is as far as you can get from C.

    2. Re:There going to run out of musical notes soon... by bipbop · · Score: 3, Informative

      Now that would be unjust.

    3. Re:There going to run out of musical notes soon... by yo303 · · Score: 1

      It's funny 'cause it's true.

    4. Re:There going to run out of musical notes soon... by Anonymous Coward · · Score: 1, Informative

      In music theory, F# is as far as you can get from C.

      if you want to stay in the same octave, otherwise it is 16khz

    5. Re:There going to run out of musical notes soon... by JamesP · · Score: 1

      I know someone is going to play smart-rear-end and create B# or something

      --
      how long until /. fixes commenting on Chrome?
    6. Re:There going to run out of musical notes soon... by Anonymous Coward · · Score: 0

      Did you learn Moonlight Sonata 1? A lot of B#s there...

    7. Re:There going to run out of musical notes soon... by Anonymous Coward · · Score: 0

      Not true, go educate youself.

      By the way, C and F#, that sounds like Rush's YYZ!

    8. Re:There going to run out of musical notes soon... by Ralph+Spoilsport · · Score: 1
      And F# is evil Evil EVIL!!!! it is a tritone of C, which is THE DEVIL'S INTERVAL!!!

      EVIL!!!!

      --
      Shoes for Industry. Shoes for the Dead.
    9. Re:There going to run out of musical notes soon... by Anonymous Coward · · Score: 0

      The 3rd movement too, if you need a lot of them in a hurry.

    10. Re:There going to run out of musical notes soon... by Hognoxious · · Score: 1

      I know someone is going to play smart-rear-end and create B# or something

      Someone like Kernighan & Ritchie?

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    11. Re:There going to run out of musical notes soon... by bipbop · · Score: 1

      That makes absolutely no sense, by the way.

    12. Re:There going to run out of musical notes soon... by spazdor · · Score: 1

      Actually, 16744Hz is a C. That's not very far at all.

      --
      DRM: Terminator crops for your mind!
    13. Re:There going to run out of musical notes soon... by Anonymous Coward · · Score: 0

      A term I coined when asked about the differences between VB.NET and C#

  2. Anyone else think is was a .NET Fortran? by IvyKing · · Score: 1
    Being an old fuddy-duddy, my first thought that Microsoft was doing a dot NET version of Fortran, but...

    Obvious retort is why?

    1. Re:Anyone else think is was a .NET Fortran? by serps · · Score: 1, Interesting

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

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

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

      I admit I know bugger all about Fortran, but I suspect it doesn't have the full functional programming support that, say, Haskell boasts. At any rate, even if it did, it's likely that the last 50 years have advanced the field of programming sufficiently to make a new language worthwhile. So if you're up for functional programming on the .NET platform, F# is a great addition.

      --
      "Einstein argued that [...] God is not capricious or arbitrary. No such faith comforts the software engineer." ~ Brooks
    2. Re:Anyone else think is was a .NET Fortran? by rahuja · · Score: 1

      Yeah, that was my initial reaction too before reading the summary.

    3. Re:Anyone else think is was a .NET Fortran? by Dunderflute · · Score: 1

      Fortran has supported object-oriented programming since Fortran 2003. It's on the Wikipedia article you cited.

    4. Re:Anyone else think is was a .NET Fortran? by Anonymous Coward · · Score: 0

      Fortran is more than fully functional enough to make a FreeDos clone optimized for solid state disk performance. Expect the first Alpha to show up on SF in a month.

    5. Re:Anyone else think is was a .NET Fortran? by hairyfeet · · Score: 2, Insightful

      Just out of curiosity, since you post has done locked up my brain...why exactly would you WANT a "FreeDOS clone optimized for SSD" anyway? DOS is really very tiny, so tiny in fact that even on the most RAM deprived of Kiosks you should have no problem simply loading DOS into RAM. And if you are doing something with a lot of heavy I/Os then DOS probably wouldn't be the first choice anyway.So is this one of those "because it's there" kind of deals, or is there a specific purpose in mind?

      And as for F# if it fits better than other languages for a job I say great. I've always said every language has its place, even the much maligned VB6. For making a basic GUI for a local database VB6 was the best tool IMHO for the job. And if F# is really as simple to pick up as he says maybe F# can become the new teaching language like old VB was back in the day.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    6. Re:Anyone else think is was a .NET Fortran? by j1m+5n0w · · Score: 4, Informative

      To say a language is "functional" does not mean the same thing as the common usage of the word, which is to say "useful" or "utilitarian", though in my experience with Ocaml, Haskell, and Erlang, they are that as well if you take the time to learn to use them well. Fortran and F# have just about nothing in common.

      The name "functional" is a little confusing, since imperative languages are heavily based on functions as well, though they are not typically used in the same way. For instance, in a functional language it is usually much easier to write functions that compute useful things without causing side effects, such as modification of shared state. They also usually support such features as tail call optimization (which causes certain forms of recursion to require constant rather than linear stack space), closures, the ability to declare functions within other functions, and the ability to call a function with less than its expected number of arguments, yielding a function of the remaining arguments.

      Another common trait of functional languages is the absence of looping constructs, in favor of recursion and library functions like map and fold.

    7. Re:Anyone else think is was a .NET Fortran? by shutdown+-p+now · · Score: 3, Informative

      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, nonetheless - made by Fujitsu of all things.

    8. Re:Anyone else think is was a .NET Fortran? by shutdown+-p+now · · Score: 4, Informative

      Oh, by the way, Fujitsu must really be into BDSM or something - they also offer COBOL for .NET.

    9. Re:Anyone else think is was a .NET Fortran? by Leynos · · Score: 1

      Nah. They just have a lot of customers maintaining old mainframe applications written in COBOL.

      --
      "Did you exchange a walk on part in the war for a lead role in a cage?"
    10. Re:Anyone else think is was a .NET Fortran? by da_matta · · Score: 1

      Don't you get it, that's a migration path right there:
      1) Migrate existing COBOL code to .NET
      2) Start migrating modules one by one to C# or ASP.NET or what ever makes sense (even keeping some in COBOL)
      3) Start saving money on maintenance and being more future proof

      It's still a hell of a migration project but significantly better than reimplementing from scratch or having that same system running in 10 years.. :/

    11. Re:Anyone else think is was a .NET Fortran? by ByteSlicer · · Score: 1
      Your migration path fails at the first step.

      1) Migrate existing COBOL code to .NET

      There are so many COBOL variations, each with their own intricacies, that even migrating code from one COBOL to another is like walking a mine field.

    12. Re:Anyone else think is was a .NET Fortran? by jonwil · · Score: 1

      If you had an Access database, classic VB was a great way to talk to it, far superior than the Access UI design tools themselves (anyone who proposes designing a database UI in Access should have their head examined)

    13. Re:Anyone else think is was a .NET Fortran? by Anonymous Coward · · Score: 0

      And how in the world does COBOL for .NET help with that at all? Surely running your ancient code on a new, unproven platform is wildly dangerous.

    14. Re:Anyone else think is was a .NET Fortran? by MoeDrippins · · Score: 1

      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.

      --
      Before you design for reuse, make sure to design it for use.
    15. Re:Anyone else think is was a .NET Fortran? by johnlcallaway · · Score: 3, Interesting

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

      --
      I rarely read replies, it's my opinion and if you thought about your opinion a little more, I'm OK with that.
    16. Re:Anyone else think is was a .NET Fortran? by msclrhd · · Score: 1

      The functional programming languages (Haskell, F#, ...) are referring to functions in a mathematical sense.

      When programmers talk about functions (in Pascal, C, C++, ...) they are referring to procedural programming languages.

      In C++, the Standard Template Library (STL) is using a lot of functional programming techniques and style, albeit in a language that does not directly support functional programming.

    17. Re:Anyone else think is was a .NET Fortran? by Pengo · · Score: 1

      Yeah, but even Access has it's place.

      I had a simple tool that needed writing a few years ago, a engine that generated checks from mail-in rebates. It was a simple import process from a CSV and a daily print-job from our logistics room. That project was thrown together on a weekend and is still in use today, no problem no drama.

      I could of written something in Java and put it on the web, and done PDF outputs, etc etc. but why? Access was a nice little tool that did EXACTLY what the problem required. A VB front end would of taken an extra day or two of time to get working and tested when i could copy a Access file to any computer running access and had a printer plugged into it and they were good to go. :)

    18. Re:Anyone else think is was a .NET Fortran? by Anonymous Coward · · Score: 0

      Well then we'd better keep the status quo until the end of time. Sure, that attitude benefits no one except COBOL programmers, but they are what's important here, right?

    19. Re:Anyone else think is was a .NET Fortran? by Anonymous Coward · · Score: 0

      I know I work for Fujitsu, and I'm into BDSM - but I dont know if I share that interest with any others in the company?

    20. Re:Anyone else think is was a .NET Fortran? by Kartoffel · · Score: 1

      Me too. I figured Microsoft simply grafted .NET junk on top of FORTRAN. It's actually a pleasant surprise to find out this F# is actually some kind of functional programming.

    21. Re:Anyone else think is was a .NET Fortran? by Anonymous Coward · · Score: 0

      >imperative languages are heavily based on functions as well

      No they aren't; they're based upon procedures. Learn the difference.

    22. Re:Anyone else think is was a .NET Fortran? by hairyfeet · · Score: 1

      Exactly! For certain jobs, which with SMBs were quite plentiful, VB plus Access made a perfect tool. For an example I whipped off a VB plus Access tool for a junkyard a few years back. if you came to ask them about a particular model before they would break out a big book that had lists written into it of the various makes and models they had on one of their three lots. With my little VB plus Access tool the secretary at the main site simply uploaded the new inventory into the GUI once a week, and mailed it out to the sister sites via email.

      Now if you go in there they simply pull up the manufacturer (Ford Chevy etc) and they get a nice drop down list of decades. When they choose a decade it gives them a list of make and model, along with a code that corresponds to which lot and where exactly the car is located. It took me less than a weekend to throw it together, and it does exactly what they needed it to do, keep track of inventory. Sure you could have done it in C# or Java, but hiring a coder would have cost them more than they could afford and frankly wasn't needed.

      So I never understood all the VB hate you get here. If you simply stick to the job it was designed for (VB GUI into a database) it really was and is a great little tool. And it really isn't that hard to use other databases if you hate Access, there are even tutorials on how to use OO.o Base or even SQLLite if that floats your boat.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    23. Re:Anyone else think is was a .NET Fortran? by jamesswift · · Score: 1

      Nice summary. I would add to that the upshot of function is the so called concept of purity. Ie. pure functions, which are usually the default in functional languages. The advantage of which is given a set of inputs to your function you will always get the same result.

      Here's a good recent article http://muckandbrass.com/web/display/~cemerick/2009/12/30/All+my+methods+take+316+arguments%2C+and+I+like+it+that+way

      --
      i wish i could stop
    24. Re:Anyone else think is was a .NET Fortran? by IntlHarvester · · Score: 1

      Visual Basic the language was rightfully hated for some terrible design decisions that made it awkward to program with.

      Most informed people recognized the power of VB the GUI RAD environment though - hatred towards all things VB is usually driven by elitism (or grumpy ex-Delphi programmers). Its very similar to how PHP is looked down upon by Python/Ruby types - the environment is considered too accessible to newbies and many of the results aren't pretty.

      --
      Business. Numbers. Money. People. Computer World.
    25. Re:Anyone else think is was a .NET Fortran? by jonwil · · Score: 1

      Yes, access has its place if you need (as it seems in your case) minimal or no UI.

      But if you need a full database UI (to enter data, generate reports etc) use a REAL tool for the job.

    26. Re:Anyone else think is was a .NET Fortran? by Anonymous Coward · · Score: 1, Interesting

      Purity essentially defines "functional" as a programming paradigm. Purity allows programs to be reasoned about in terms of "term languages" of recursive structures. Haskell's list data structure is isomorphic to the type:

      data List a = EmptyList | Cons a (List a)

      A list is either empty, or it is a an "a" attached to a list of "a"s via Cons. There are two cases. And only two cases. Functions on lists only have to handle these cases. How would we concatenate lists?


      (++) :: List a -> List a -> List a
      EmptyList ++ right = right
      left ++ EmptyList = left
      (Cons h t) ++ right = Cons h (t ++ right) --

      The last night reads "The concatenation of (Cons h t) (whose head is h and tail is t) and another list is the Cons of h and the concatenation of the tail t and the right List."

      Notice that in addition to being simple brief, the code also happens to be true. This code is basically a proof that Lists form a "monoid" -- an algebraic structure with an "additive" operation. This abstraction so common that it has been abstracted into the Monoid type class:


      class Monoid m where mappend :: m a -> m a -> m a

      For any data type for which you can prove is a monoid, you can create an "instance declaration" for the Monoid type class, and gain the benefit of all theorems proved about Monoids (all functions defined in the Monoid type class). This is somewhat similar to OO inheritance, but a little different. Classes and subclasses -- which can be defined with the => ("implies") operator -- share a relationship of logical necessity, and is not suitable for ad hoc polymorphism. To get that, you simply create a new type, and declare it an instance of your type class. You can even create a wrapper around an instance, and create a new instance for the wrapper, emulating ad hoc polymorphism quite nicely.


      data Rainbow = Red | Orange | Yellow | Green | Blue | Indigo | Violet
      class Rainbow obj where color :: obj -> Rainbow

      instance Color Rainbow where color = id

      newtype WebSafe = WebSafe Rainbow
      instance Color WebSafe where
              color (WebSafe Red) = Blue -- The tricky bit ;-)
              color (WebSafe c) = c

      A key consequence of purity is programmatic monadism. Evaluating a program always amounts to evaluating a function for a state, either by some internal representation of state as in Haskell's State monad, or by some support environment like Haskell's IO monad or Scheme's REPL loop (or init. Or the kernel. Or the processor. It's turtles, sequencing everything above them, all the way down). But this monadism also implies that evaluating a function amounts to joining properly typed data structures (because the function must work for any state). Indeed, this ought to be obvious. A function is isomorphic to a subset of the cartesian product of two types, with some constraints. A function is clearly a "join" of some kind. As the relational algebra people have been saying for years, joining data is complicated by not using the normal forms for data. A functional programming language supports simple normal forms for complex recursive data structures, and makes writing "joins" on these structures simple.

    27. Re:Anyone else think is was a .NET Fortran? by Anonymous Coward · · Score: 0

      Dumb, that class declaration ought to say "class Color obj where".

    28. Re:Anyone else think is was a .NET Fortran? by Billly+Gates · · Score: 1

      I think people like familiarity.

      C# and Java are much more similiar to C++ syntax wise. VB is just different and yes it has some serious shortcomings. I admit I am not a professional programmer but I occasionally write scripts and code as a hobbiest. VB 6 and earlier versions lacked many features of advanced languages and many coders complain its terrible to use for +1 million lines of code. Suppose VB.net is different and has a rich .NET api.

      I do think Excel, Access, and Vb are the best of the breed for general business needs. I wish Linux had something like Access and at least macs have Filemaker (lacks a vb like support). Just make sure you have 'Option Explicit' set or you will end up in the deepest bowels of hell fast.

    29. Re:Anyone else think is was a .NET Fortran? by IntlHarvester · · Score: 1

      I was looking for an old page called something like "Ten reasons VB is a terrible programming language" (I can probably only remember 3 or 4 off the top of my head -- Arrays, no logical shortcuts, no bulit-in hashs, True = -1). Couldn't find it, but did find an interesting quote:

      For example, I personally believe that Visual Basic did more for programming than Object-Oriented Languages did. Yet people laugh at VB and say it's a bad language, and they've been talking about OO languages for decades.
      And no, Visual Basic wasn't a great language, but I think the easy database interfaces in VB were fundamentally more important than object orientation is, for example.

      -- Linus Torvalds

      --
      Business. Numbers. Money. People. Computer World.
    30. Re:Anyone else think is was a .NET Fortran? by ais523 · · Score: 1

      F# is more like a .NET-ised version of one of the ML languages (such as OCaml), just like C# is a .NET-ised version of Java. (I know OCaml and Java and can read F# and C# without real problems; the syntax is marginally different, but the only really major difference is in the libraries.)

      --
      (1)DOCOMEFROM!2~.2'~#1WHILE:1<-"'?.1$.2'~'"':1/.1$.2'~#0"$#65535'"$"'"'&.1$.2'~'#0$#65535'"$#0'~#32767$#1"
    31. Re:Anyone else think is was a .NET Fortran? by Anonymous Coward · · Score: 0

      Fortran is a procedural language, not a functional one.

    32. Re:Anyone else think is was a .NET Fortran? by jesboat · · Score: 1

      The name "functional" is a little confusing, since imperative languages are heavily based on functions as well, though they are not typically used in the same way.

      Actually, imperative languages are typically based on procedures, not functions. The fact that such languages tend to call procedures "functions" is the confusing bit.

  3. never programmed before??? by madddddddddd · · Score: 0, Troll

    the solar system is a program of physics. a child understanding the program enough to alter a simulation of it makes the claim of the child having no programming experience quite questionable.

    go tell someone else, marketing droid. F# stinks.

    1. Re:never programmed before??? by Mr.+Freeman · · Score: 2, Interesting

      Dunno why exactly this was modded all the way down to -1, he has a good point.

      A child "modifying a program" isn't very spectacular. Any moron with no experience can modify "hello world" to spit out "goodbye world". I'm quite certain that "modifying a solar system simulation" went something along the lines of this:

      Problem 1:
      Part A) Replace the values in the program with the proper values for the orbit of the planets. // This is the time it takes jupiter to revolve around the sun (in earth days)
      int orbit_of_jupiter = 0; // This is the same as above, but for earth.
      int orbit_of_earth = 0;

      void main()
      {
      lots of programming that is NEVER looked at or touched by the student;
      }

      Part B)
      Record your results in the Excel spreadsheet and email it to the teacher. Then print out a copy and hand it in because the teacher isn't quite smart enough to open attachments in outlook.

      I mean, seriously people. When you hear claims of "High school child modifying amazingly complicated programs that take years of know how to write correctly", think about it for a little bit. If it sounds too good to be true then it probably is. If F# were this amazing new language that allowed anyone with no experience to write any program, we'd have heard about it one hell of a long time ago.

      --
      -1 disagree is not a modifier for a reason. -1 troll, flaimbait, redundant, overrated are NOT acceptable substitutes.
    2. Re:never programmed before??? by shutdown+-p+now · · Score: 2, Insightful

      He was probably modded as troll because, while he may be entirely correct about "marketing droids", the conclusion that "F# stinks" doesn't exactly follow from that - unless he has some specific horror stories to share. Or at least saw the language, and is qualified to judge on its merits (i.e. familiar with similar existing languages).

    3. Re:never programmed before??? by EsbenMoseHansen · · Score: 4, Informative

      He was probably modded as troll because, while he may be entirely correct about "marketing droids", the conclusion that "F# stinks" doesn't exactly follow from that - unless he has some specific horror stories to share. Or at least saw the language, and is qualified to judge on its merits (i.e. familiar with similar existing languages).

      Looking at the wikipedia articles, I tend to think he has a point. Look at the F# version of the famous factorial program and compare to the Haskell version(s). I think anyone would be hard-pressed to prefer the F# version, but who knows?

      --
      Religion is regarded by the common people as true, by the wise as false, and by rulers as useful.
    4. Re:never programmed before??? by shutdown+-p+now · · Score: 3, Insightful

      F# version is essentially the same as OCaml version. In practice, you will notice that there are a lot of people who prefer OCaml to Haskell even today, and that has to do with quality of implementation. Haskell is a nice language on the paper, but its laziness makes it both hard to implement fast, and insanely hard to debug.

      With F#, you get language on par with OCaml (so less high-level and expressive than Haskell). But you also get the ability to directly call any existing .NET library - no wrappers or FFI declarations needed. Furthermore, you get an IDE with syntax highlighting, code completion, error checking as you type, and debugging.

      Also, keep in mind that most people who get acquainted with F# today aren't familiar with Haskell. In fact, most of them don't even know it exists. They are C++, C# and VB users, who suddenly discover a new project type in VS2010, and are curious as to what this is all about. For them, the basis of comparison will be a typical imperative OO language, not Haskell - and most marketing materials are written with that in mind. It is generally assumed that people who know Haskell can judge these kind of things on their own :)

    5. Re:never programmed before??? by madddddddddd · · Score: 0

      i do have horror stories to share. do you need to hear them?

      more importantly, i have very positive stories to share about very positive things. none of them include claims by the manufacturers that include statements that reduce to MANIPULATIVE LIES.

      i do not deal with people that operate in that fashion.

      F# STINKS.

      my dog eats poop... i'm not saying you shouldn't eat F# up... i'm sure lots of people will. people who don't mind things that STINK.

    6. Re:never programmed before??? by EsbenMoseHansen · · Score: 3, Informative

      F# version is essentially the same as OCaml version.

      I don't know OCaml (I have a cursory knowledge of Haskell, which is why I picked that for comparison), but I could read the OCaml version no problem. The Scala version was difficult, but after staring at it for a bit I understands what it's getting at (especially the _ syntax is unnecessary obtuse). I still think F# is the worst of the lot. Big disclaimer: I have only looked at the factorial example. So this is sort of criticism based on "Hello World" snippets. I'm just saying that the poster far above might actually know what he is talking about,.

      --
      Religion is regarded by the common people as true, by the wise as false, and by rulers as useful.
    7. Re:never programmed before??? by madddddddddd · · Score: 0

      while he may be entirely correct about "marketing droids", the conclusion that "F# stinks" doesn't exactly follow from that

      it does when the subject in question is THE CREATOR OF THE PRODUCT.

      F# STINKS

    8. Re:never programmed before??? by KeithIrwin · · Score: 0

      I'm sorry. I don't understand. What is it about this that's so objectionable?

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

      Is it the match? We could write it using if instead if you'd prefer:
        let rec factorial n = if n > 0I then n*factorial(n-1I) else 1I
      Is it using I as a postfix for arbitrary precision integers? That's a little awkward but doing something like that is necessary if we're going to use successfully infer the type. I just don't understand what's so confusing about this.

    9. Re:never programmed before??? by jmac_the_man · · Score: 1

      i do have horror stories to share. do you need to hear them?

      F# isn't in Visual Studio 2008, is it? (I just checked Wikipedia, and no, it will be fully supported for the first time in VS2010.) What you have been working with isn't a production system yet. What horror stories about F# could you possibly have?

    10. Re:never programmed before??? by EsbenMoseHansen · · Score: 1

      Well, I may be stupid, but still. No, the match I understood as a funny way to write case statements. The -> is clear as well, but the 0l? I supposed l is for long, but I guess it meant "arbitrary precision integers" And the _? What's the deal with that? I also cannot guess what "rec" standard for. Compare this to the Haskell example:

      factorial :: Integer -> Integer
      factorial 0 = 1
      factorial n = n * factorial (n-1)

      Here, I see plain English (Integer) and only two magic symbol (::, ->), the latter of which should be plain for anyone having even a basic schooling in mathematics (where functions are usually written as f:X->Y, a syntax few programming languages use for some reason). Contrast this with the F# version: Magic symbols ( |, ->, l, _ ) and a slew of non-obvious words ( let, rec, match .. with .. ). I think the Haskell version is much, much cleaner.

      In all cases, I have ignored the math symbols =,+,*,- etc as being common between almost every language out there, and thus irrelevant.

      --
      Religion is regarded by the common people as true, by the wise as false, and by rulers as useful.
    11. Re:never programmed before??? by KeithIrwin · · Score: 1

      Okay, I can see your point. The "rec" is definitely confusing and it's one of the things I would remove from the language. It's short for recursive and is required if your definition of the function is going to make a call to the function. I've never understood why that would be required.

      I really think that "let" is pretty straightforward. If you've never heard a teacher or professor say "let f equal ..." then I'm not sure where you've gotten your mathematics background.

      The "match" and "with" parts seem pretty straight-forward if you understand that what happens in any of these definitions is that the value of the variable is matched against possible patterns until it matches (same thing happens in Haskell with the multiple definitions of the function), but if you're new to them, I can understand the confusion.

      And _ is definitely just a magic piece of punctuation whose role is not clear to the layman. In case you're curious, it's used to match anything. You might think that it would make more sense to use something like "what's left" or something like that, but the _ really is useful when doing more complex pattern matching because you can use it inside the pattern.

      So I see what you mean. But I should note that all of these things (rec, match, with, _) come from Ocaml (from which F# is immediately derived. You can write Ocaml code and add one line and F# will compile it). The differences between Ocaml and F# in the wikipedia examples is primarily a difference in coding choices rather than syntax. You could use the if-style or the match-style version of the function in either language. (Not that I'm expecting you to know that because there's nothing in the wikipedia article which indicates this.)

      Anyway, thanks for answering my question.

    12. Re:never programmed before??? by Ornedan · · Score: 2, Interesting

      One can write a Haskell version of factorial that looks pretty much the same as the F# version:

      factorial :: Num a => a -> a
      factorial n =
        case n of
          0 -> 1
          _ -> n * factorial (n - 1)

      This contains similar pattern matching expression, even using the same match-anything-pattern-keyword '_' and some additional polymorphism syntax in the type signature. The type signature could be left out and what's shown is what the compiler would then automatically derive.

    13. Re:never programmed before??? by msclrhd · · Score: 1

      vim has syntax highlighting for every programming language and file format known to man (well... nearly). Emacs, gedit, kate and others support a lot of different languages as well. However, Visual Studio only supports syntax highlighting for languages it can compile.

      I hate code completion. If you mis-type something, the editor will fill out the wrong thing for you. For editing XML, you can't wrap some text in a tag, as Visual Studio auto-completes the end tag for you. I always type both quotes after an attribute, so end up with 3 quotes in Visual Studio! And yes, when I use Visual Studio, I have these turned off, thank-you-very-much!

      Auto-complete for method names means that you end up playing hunt-the-function-name-game and don't necessarily understand what it is you are typing.

      Error checking is good, but having it report that you need to close a parenthesis or XML tag as you are writing the document and haven't written that yet is very annoying.

      Debugging in the one area where Visual Studio is very good, but well-written tests with good test coverage, and decent logging/error reporting should remove most of the need for debugging.

    14. Re:never programmed before??? by shutdown+-p+now · · Score: 1

      The -> is clear as well, but the 0l? I supposed l is for long, but I guess it meant "arbitrary precision integers"

      Yes, it does. F# guys went for limited-precision integers (the usual 32-bit int) by default for performance reasons.

      And the _? What's the deal with that?

      It has the same meaning as in Haskell - it's a placeholder that matches anything, and doesn't bind the matched part to a variable.

      "let rec" ("rec" means recursive) is used mainly so that you can redefine an existing variable in terms of itself. For example:

      let x = 1
      ...
      let x = x + 1
      ...

      If "rec" was the default, the second "let" would have been invalid, since it references the variable in its own definition. I think Haskell would have actually let you get away with writing this because of its laziness - it'd just end up in an infinite loop if you ever evaluate x. F#, in contrast, isn't lazy.

      In any case, I don't think anyone would argue that Haskell syntax is much closer to the traditional math notation - it's one of the explicit design goals for the language. However, there's more to it than syntax. For example, can you point out a decent Haskell IDE?

    15. Re:never programmed before??? by EsbenMoseHansen · · Score: 1

      However, there's more to it than syntax. For example, can you point out a decent Haskell IDE?

      I did write, several times, that I was comparing languages by one example. Does that sound like I would know such stuff? Anyway, try this :P

      --
      Religion is regarded by the common people as true, by the wise as false, and by rulers as useful.
    16. Re:never programmed before??? by Tawnos · · Score: 1

      "Debugging in the one area where Visual Studio is very good, but well-written tests with good test coverage, and decent logging/error reporting should remove most of the need for debugging."

      That sounds like a case of "let's not bother debugging, we'll throw some more printf in there and see where it goes wrong." Debugging is much more powerful than simple test coverage and incorrect output - it allows you to do things like verify your error handling code paths work as expected, check why a program that works on one system but not another is failing (without having to recompile and deploy new binaries), and other stuff. Logging/error reporting is a poor substitute for proper debugging, especially in any non-trivial program.

    17. Re:never programmed before??? by shutdown+-p+now · · Score: 1

      vim has syntax highlighting for every programming language and file format known to man (well... nearly). Emacs, gedit, kate and others support a lot of different languages as well. However, Visual Studio only supports syntax highlighting for languages it can compile.

      Not really. From plugin API point of view, syntax highlighting (and all language services) are entirely separate from the build system, so you absolutely can write a custom syntax highlighter for VS without doing the whole thing. It's just that few bother.

      I hate code completion. If you mis-type something, the editor will fill out the wrong thing for you. For editing XML, you can't wrap some text in a tag, as Visual Studio auto-completes the end tag for you. I always type both quotes after an attribute, so end up with 3 quotes in Visual Studio! And yes, when I use Visual Studio, I have these turned off, thank-you-very-much!

      I also find automatic code completion annoying, but what's wrong with pop-up hints that only show you the options, and don't impede you in just typing whatever you want?

      Auto-complete for method names means that you end up playing hunt-the-function-name-game and don't necessarily understand what it is you are typing.

      That's a weird argument. For one thing, if functions are well-named, usually you just pick what is right that way (I could even say that it encourages API designers to name their functions properly). Furthermore, code completion in VS also shows documentation for the function you select, so it's not like you pick blindly by name alone.

      Error checking is good, but having it report that you need to close a parenthesis or XML tag as you are writing the document and haven't written that yet is very annoying.

      Well, you just keep typing, and it goes away?

      There's one other thing that an IDE gives, and that is particularly valuable in a language with pervasive type inference - quick type information: hover mouse over any identifier, and get its type. In a language like F#, I find that I tend to use it much more to see what the inferred types actually are.

    18. Re:never programmed before??? by madddddddddd · · Score: 0

      viewing the sample code.

    19. Re:never programmed before??? by madddddddddd · · Score: 0

      so the person explaining my point is +3 interesting... but my point itself is -1 troll because you idiots are too stupid to understand it.

      fucking IDIOTS.

    20. Re:never programmed before??? by Estanislao+Mart�nez · · Score: 1

      The programs you linked are basically the same thing; Haskell just has a bit of extra syntactic sugar than the F# version.  If you really understand either language, you can see that the function definition in the other maps pretty exactly to the one you know.

      Here's the F# code that you link:

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

      Here's the Haskell one you link:

      factorial :: Integer -> Integer
      factorial 0 = 1
      factorial n = n * factorial (n-1)

      But here's the Haskell one rewritten to (a) not use multi-equation definitions, (b) use the Int type (limited precision, faster) instead of Integer (unlimited size).  (That's my guess at what the "0I" and "1I" mean in the F# program--plain ints instead of bignums.)

      factorial :: Int -> Int
      factorial n =
          case n of
            0 -> 1
            _ -> n * (factorial n-1)

      Note how much the sugarless Haskell version looks like the OCaml.  This is a family resemblance; Haskell, OCaml and Standard ML all descend from ML, and share many of the same basic concepts (functional, Hindley-Milner type system, algebraic datatypes, pattern matching).  Haskell's got the nicer syntax of them, though.

      Just to enumerate the differences between these pieces of code: (a) OCaml and F# require you to use 'let rec' when you define a value that refers to itself recursively, while Haskell and Standard ML allow all definitions to do so; (b) Haskell top-level definitions and some local bindings can be written in multi-equation style; (c) F#'s 'match ... with ...' pattern-matching expression corresponds to 'case ... of ...' in Haskell, and the symbols used are a bit different; (d) the Haskell definitions have a type constraint, and the F# doesn't (this is optional in both languages, but the syntax is different, and Haskell programmers have a habit of doing it much more frequently).

    21. Re:never programmed before??? by poopdeville · · Score: 1

      I've been using TextMate, Macfusion, and GHCi.

      --
      After all, I am strangely colored.
    22. Re:never programmed before??? by bmcage · · Score: 1
      That example is not functional programming. It is just a recursion on the stack. I far prefer a python approach for readable code:

      def fact(x):
      return reduce(operator.mul, xrange(2, x+1))

      At least that maps an operator on an iter of a list!

  4. F is for Fun? by gad_zuki! · · Score: 4, Funny

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

    1. Re:F is for Fun? by Anonymous Coward · · Score: 1, Funny

      You're saying they'll leave the 'N' out of 'Functional'?

      dom

    2. Re:F is for Fun? by giuseppemag · · Score: 0

      The idea is that functional languages tend to exclude by construction certain classes of bugs which are more easily created when writing apparently innocent imperative code. This is especially believed when dealing with more "unusual" domains such as parallel/concurrent programs. So the "F for FUN" should be encountered more often than the "F for FUXX" :)

      --
      My book: Friendly F#, fun with game development and XNA; my game: Galaxy Wars by VSTeam; my gamedev language: Casanova.
    3. Re:F is for Fun? by mrsquid0 · · Score: 1

      Functioal?

      --
      Just because you are paranoid does not mean that no-one is out to get you.
    4. Re:F is for Fun? by Dirtside · · Score: 4, Funny

      F# is an abbreviation -- the language's full name is F#$@!

      --
      "Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
  5. Checkbox marketing by Anonymous Coward · · Score: 4, Insightful

    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.

    1. Re:Checkbox marketing by Anonymous Coward · · Score: 0

      F# for Scientists ...

      Just to pick my vocation: Is there any reason we scientists should care? It will be significantly slower than Fortran95 or C, not easier to learn than Perl or Python, being Microsoft it will probably not run on 95% of our compute clusters, etc.

      Therefore... Why should I care? What does F# do, for me as a scientist, that I should invest my time into it?

      And that a bright high-school student could accurately modify a well-written program in it - well, that is true of any programming language (including Fortran - there's just not many well-written programs).

    2. Re:Checkbox marketing by Ethanol-fueled · · Score: 2, Interesting

      You forgot "paradigm". 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.

    3. Re:Checkbox marketing by shutdown+-p+now · · Score: 3, Informative

      If you don't want the marketing drivel, then the short story is that F# is ML 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.

    4. Re:Checkbox marketing by shutdown+-p+now · · Score: 3, Interesting

      being Microsoft it will probably not run on 95% of our compute clusters

      F# specifically supports Mono on Linux and OS X. I somehow doubt it's good enough for clusters, though...

      In any case, I don't think that's the intended use case. It's not for computationally intensive stuff - you'd still want Fortran or C/C++ there, as you've rightly noted - but for the kind of computations that you do on your own box. These guys provide some supplement tools.

      That said, it can still be used to massively parallelized, scalable tasks, since it has some stock parallelization primitives, and can also use .NET Parallel Framework (which is task/taskgroup-based automatic scheduler on lower level, and automatic parallelization of queries and transforms over sequences on higher level).

      Therefore... Why should I care? What does F# do, for me as a scientist, that I should invest my time into it?

      Do you, as a scientist, use Haskell or ML? If so, you can think of F# as the same kind of thing, but with first-class IDE and debugging support, and ability to quickly throw together UI frontends in WPF (it's pretty good for rather advanced visualization).

    5. Re:Checkbox marketing by Anonymous Coward · · Score: 0

      Mono gives your OS Mononucleosis

    6. Re:Checkbox marketing by ClosedSource · · 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?

    7. Re:Checkbox marketing by Dachannien · · Score: 1

      Yes, but does it shift paradigms outside the box?

    8. Re:Checkbox marketing by mangu · · Score: 2, Funny

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

      Anecdotes 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, maybe it's not the system itself, maybe it's because it attracts too many people who do not have what it takes to become a great programmer, but the proportion of .NET systems that are buggy seems to be much greater than in other platforms.

    9. Re:Checkbox marketing by Bucc5062 · · Score: 0, Redundant

      Somebody wrote a bad program that crashed and somebody else wrote a better program at another company and it didn't crash. What more evidence does one need that bad code is crap?

      There, fixed it for you. Why do we need to specify language when talking about about bad coding practices. From COBOL to .net I've seen my share of crash and burn applications and in almost every instance (including my own abends) it was not the "crappy" language, but the creator.

      --
      Life is a great ride, the vehicle doesn't matter
    10. Re:Checkbox marketing by dunkelfalke · · Score: 1

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

      --
      "It's such a fine line between stupid and clever" -- David St. Hubbins, Spinal Tap
    11. Re:Checkbox marketing by howardd21 · · Score: 1

      That is interesting statement. What evidence do you have to support this?

      If it was the case, then I suspect that it is because dotnet developers came from Access or VBA type development, into VB, and then into dotnet with little formal direction, and likely from a business or accounting background. Java or other languages more likely have people who dedicated to development work on day one.

      --
      no comment
    12. Re:Checkbox marketing by Anonymous Coward · · Score: 0, Interesting

      The majority of opensource projects I see on sourceforge are buggy pieces of shit. There must be something about OSS that attracts too many people who do not have what it takes to be a great programmer.

    13. Re:Checkbox marketing by gbjbaanb · · Score: 1

      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. :)

    14. Re:Checkbox marketing by MoeDrippins · · Score: 1

      Yes, and with synergy. But only when well timeboxed.

      --
      Before you design for reuse, make sure to design it for use.
    15. Re:Checkbox marketing by Anonymous Coward · · Score: 0

      Java app did not crash, but and sadly, Java apps do not even need crashes to be a crap.

    16. Re:Checkbox marketing by Anpheus · · Score: 1

      And Accelerator, a MS Research project, can be used inline with F# to run code on a GPU.

    17. Re:Checkbox marketing by DannyO152 · · Score: 2, Informative

      F# as the same kind of thing, but with first-class IDE and debugging support

      Aha! Right there is the problem. The first-class IDE is Windows-only.

      I do use Haskell. TextEdit and emacs work well enough. May I suggest that a good REPL, strong type system, and pure functional style mean that debugging is a different process than watching memory locations change value for imperative languages. I've checked out OCaml, but its notation - call me shallow - meant I went back to lisp and shortly after embraced Haskell. I'm also told the book I used as guide, "Practical OCaml Programming," is notoriously poorly written.

      Since F# borrows heavily from OCaml for notation, its superior use case is for developing on Windows for Windows using a functional style and that really implies that the clients are going to be running a desktop application. While no language that actually does something can be totally pure, I thought some of F#'s FP goodness was undercut via the interaction with DLLs and .net objects. On the other hand, it does resolve the foreign interface problem that non-C languages have, but pretty much only for Windows.

      As a practical consideration, over the years, there have been many periods of significant length when mono and fsharp would not compile on OS X via Macports. No complaints: everyone's a volunteer and I'm hitching a free ride. But, at some point one stops paying attention. Looking at the state of the art today, scala and clojure offer nice integration with existing code (read gui widgets) and as they rely on a jvm are cross-platform. The one little ugly part to those implementations is that the jvm cannot do automatic tail recursion, so the programmer has to be aware of stack issues and use workaround functions for recursion.

    18. Re:Checkbox marketing by msclrhd · · Score: 3, Interesting

      So F# is for scientists and the finance industry, yet it cannot run on most mainframes (GNU/Linux or Unix), but there is mono that can, but does not work for computationally intensive applications.

      That means that it will not be able to be used for Quantum Mechanical calculations or General Relativity calculations or any other calculation that scientists would like to perform. Nor would it scale to the large amount of real-time transactions that a bank or stock trading company would need to perform.

      So how is F# better than Fortran & C/C++?

    19. Re:Checkbox marketing by dunkelfalke · · Score: 2, Insightful

      I've learned Turbo Pascal as my first language back then in 1991. Currently I develop in C for embedded Linux, but I still like Pascal better because I happen to like comfort better than hardships.

      --
      "It's such a fine line between stupid and clever" -- David St. Hubbins, Spinal Tap
    20. Re:Checkbox marketing by gbjbaanb · · Score: 1

      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.

    21. Re:Checkbox marketing by ClosedSource · · Score: 1, Insightful

      "it's not just *one* bad program in C# that crashes, it's everyone who works with computers that has come across one badly written .NET system after another."

      Obviously your claim for "everyone" is not valid. I guess in this case the plural of anecdote is fabrication.

    22. Re:Checkbox marketing by ClosedSource · · Score: 1

      if crashes in C are deliberate in order to learn from your mistakes, then one can truly say that using C is a life-long learning experience.

    23. Re:Checkbox marketing by ClosedSource · · Score: 1

      I'm afraid you missed my sarcasm. I agree with you. Now I wonder if I was moderated Insightful because moderators read it like you did.

    24. Re:Checkbox marketing by dunkelfalke · · Score: 1

      Sorry, never bothered to learn Basic, but C# is something I quite like for business application development.

      --
      "It's such a fine line between stupid and clever" -- David St. Hubbins, Spinal Tap
    25. Re:Checkbox marketing by Anonymous Coward · · Score: 0

      May I suggest that a good REPL, strong type system, and pure functional style mean that debugging is a different process than watching memory locations change value for imperative languages.

      It's true that debugging Haskell is a different experience, but it also has its distinct downs as well as ups. For example, the easiness with which you can get an exponential growth in time and/or memory use because of pervasive laziness of the language.

      Since F# borrows heavily from OCaml for notation, its superior use case is for developing on Windows for Windows using a functional style and that really implies that the clients are going to be running a desktop application

      Not really - so far as I know, the biggest F# user to date is Bing, and they use it server-side.

      While no language that actually does something can be totally pure, I thought some of F#'s FP goodness was undercut via the interaction with DLLs and .net objects. On the other hand, it does resolve the foreign interface problem that non-C languages have, but pretty much only for Windows.

      Yes, it's pretty much what it boils down to. "Totally pure" vs "pragmatic", and F# (following in the tracks of OCaml) errs on the side of "pragmatic" here.

      Whether it's for better or worse is rather subjective.

      As a practical consideration, over the years, there have been many periods of significant length when mono and fsharp would not compile on OS X via Macports. No complaints: everyone's a volunteer and I'm hitching a free ride

      It's not so much about "free ride" as it is about the fact that the language is essentially still in beta stage (it actually changed significantly enough that code from last-year books on F# often doesn't compile). Consequently, there have been a number of things broken on Windows, too - e.g. PowerPack installer messes things up.

      The upcoming VS2010 release will effectively mark the first stable F# version.

      The one little ugly part to those implementations is that the jvm cannot do automatic tail recursion

      JVM cannot do any tail recursion in a general sense. Yes, the case of a function calling itself can be optimized by the compiler targeting JVM, so there's no recursive call in the bytecode; but e.g. two (or more) functions calling each other, and you're SOL.

      CLR doesn't actually do automatic tail recursion, either - as in, by default, an instruction for a method call is not tail recursive. There is a special "tail." prefix to make it such, which the compiler targeting IL has to emit (which F# does).

    26. Re:Checkbox marketing by shutdown+-p+now · · Score: 1

      Please re-read my previous post. I already explained that. For clusters, by all means, keep using Fortran. But not all scientific computations are run on clusters. Researchers build small-scale models on their own PCs all the time, and want to just quickly whip something up, often with convenient visualization.

      Nor would it scale to the large amount of real-time transactions that a bank or stock trading company would need to perform.

      Why do you think it can't scale just because you cannot run it on a mainframe? Some parts of Bing backend use F# - do you think that runs on a single box in someone's basement?

    27. Re:Checkbox marketing by Anonymous Coward · · Score: 0

      What ridiculous nonsense. As someone noted, there are ridiculously numerous examples of badly written C programs, C++ programs, Java programs, etc... You're just making up some pretend proportion of bad .NET programs because you don't know what you're talking about.

      Or: Selection bias much, there, rocket surgeon?

    28. Re:Checkbox marketing by shutdown+-p+now · · Score: 1

      There, fixed it for you. Why do we need to specify language when talking about about bad coding practices. From COBOL to .net I've seen my share of crash and burn applications and in almost every instance (including my own abends) it was not the "crappy" language, but the creator.

      Why, I dare you to write a crashing application in the Nil programming language!

    29. Re:Checkbox marketing by Mr2001 · · Score: 1

      Aha! Right there is the problem. The first-class IDE is Windows-only.

      Not quite... there are F# bindings for older versions of MonoDevelop, although it looks like it's missing from more recent versions due to license changes (the F# plugin was GPL, MonoDevelop is moving away from GPL).

      --
      Visual IRC: Fast. Powerful. Free.
    30. Re:Checkbox marketing by Anonymous Coward · · Score: 0

      It's not for computationally intensive stuff - you'd still want Fortran or C/C++ there, as you've rightly noted - but for the kind of computations that you do on your own box.

      OP here. So, it shall be used for quick testing stuff - so how is it superior to python or perl, which are free, run everywhere (there is no mono on our compute cluster...) and where most scientist know one or the other already?

      That said, it can still be used to massively parallelized, scalable tasks, since it has some stock parallelization primitives, and can also use .NET Parallel Framework (which is task/taskgroup-based automatic scheduler on lower level, and automatic parallelization of queries and transforms over sequences on higher level).

      No... Just no... If something requires massive parallelization, it will be in Fortran & MPI+OpenMP, and never run on .NET.
      Using an interpreted language for that is the programming equivalent to the saying "throw good money after bad".

      Do you, as a scientist, use Haskell or ML? If so, you can think of F# as the same kind of thing, but with first-class IDE and debugging support, and ability to quickly throw together UI frontends in WPF (it's pretty good for rather advanced visualization).

      Personally, I never used Haskell or ML - quick stuff is done in zsh or python, and rhe occasional visualization stuff works with zsh, gnuplot & ffmpeg.
      So in the end, I do not care - but thank you for explaining.

    31. Re:Checkbox marketing by vikstar · · Score: 1

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

      Just use Java with the JScience package.

      --
      The question of whether a computer can think is no more interesting than the question of whether a submarine can swim.
    32. Re:Checkbox marketing by shutdown+-p+now · · Score: 1

      OP here. So, it shall be used for quick testing stuff - so how is it superior to python or perl, which are free, run everywhere (there is no mono on our compute cluster...) and where most scientist know one or the other already?

      It's a statically typed language, so you get a bit more error checking. It will also infer most types, so you don't have to spell them all out.

      Its type system is actually specifically geared towards scientific and engineering computation, in that it provides support for units of measure - so your types aren't just "int" and "float", but "int<second>" and "float<meter>" - and derived ones, too, so if you divide meters by seconds, the resulting value is of type meters per seconds - e.g. "float<meter/second>". And, of course, it won't let you add meters and seconds - static type checking is still at work.

      Using an interpreted language for that is the programming equivalent to the saying "throw good money after bad".

      F# isn't an interpreted language. It's JIT-compiled, same as Java.

      Anyway, you definitely know better, so I'll trust your expertise on this. I'm not really surprised that Fortran is still the language of choice for those kinds of things. This thing had, what, 50 years by now to polish and optimize?

      At the same time, I have to note that not just scientific tasks require massive parallelization. I'd imagine that whatever they use it for in Bing is also quite heavily parallelized, for example.

      From the personal rumor mill, I've heard that outside MS, F# has found some acceptance in banks, of all places - a few big ones use it for financial and statistical computations, and prediction modeling. No idea if any degree of parallelism is involved there, however.

    33. Re:Checkbox marketing by badkarmadayaccount · · Score: 1

      Sounds like Grand Central Dispatch for .NET.

      --
      I know tobacco is bad for you, so I smoke weed with crack.
  6. Specific question? Vague answer! by Anonymous Coward · · Score: 0

    "[Q] What is the best program you've seen written in F#? [A] A bunch of generalized statements, as though I've never actually seen a program in this language."

    1. Re:Specific question? Vague answer! by Anonymous Coward · · Score: 0

      Actually he gave a specific answer in there:

      "For commercial impact... probably nothing beats the uses of F# to implement statistical machine learning algorithms as part of the Bing advertisement delivery machinery."

  7. .NET Framework by Yuioup · · Score: 5, Interesting

    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.

    1. Re:.NET Framework by Anonymous Coward · · Score: 0

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

      "Concern" for americans only. We here in Europe don't give a flying fuck about US software "patents" :-)

    2. Re:.NET Framework by Paradigma11 · · Score: 4, Informative

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

    3. Re:.NET Framework by JamesP · · Score: 1

      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)

      --
      how long until /. fixes commenting on Chrome?
    4. Re:.NET Framework by SparafucileMan · · Score: 1

      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.

    5. Re:.NET Framework by fredrik70 · · Score: 2, Interesting

      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.

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
    6. Re:.NET Framework by Yuioup · · Score: 2

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

      A wonderful scripting language that can be used to automate tasks. As an added bonus it's backed by the entire .Net Framework.

    7. Re:.NET Framework by daveime · · Score: 5, Funny

      I hope chapter 1 contains directives on when and when not to use fixed width fonts.

    8. Re:.NET Framework by maxume · · Score: 1

      There really isn't anything very interesting about the lambda statement in python.

      (all objects in python are first class, so you can use a named function anywhere you can use a lambda, and lambdas are restricted to a single expression)

      --
      Nerd rage is the funniest rage.
    9. Re:.NET Framework by Thing+1 · · Score: 1

      He did say "functional" programming, not "form" programming... :)

      --
      I feel fantastic, and I'm still alive.
    10. Re:.NET Framework by codepunk · · Score: 1

      wow, who would have thunk.

      --


      Got Code?
  8. The optimal blend... by mandelbr0t · · Score: 2, Interesting

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

    --
    "Please describe the scientific nature of the 'whammy'" - Agent Scully
    1. Re:The optimal blend... by Nigel+Stepp · · Score: 1

      *head explodes*

      --
      4096R/EF7BAFA6 79E1 DF98 D09D 898F 9A11 F6F0 DDDC 23FA EF7B AFA6
    2. Re:The optimal blend... by shutdown+-p+now · · Score: 3, Interesting

      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.

    3. Re:The optimal blend... by MichaelSmith · · Score: 2, 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.

    4. Re:The optimal blend... by shutdown+-p+now · · Score: 2, Insightful

      So why do we have so many unique languages?

      It's because we don't have a clear idea on which language features are good, and which aren't. If you ask someone (say, me ~), you'll probably get a straightforward reply, but if you ask another guy, he is quite likely to strongly disagree on many major points.

      There are many arguments both for and against dynamic typing, for example. There are similarly many arguments for and against OOP. There are advantages of having code pre-compiled to native, and there are also advantages of having a VM with a JIT compiler. Tracing GC vs manual memory management (+ smart pointers). The list goes on and on...

      Within the static typing camp, there are still unsolved issues with the expressivity of type systems - some believe that typeclasses (Haskell-style) are the way to go, but there are still some unresolved problems there for more complex things. Some want effect typing. Some decry both as overcomplicated, and say that they're overkill, and it's easier to simplify the code.

      Then there are bleeding-edge language features. Do we need STM? Do we even want it - can it be efficiently implemented at all?

      Consequently, you get different languages, depending on which of the above (and many other) points are emphasized. Lately, we're starting to get more "kitchen sink" languages combining all approaches in hope that all of them are useful to one extent or another. F# is actually such a language, in a sense, being hybrid FP/OO (it also has "duck typing" member access, though no means to define true dynamic classes as in Python or Ruby). Scala is even more so.

      Existing languages are also heading in the same direction - C# is a good example of that, starting its life as Java-like OO language, then getting some FP features in 2.0, a major FP'esque facelift in 3.0, and now duck typing in the upcoming 4.0.

      By the way, F# isn't really a new language. The base language is ML, which is over 30 years old now. The specific ML dialect from which F# is derived is OCaml - that one is still in active development, but got started 14 years ago.

    5. Re:The optimal blend... by magbottle · · Score: 0

      Okay everytime this kind of article comes up on slashdot people point to five or six other languages I have never heard of.

      Take an existing language, add some little bit, give it a cute name, be famous.

    6. Re:The optimal blend... by gardyloo · · Score: 1

      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.

    7. Re:The optimal blend... by tepples · · Score: 1

      natural languages have features that make some more primitive than others.

      What makes you think this?

    8. Re:The optimal blend... by CodeBuster · · Score: 1

      but I wouldn't write a parser in C# either.

      The parser example is commonly mentioned as being both more difficult to implement in OO languages and less intuitive. However, if C# is the language chosen to write the parser then there are several fine examples of recursive descent parsing using the visitor pattern written in C# (mostly by academics). On the other hand, how often is a fully featured parser (of the type which could supply structured symbolic graphs to a code generator) actually implemented in practice? IMHO, the parser example is most often selected to cherry pick a corner case where functional languages excel without mentioning the tremendous strengths of OO languages for many ordinary programing tasks.

    9. Re:The optimal blend... by shutdown+-p+now · · Score: 1

      IMHO, the parser example is most often selected to cherry pick l without mentioning the tremendous strengths of OO languages for many ordinary programing tasks.

      I agree that it is a corner case, but in practice, I've found that I run more often into it than I've expected. On my last three jobs, I've had to write a full-fledged parser at least once on each.

      Anyway, you're right that OO has a more broad appeal, and has immediate benefits for a larger array of tasks. But that's precisely why F# is hybrid FP/OO, not pure FP!

    10. Re:The optimal blend... by mandelbr0t · · Score: 1
      I'm surprised at the rather meek response to an obvious troll, but what the hell. I'm assuming that since you ask this question, you're likely not going to accept what little I remember from my linguistics courses as truth, so here's Wikipedia on the subject.

      Burnett was the first to discover that primitive languages create unnecessarily lengthy words for rather simple concepts. He reasoned that in early languages there was an imperative for clarity, so that redundancy was built in and seemingly unnecessary syllables added. He concluded that this form of language evolved as a method of survival when clear communication might be the determinant of avoiding danger. He demonstrated that he was aware of the advantages to those peoples who could develop superior language skills. This quasi-evolutionary idea, whilst common today, was then unusual.

      I can't find the exact examples I'm looking for, but it looks like my belief in an evolution of natural languages is well supported. I distinctly remember being told about a primitive native language that didn't even have temporal concepts. All concepts were expressed in the present. Tell me that doesn't make a language more primitive.

      --
      "Please describe the scientific nature of the 'whammy'" - Agent Scully
    11. Re:The optimal blend... by lennier · · Score: 1

      And let's not forget that when it comes to object oriented languages, there's not actually a rigorous definition of what OOP actually is - compared to other computer science concepts like, say, relational database theory. Is it classes? Nope, we have pure prototype OO like Lua and Self. Is it single inheritance? Nope, we have Smalltalk and CLOS. Is it multiple inheritance? Nope, we have Java. Is it implementation inheritance? Nope, we have interfaces and the 'implementation inheritance is evil' school. Is it late binding and message passing? Nope, we have C++ and Objective-C and Java and the 'big compilation up front' school. Is it encapsulation and data hiding? Nope, we have Javascript.

      Pretty much any definition you can think of for OOP will fail; there will be a mainstream or founding language considered OO which does not have that feature. Even just Smalltalk and C++ are practically inverses of each other on so many positions.

      It scares me a bit that much of modern software engineering is based on a theoretical foundation which is not itself consistently definable, a bit like postmodernism.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    12. Re:The optimal blend... by ralphbecket · · Score: 1

      I find it hard to believe you actually understood what you were doing with functional programming.

      FPLs have, for decades, offered a level of safety, precision, and brevity that simply hasn't been matched in any imperative language. For my money, OO has mainly been a poor-man's effort at adding limited polymorphism to imperative languages.

      I code daily in a range of these languages (functional/logical, imperative, OO) and the amount of verbiage required to do the simplest things in the non-functional languages never ceases to amaze me. Plus, I have nothing like the faith in the OO and imperative programs that experience has given me with functional languages - that is, the vast majority of my functional programs do exactly what I intend them to do first time.

    13. Re:The optimal blend... by tepples · · Score: 1

      I'm surprised at the rather meek response

      I prefer to think of it as "assuming good faith".

      to an obvious troll

      The mods thought it was an obvious interesting.

      Burnett was the first to discover that primitive languages create unnecessarily lengthy words for rather simple concepts.

      All this proves is that a language absorbs a concept at much the same rate that the surrounding culture does. Any new concept will have a long word before the concept becomes integrated into society. At that point, the word becomes contracted (e.g. mechanical picture transmission -> television -> telly or TV; facsimile -> fax; horseless carriage -> car; Federal Bureau of Investigation -> Eff Bee Eye; Conference on the Evolution of Language -> Evolang), or the meaning of the compound's head word shifts to encompass the most common compound formed with that head word (e.g. diabetes mellitus -> diabetes), or in some cases the concept gets a name based on that of a person associated with the concept (e.g. amyotrophic lateral sclerosis -> Charcot's or Lou Gehrig's; computation using place-value numerals -> algorithm).

      And from the article you linked:

      He was also apparently the first to establish that primitive languages are generally vowel rich; correspondingly, very late advanced languages such as German and English are vowel starved.

      By this metric, Italian and Japanese are grouped with the primitive languages.

    14. Re:The optimal blend... by shutdown+-p+now · · Score: 1

      I know that defining OOP is hard, but I disagree that "any definition you can think of will fail". Let me try to give you my own pet one to check.

      OOP language is defined by presence of 1) objects with an inherent identity, and 2) virtual dispatch.

      Now, to expand this a bit.

      Objects with inherent identity mean that an object is more than just an aggregate of data in it - even if you have an object with no fields at all, it is still an object distinct from any other, and this is observable (i.e. the language always provides an identity comparison operator). This is less obvious in some languages, such as C++, where object's address serves as this inherent identity. Also, some OO languages let you define object-like types with methods etc, which nonetheless don't have such identity (e.g. structs in C#, or value classes in Sather). However, if a language doesn't have a facility for defining objects with identity, it's not considered an OO language (the reverse isn't true: any lvalue in C has an identity - its address - but C isn't an OO language).

      The second requirement is to have virtual dispatch. Now this may not be a good generic term, but I've used it mostly because many more people are familiar with that name of concept, thanks to C++. The idea is that you can have a reference to an object, and perform a method call on it such that the actual run-time type of the object referenced determines the actual method that will be called (multimethods are a strict superset of that). In most general case, it means that it is not possible in an OO language to tell which method will a method call statement invoke without actually running the program up to that point.

      Now, all the languages I'm aware of that match the above two points are considered OO. I also don't know of any language that doesn't match both points, and is not considered OO. Hence, I assert that this is actually the definition of an OO language (at least how we understand them today).

      I would be happy to hear any counter-examples, however.

  9. Syntax parser. by Ranzear · · Score: 2, Funny

    If someone makes a debugger or syntax checker for it, will it be called 'F#CK'?

    --
    Slashdot: Where opinions are just opinions until you have mod points.
    1. Re:Syntax parser. by shutdown+-p+now · · Score: 2, Funny

      No, it's called Visual Studio, actually.

      Hmmm.....

    2. Re:Syntax parser. by Anpheus · · Score: 1

      F#CK!

  10. What's wrong with C and Python? by Anonymous Coward · · Score: 0

    If I want something done fast I code in python. When I want something fast done I code in C. They are perfect for what I need to do.

    1. Re:What's wrong with C and Python? by shutdown+-p+now · · Score: 1

      Python is good for many kinds of high-level code, but not all. Try processing a deep nested tree structure in it, for example (say, AST). Or writing a recursive descent parser.

      Yes, you can do it, but it feels just as awkward as OOP done in plain C, after you see how it can be done in twice as little code with pattern matching in any FP language.

      There's nothing wrong with either Python or C, of course. They have their own niches where they are near-perfect. In fact, the whole point of .NET is to let you take them all, and glue them together - so you can have performance-critical bits written in highly optimized C++ compiled to native code, seamlessly interoping with F# layer that implements computing logic, topped by IronPython layer which does UI using WPF.

    2. Re:What's wrong with C and Python? by loufoque · · Score: 1

      you see how it can be done in twice as little code with pattern matching in any FP language.

      Note there is nothing inherently functional about pattern matching.
      It's just a feature that happens to be popular in the ML/Haskell world.

      The equivalent with OO is a visitor. It tends to be more verbose due to lack of functional glue. But with anonymous classes or functions, it's not much more verbose anymore (and at least the parsing is clear to a human).

    3. Re:What's wrong with C and Python? by shutdown+-p+now · · Score: 1

      Note there is nothing inherently functional about pattern matching.
      It's just a feature that happens to be popular in the ML/Haskell world.

      Yes, I know. But so long as we stick to strict definitions, any language with first-class function values is functional, and sometimes this results in some unconventional classification.

      So, in practice, when people talk about FP languages, they really mean a certain set of features, and first-class functions are only one part of that. Pattern matching had historically been another distinctive feature of the same class of languages.

      The equivalent with OO is a visitor. It tends to be more verbose due to lack of functional glue. But with anonymous classes or functions, it's not much more verbose anymore (and at least the parsing is clear to a human).

      Even with lambdas, visitors are still very verbose compared to pattern matching if only because you have to write the visiting code.

      By the way, there's nothing precluding one from doing proper pattern matching with an OO type system, without any need for hacks such as visitors. Scala does just that.

    4. Re:What's wrong with C and Python? by loufoque · · Score: 1

      Pattern matching had historically been another distinctive feature of the same class of languages.

      It's not in the Lisp family of languages. Or would you call those non-functional?

    5. Re:What's wrong with C and Python? by shutdown+-p+now · · Score: 1

      Common Lisp is a hard one to identify, but the majority tend to put it into the imperative category, because idiomatic CL tends towards explicit loops and mutating values rather than clean recursion. CLOS is oriented towards objects with mutable state, as well.

      Scheme is definitely functional, and yes, it doesn't have pattern matching in it out of the box. I guess it's one of those odd exceptions that strengthen the rules. At the same time, R6RS macros use pattern matching, done very much in tradtional FP style; and, of course, you can trivially implement your own matching construct in both CL and R6RS with macros. In fact, a quick Google search for "Scheme pattern matching" gave me a link to 3 different implementations right away, which seems to hint that it's an oft-requested feature.

  11. Why not Groovy? by SuperKendall · · Score: 2

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

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Why not Groovy? by shutdown+-p+now · · Score: 2, 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 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-class support on .NET (it comes out of the box in Visual Studio 2010, with full IDE support - projects, editing, debugging etc). Scala, on the other hand, is a third-party project on JVM, not backed by any of the major players so far - purely a community project.

    2. Re:Why not Groovy? by Yuioup · · Score: 2, Informative

      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 ;-)

       

  12. F# is awesome by Anonymous Coward · · Score: 1, Insightful

    As a longtime programmer in languages such as C++, Java, C# etc, and having explored many other dynamic and functional languages such as Perl, Python, Ruby, Haskell, and Lisp, I can honestly say that F# is now hands down my favorite language. There are a few reasons:

    - it's like the best parts of all the paradigms rolled into one. Statically typed, but with automatic type inference to do most of the work for you. Fantastic generics - every function is generic without any of the scary syntax or mental overhead. First class functions, closures, all that good functional stuff. All the same objected oriented features you'd have in C#. All the garbage collection etc of the .NET platform. You can do things in almost any style you want and it never feels like you have to fight the language.

    Of course, pick and choose your language, and you can find many of those features elsewhere. But here's the best part:

    - it runs on .NET. You can use all of the .NET libraries, no need to hunt for and integrate third party libraries that are half implemented because of your wacky obscure language choice.

    - you can sell it to your boss. Supported as an official MS product and included in Visual Studio 2010. Integrates flawlessly with C#. Has a great IDE already. Draw your WPF GUI in Expression Web if you feel like it and write the backend in F#.

    Honestly I never want to go back. It's like that Paul Graham essay where he talks about how Lisp is so productive that his company killed the competition. Now I feel like every line of C#/C++ I write is a waste of my time.

    1. Re:F# is awesome by TheLink · · Score: 1

      Just curious, what in the .NET libraries do you use often? What are the benefits of using .NET for you?

      I've tried a bit of win32 (not .net) coding with python, the MSDN docs on win32 stuff are OK I guess but sometimes ambiguous and not very clear on explaining basic Windows concepts (e.g. what's the difference between a owner window and a parent window and _why_ the distinction exists).

      --
  13. It is, kind of by _merlin · · Score: 2, Interesting

    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 different paradigm, in spirit it's the FORTRAN of the CLR.

  14. F# for Scientists?! by Anonymous Coward · · Score: 0

    Hmm...Amazon says he consulted on the book. Wouldn't be a problem except the author is one of the most notorious trolls in the FP community! Way to go, Microsoft PR! Maybe you guys can hook Derek Smart up with someone in the games division?

    1. Re:F# for Scientists?! by shutdown+-p+now · · Score: 1

      As the "father" of F#, Don Syme had consulted pretty much all books written on the language so far, as well as those still being written. There's simply no better authority.

  15. FParsec by shutdown+-p+now · · Score: 3, Insightful

    There's one particular reason to look at F#, and that's FParsec. 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.

    1. Re:FParsec by loufoque · · Score: 1

      Look at Boost.Spirit, it's much cooler.

    2. Re:FParsec by shutdown+-p+now · · Score: 1

      There are two problems with Spirit. One is that you get through several cups of coffee by the time it finishes compiling a real-world grammar of any decent size (because of all the template metaprogramming). The second one is that, once you get there, and you find out that your grammar doesn't parse something as expected, debugging it is going to be very painful.

    3. Re:FParsec by loufoque · · Score: 1

      It's basically the same as (F)Parsec, except it uses operator overloading to be more readable and look more like an EBNF grammar.
      It's also quite bigger and more advanced, and is used more.

      And it's not *that* slow. I had it compile very complicated grammars (the C++ kind) with acceptable compile times.

    4. Re:FParsec by shutdown+-p+now · · Score: 1

      It's basically the same as (F)Parsec, except it uses operator overloading to be more readable and look more like an EBNF grammar.

      The real awesomeness of Spirit, IMO, is that it uses template metaprogramming, so a lot of parser combination is done at compile time, with practically no extra overhead at runtime (with a decent optimizing C++ compiler). But that's what slows down compile times so much.

      It's also somewhat annoying that C++ won't let you define custom operators the way Haskell and ML/F# can - the latter can use some more exotic symbol sequences for more useful combinators to retain concise syntax.

  16. What might f otherwise be for? by jonaskoelker · · Score: 1

    Something tells me F will mean something completely different when youre getting compiler errors or crashes.

    fgrep??

    1. Re:What might f otherwise be for? by Anonymous Coward · · Score: 0

      F#?$

      Which means:
      1) F#
      2) ?
      3) Profit

      That or it's a dirty word.

  17. Not even going to RTFA by Agamous+Child · · Score: 1, Insightful

    Totally marketing garbage. Man is probably a great guy, with a lousy job. But F#, really? even .NET is ripping off Java. Microsoft talks about building "ecosystems" but the way they do it, everything in the ecosystem has to have a M$ logo on it. Why can't they just inter-operate and integrate with outside software?

    --
    I had a sig, but /. ate it. My Web Site
    1. Re:Not even going to RTFA by shutdown+-p+now · · Score: 3, Informative

      Totally marketing garbage. Man is probably a great guy, with a lousy job. But F#, really? even .NET is ripping off Java.

      I'm not sure I follow. Are you saying that F# is somehow "ripping off" Java? If you mean it's a "rip off" something else, then, well, it's clearly designated as an OCaml derivative, it's not exactly news... but we wouldn't get far if people wouldn't "rip off" the work of others, and build on that. You know, just like Java ripped off C++ and Smalltalk, and JavaScript ripped off Self, and Smalltalk ripped off Lisp, etc...

      If you mean .NET as a whole being a rip-off of Java, then you're late by like 6 years or so - C# 1.0 was for the most part "a better Java" (note the "better" part, however), but since then it has evolved much faster, and Java is struggling to keep pace, "ripping off" C# as it goes. To give a specific example: C# had first-class functions (called anonymous delegates in the language) in version 2.0, released in 2005. Java still doesn't have them, and they will only likely come in Java 7, to be released by the end of this year. To give another example, C# 2.0 and above has generics that Java language designers would call "reified". Java doesn't, and there's no telling when, or even if, it will.

      Microsoft talks about building "ecosystems" but the way they do it, everything in the ecosystem has to have a M$ logo on it. Why can't they just inter-operate and integrate with outside software?

      Uhh, I don't even know where to begin here.

      Here is the C# language specification, if you ever want to write your own C#compiler. Here is the CLI spec - this covers VM semantics, all involved file formats, and the fundamental class library - this is useful for a .NET compiler for any language.

      And third-party languages for .NET do exist in large quantities. One good example is Delphi Prism, which provides full Visual Studio experience, not any worse than what is there for C# out of the box. Then there's Eiffel, Smalltalk, Perl, Fortran, COBOL... IronPython and IronRuby were also outside projects, by the way - their authors got hired by MS along the way because the company was interested in developing dynamic languages on the platform, and, naturally, picked the two most popular ones.

      Libraries are also part of the "ecosystem", by definition and there are tons of third-party ones. I won't even bother giving links as there are too many - google it if you want.

      So, can you explain what you mean by "inter-operate and integrate with outside software" with respect to .NET, if the above is not good enough?

    2. Re:Not even going to RTFA by 0ld_d0g · · Score: 1

      even .NET is ripping off Java

      Thats like saying Linux just ripped of Minix/Unix. All your comment shows is that you have little to no clue of what .NET is. The primary way to do innovation is to take existing technologies and build upon it and improve it. Which is why software patents suck ass.

      Why can't they just inter-operate and integrate with outside software?

      They can. They however don't want to (or need to), because then they lose control over it.

    3. Re:Not even going to RTFA by pitdingo · · Score: 1

      Problem is C# is a proprietary, patent encumbered Microsoft Standard. Take a look at the link to the C# spec and there is a pdf saying so right there. C# is great if you like vendor lock-in to Microsoft and paying them a ton of money. For my company, I will choose Java any day of the week as it runs great on all platforms (no half baked patent entangled implementations) and has far more industry support. And best of all, i can implement Java solutions for zero cost of software.

      While Java is controlled ultimately by Oracle, there is a fairly open body stewarding it unlike the vendor dominated rubber stamp EMCA which really does nothing to control C#; Microsoft is the sole controller of C#. The evolution of closed vendor standards is of course faster than inclusive standards bodies. And the academic syntactic sugar of C# is really nothing of importance to the vast majority of software developers.

    4. Re:Not even going to RTFA by MoeDrippins · · Score: 1

      > C# 2.0 and above has generics that Java language designers would call "reified"

      Is this the same issue as Java generics doing type-erasure?

      --
      Before you design for reuse, make sure to design it for use.
    5. Re:Not even going to RTFA by gbjbaanb · · Score: 1

      So, can you explain what you mean by "inter-operate and integrate with outside software" with respect to .NET, if the above is not good enough?

      He means, can it interoperate with stuff on a non-MS platform. See, IronPython may be an example of how flexible and interoperable it is - "gee, you can write .net in Python", but really, its still .net, not an "outsider" to the MS ecosystem.

      IIRC the C# spec submitted to ECMA was for version 1.1, so missing all the cool stuff everyone takes for granted now - like the dynamic features you mentioned referring to IronPython.

      You're right that Java is still pants though. I only wish MS had based C# on C++ instead of Java and made that better, no VM, no JIT, RIAA etc.

    6. Re:Not even going to RTFA by EvilRyry · · Score: 1

      Yes. Basically Java went the backwards compatible approach and C# went the "correct" approach.

      Seeing how Java is a much more mature and widely used language, the decision made a lot of sense. Companies that were using old Java stuff wouldn't be very thrilled to learn that they couldn't use generics or any libraries that used generics.

      .NET on the other hand was still rather young. They could afford to ditch backwards compatibility for long term gains.

    7. Re:Not even going to RTFA by owlstead · · Score: 1

      "If you mean .NET as a whole being a rip-off of Java, then you're late by like 6 years or so - C# 1.0 was for the most part "a better Java" (note the "better" part, however), but since then it has evolved much faster, and Java is struggling to keep pace, "ripping off" C# as it goes. To give a specific example: C# had first-class functions (called anonymous delegates in the language) in version 2.0, released in 2005. Java still doesn't have them, and they will only likely come in Java 7, to be released by the end of this year. To give another example, C# 2.0 and above has generics that Java language designers would call "reified". Java doesn't, and there's no telling when, or even if, it will."

      Hold your horses here. If you mean with "evolved" that C# tries to do everything under the sky then you are certainly right. And certainly there are things that I really would like to have in Java (e.g. more runtime checks, such as "reified" generics). But IMHO C# has become too much of a "D" language, trying to tick each feature box. And while it does it will grow and grow and it will become harder and harder to manage. Java is trying to be a simple language. This makes it easier for developers to read each other's code. It makes it much easier to debug as well. It makes it easier to create an IDE that is really good at refactoring things and doing other interesting things with the AST (abstract syntax tree, the tree you get after parsing the code).

      Many programming languages become harder to manage as time goes by, because there is much pressure on them to add features. In the Java community there is still much discussion on adding lambda functions. And with good reason; I'm rather strongly opposed because it adds to the cost of maintainability. And in the end, that's where most of the resources are spend. If you want to do functional programming? Fine, use a functional language compatible with the JVM and use that. I don't want for most of our programmers to deal with constructs out of functional languages, and for good reasons.

    8. Re:Not even going to RTFA by shutdown+-p+now · · Score: 1

      Problem is C# is a proprietary, patent encumbered Microsoft Standard. Take a look at the link to the C# spec and there is a pdf saying so right there.

      The PDF doesn't specifically say that. The PDF says:

      "Microsoft will grant, on a non-discriminatory basis, to any party requesting it, licenses on commercially reasonable terms and conditions, for its patent(s), if any, deemed to be necessary for the implementation of the Ecma Standard"

      To me this sounds like a typical piece of legalese, most likely to satisfy some ECMA rule that published standards must have such a RAND promise.

      Furthermore, the very same PDF, in its P.S., says that any patent claims relevant to Ecma-334 are also covered by Microsoft Community Promise.

      Microsoft irrevocably promises not to assert any Microsoft Necessary Claims against you for making, using, selling, offering for sale, importing or distributing any implementation, to the extent it conforms to one of the Covered Specifications, and is compliant with all of the required parts of the mandatory provisions of that specification ("Covered Implementation")

    9. Re:Not even going to RTFA by shutdown+-p+now · · Score: 1

      He means, can it interoperate with stuff on a non-MS platform. See, IronPython may be an example of how flexible and interoperable it is - "gee, you can write .net in Python", but really, its still .net, not an "outsider" to the MS ecosystem.

      IronPython, IronRuby and F# all explicitly support Mono on Linux and OS X.

      IIRC the C# spec submitted to ECMA was for version 1.1, so missing all the cool stuff everyone takes for granted now

      Actually, the ECMA version of the spec is for 2.0 (2006). Newer versions of the spec are available on Microsoft web site - here is the one for C# 3.0, and here is the draft for the upcoming C# 4.0 - and are similarly covered by a legal promise to not use patents against any compliant implementations.

    10. Re:Not even going to RTFA by shutdown+-p+now · · Score: 1

      The problem with this logic is that it essentially precludes evolution. By the same argument, back in 1980, you'd be the one arguing against OOP, and in 1970, against that new-fangled structured programming thing (who needs special constructs for loops when IF/GOTO is good enough, has been around for ages, and is explicit in its intent?).

    11. Re:Not even going to RTFA by Anonymous Coward · · Score: 0

      > You know, just like Java ripped off C++ and Smalltalk

      Er, no.

      Java ripped off C++, which ripped off Simula. Smalltalk also ripped off Simula. However, neither Java nor C++ ripped off Smalltalk; any similarities between C++/Java and Smalltalk are from their common ancestor, Simula. The only common language to rip off Smalltalk is Objective-C.

      Java is just C++ with the sharp edges removed and garbage collection added.

    12. Re:Not even going to RTFA by owlstead · · Score: 1

      Absolutely not. What I am arguing against is putting things like OO into a language that was not designed for OO (it's called C++). It makes the language into a right mess. For the same reason I am against putting functional structures into Java. I want a clean language that uses OO, not an OO language that also does a bit of functional programming and, lets say, SQL (C#).

      Since we've got these nice run times, both for .NET and for Java, why not keep these new structures in new languages and communicate through the libraries available to all. Do we really *need* lambda functions in Java? Aren't those instances asking for a full functional language instead of an OO language (in which variables now have scope problems because we had to fuse some functional structures in the language?)

      The 1.4 to 1.5 changes were fine for me, since I had the idea that they added to the language without redefining it. There are a lot of changes in 1.7 that I question though, I feel they are trying to do too much. And I am feeling that if they added all the features that *I* like the language would become simply too verbose. In those cases you can better go for a redefined language, building on the experience from the previous language, and hope it catches on. In a sense, that's what was done when going from C++ to Java.

    13. Re:Not even going to RTFA by shutdown+-p+now · · Score: 1

      I definitely agree that Java belongs to the Simula family of OO languages, and owes most to C+++. What they took from Smalltalk (and it was explicitly identified by language designers as such) was the idea of having a VM with a GC.

      I wouldn't say that Simula is a true ancestor of Smalltalk, however. It does reuse the core concept of objects as aggregates of values with identity, and virtual dispatch, but aside from that they have very different approaches to things (even though sometimes they produce the results that are seemingly the same on the surface by accident). In a few interviews I've seen, Gosling mentioned that Oak actually looked much closer to Smalltalk, and they've turned it into what Java today is to make it more appealing to C++ devs.

    14. Re:Not even going to RTFA by shutdown+-p+now · · Score: 1

      Absolutely not. What I am arguing against is putting things like OO into a language that was not designed for OO (it's called C++). It makes the language into a right mess.

      And yet, it also made the language so practical that it's still alive and well after 20 years.

      r the same reason I am against putting functional structures into Java. I want a clean language that uses OO, not an OO language that also does a bit of functional programming and, lets say, SQL (C#).

      If you want a clean language that uses OO, you don't want Java either, because it's not one (see: primitives vs classes). A clean OO language would be Smalltalk.

      The reason to mix OO and FP in the same language is that it's much more convenient to be able to use FP for small tasks where it's good at, within a large OO system, seamlessly. A strong separation between the two (say, if you take Java and ML) makes interop painful - often enough so that it outweighs any benefit you could otherwise gain from using FP.

      As to why shoehorn new features into existing languages, rather than build a new language from scratch - well, that should be obvious. You already have a large user base, and good, polished tools for the language. It's both easier and more practical to build on that, than to start from scratch.

      In those cases you can better go for a redefined language, building on the experience from the previous language, and hope it catches on.

      Well, yes, but that's precisely what's going on. It's just that the previous language is called "Java 6", and the new redefined language is called "Java 7".

    15. Re:Not even going to RTFA by Anonymous Coward · · Score: 0

      First off C#.NET is really nice in a MS shop. It integrates well with other ms products and the .NET platform.

      However, Java has had generics for awhile since Java( circa 2006).

      C# is not .NET and C# and .NET are intertwinded just like the STL and C++ are. .NET is not portable and an example is the Mono project. Without .NET c# is worthless as its considered part of it by its users.

      MS ecosystems are designed to only work with other microsoft products. Sure there are other vendors and you can write your own .ocx controls but you are still tied to a proprietary MS stack. MS even admited to crippling DOS to screw Lotus customers over with "DOS aint done until Lotus wont run", and changing windows95 code to make sure it would break on OS/2. The list goes on and on.

    16. Re:Not even going to RTFA by shutdown+-p+now · · Score: 1

      However, Java has had generics for awhile since Java( circa 2006).

      I wasn't talking about generics in general. I was talking specifically about reified generics. For plain generics, Java actually had them 1 year earlier than C#, mainly because of differences in release cycles - Java 5 got released in 2004, .NET 2.0 in 2005. Actual work was mostly parallel, however.

      .NET is not portable and an example is the Mono project.

      How is Mono an example that .NET is not portable?

      I don't think it's meaningful to talk about portability of .NET as a whole, though. File formats and compiler output are obviously portable. As for libraries - it's not one huge library so much so as a set of them, each for a different task. Some are easy to port, some are not. Mono does ASP.NET very well, for example, and all the base class library is there, but its WinForms implementation is still glitchy, and it doesn't have WPF/WCF/WWF at all.

      At the same time, you can write portable (Win32/Unix+X) applications in Gtk# - yes, it does run on Windows, even with native .NET.

      MS even admited to crippling DOS to screw Lotus customers over with "DOS aint done until Lotus wont run"

      I don't know much on your other statements, but this one was thoroughly debunked as a myth - so much so that Slashdot run it as a story.

    17. Re:Not even going to RTFA by rtfa-troll · · Score: 1

      The PDF doesn't specifically say that. The PDF says:

      "Microsoft will grant, on a non-discriminatory basis, to any party requesting it, licenses on commercially reasonable terms and conditions, for its patent(s), if any, deemed to be necessary for the implementation of the Ecma Standard"

      To me this sounds like a typical piece of legalese, most likely to satisfy some ECMA rule that published standards must have such a RAND promise.

      The problem is that you are reading this as a programmer when it needs to be read when you need to read it as a lawyer (since it's a legal statement).

      Furthermore, the very same PDF, in its P.S., says that any patent claims relevant to Ecma-334 are also covered by Microsoft Community Promise.

      Microsoft irrevocably promises not to assert any Microsoft Necessary Claims against you for making, using, selling, offering for sale, importing or distributing any implementation, to the extent it conforms to one of the Covered Specifications, and is compliant with all of the required parts of the mandatory provisions of that specification ("Covered Implementation")

      In order to interpret this we need to a) compare with a normal license grand and b) identify what they aren't saying. A normal patent grant would say something like "we have patents A,B and C related to this, we won't assert these patents against you for any implementation of this standard; contact us if you think any other patents we have may be needed and we'll be glad to assist". This "promise not to assert" avoids that. E.g. they plan to be able to sue you over any patent which covers your implementation but is not "Necessary". That's quite dangerous; they could have a patent on the fast way of doing something, allowing you only to implement the slow way. They could even have a separate patent on every single way of doing something but since no single one is "Necessary" they could, in principle sue you over that.

      Going further to that; have you ever seen a large piece of software with no bugs? Of course not. It is simply impossible that software is "compliant with all of the required parts" (my emphasis). If they wanted to have a clear and safe definition they would have said something such as "passes the latest or last but one conformance test suite at the time of it's release and is sold no longer than a year after it ceases to pass the latest test suite for it's standards version". As currently phrased there is no way to prove to yourself that you are covered by this promise.

      Compare these with standard patent licenses used almost everywhere and you will see that Microsoft's promises not to assert are full of holes. This isn't an accident caused by a small company that can't afford any lawyers.

      My guess? This is simply a way of saying: 'If you are our friend we have an excuse not to sue you, so don't worry as long as it stays that way. If you ever step out of line, you are dead, so don't even think about it.' Working with Microsoft is a bit like working with Sauron. You had better stay servile and useful.

      --
      =~ s,(.*),<sarcasm>$1</sarcasm>,g if any_point_you_wish();
  18. reliability by j1m+5n0w · · Score: 1

    What if you need a complex program that's very reliable? I know it can be done in C and Python, but usually not without rigorous testing.

    1. Re:reliability by Anonymous Coward · · Score: 0

      Using a functional programming language doesn't negate the need for rigorous testing. Especially since almost every complex program in existence depends heavily on some form of user input.

    2. Re:reliability by j1m+5n0w · · Score: 1

      Very true. However, I have found that programs I write in functional languages tend to have significantly fewer bugs. I don't know how much of this to attribute to the functional style of programming without side-effects, or the very strict Hindly-Milner type system I'm accustomed to working with in ML-derived languages like Ocaml and Haskell.

      I did not mean to imply that functional programs don't need to be tested, and I fear my post came across that way. Rather, the testing effort is usually much shorter, as there are fewer iterations of "find bug, fix bug, re-test".

  19. C++ original? by Anonymous Coward · · Score: 0

    According to many developers, it is the most original new face in computer languages since Bjarne Stroustrup developed C++ in the early 1980's.

    Ever used C, or Simula, or ADA. There is not a piece of originality within C++.

    Then I stopped reading the article.

    1. Re:C++ original? by shutdown+-p+now · · Score: 2, Interesting

      Well, C++ templates are unique. I don't know any other language that has a macro facility that pretends to be a generic type system... ~

      Anyway, C++ was not original from language design perspective - it does indeed rip off Simula a lot - but who actually wrote anything in Simula? It was a very niche language, while C++ became mainstream. Most people who used it first saw all those Simula features in C++, and don't really know better. So "according to many developers", the assertion may even be correct...

      It's very similar to how a lot of Java coders genuinely believe that Java was the one to pioneer OOP, and haven't even heard of Smalltalk, much less Simula.

    2. Re:C++ original? by oldhack · · Score: 1

      You know, C++ is the language embodiment of Microsoft. It embraces and extends everything from everyone else, and yet manages to maintain market share with C compatibility.

      --
      Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
  20. Looks interesting as replacement for Python by otter42 · · Score: 2, Interesting

    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.

    --
    www.eissq.com/BandP.html Ball and Plate System. Amuse your friends. Crush your enemies.
    1. Re:Looks interesting as replacement for Python by shutdown+-p+now · · Score: 2, 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 languages traditionally have terse names - how about the classic foldl and foldr ("fold left" and "fold right")? F# mostly follows suite - the most recent version is a tad more verbose, but you'll still be dealing with things such as Seq.mapi.

      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.

      On the whole, it looks like what you're looking for is actually called Ruby.

    2. Re:Looks interesting as replacement for Python by k33l0r · · Score: 1

      How about you give Ruby a try?

    3. Re:Looks interesting as replacement for Python by otter42 · · Score: 1

      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)

      I do. They're not quite the same beast, but since I've programed a lot in C the question of dynamic typing or not is not so important.

      On the whole, it looks like what you're looking for is actually called Ruby.

      Really? I had always thought of Ruby as a web language. Thanks for the tip, I'll look into it.

      --
      www.eissq.com/BandP.html Ball and Plate System. Amuse your friends. Crush your enemies.
    4. Re:Looks interesting as replacement for Python by monoi · · Score: 1

      Or you could, you know, just use perl 5 and have for my $x in ( 2..5 ) do exactly what you expect it to. I quite like Python, but I don't really get why it has displaced perl as the scripting language of choice. It seems to make most simple tasks just slightly harder than they need to be.

    5. Re:Looks interesting as replacement for Python by chico_the_chihuahua · · Score: 1

      As the other posters commented, it's not dynamically typed (but it is very generic), and the #light syntax is indentation sensitive (fortunately, tabs are banned, which was the initial bane of my Haskell writing days).

      But, I do suspect that IronPython is not a featured language of VS2010 for precisely the reason you say. M$ probably want F# to gain some traction before officially adding IronPython to VS (if they ever do, that is). Python does have some great ideas inspired by functional languages, but it's in no way a functional programming language. Python doesn't impose any type constraints, but I think that F# takes the approach that a lot of functionality can be expressed with generics, and others must be strongly typed - but the language tries it's best to infer those types for you, so you can usually rely on this, unless things get ambiguous.

      I really like the pipe operator for making a flow of data more explicit:
      List.fold reduceFunc (List.map someFunc fooList)
      vs
      fooList |> List.map someFunc |> List.fold reduceFunc

      Also, there's some interesting implications about what type information is visible in the first example and second (hint: someFunc and reduceFunc know nothing about the data types in the first example).

    6. Re:Looks interesting as replacement for Python by selven · · Score: 4, Interesting

      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.

    7. Re:Looks interesting as replacement for Python by chico_the_chihuahua · · 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 it can't do with if/then/else statements.

    8. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      If you have ever done a substantial amount of code that works on ranges, using operations such as finding common subranges, unifying multiple ranges, determining complementary ranges etc., then you learn to appreciate the style of leaving the specified endpoint outside the range. Otherwise you simply end up doing lots of +1 or -1 adjustments to get all the comparisons and iterations correct (and no, often you can't work around it by using a less-than-or-equal comparison). And if you miss a single adjustment, you get a hard-to-find bug. On the other hand, using ranges where the endpoint is not included is much easier, and you hardly ever need to do any adjustments to the endpoints at all.

    9. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 1, Informative

      I've never used F# but that syntax is very clear as long as you understand pattern matching. Furthermore, the F# version won't cause a stack overflow for large values of n where the Python version will.

    10. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      I prefer OCaml's syntax over that of F# then:

      let rec factorial = function 0 -> 1 | n -> n * factorial (n - 1)

    11. Re:Looks interesting as replacement for Python by chico_the_chihuahua · · Score: 1

      The function syntax is essentially shorthand for match with a single argument - both are valid in F# (and OCaml).

    12. Re:Looks interesting as replacement for Python by EsbenMoseHansen · · Score: 1

      I've never used F# but that syntax is very clear as long as you understand pattern matching. Furthermore, the F# version won't cause a stack overflow for large values of n where the Python version will.

      Who cares? Either programs are toys which are not really useful for big values. There are other more efficient ways to compute n! for big n's, but not something that will fit in a handful of code lines.

      --
      Religion is regarded by the common people as true, by the wise as false, and by rulers as useful.
    13. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      Just a quick insight into why Python's indexing makes utter sense to me, and why what you're suggesting would drive me nuts (I know this because the codebase I have to maintain has classes that work the way you describe, and I wish it would do it the way Python does it).

      That's not to say that your preference is without merit, just to show that there are two equally valid points of view.

      Python's slicing syntax means that mylist[n:m] will have (m-n) elements in it, and not (m-n)+1. This has several nice side-effects; for example mylist[n:n] will be an empty list and will never be iterated over, and mylist[0:N] is the same as mylist[0:1] + mylist[1:2] + mylist[2:3] + ... mylist[N-1:N].

    14. Re:Looks interesting as replacement for Python by GreyWolf3000 · · Score: 1

      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!
      >>

      --
      Slashdot: Where people pretend to be twice as smart as they really are by behaving like children.
    15. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      "Funny characters"? You can pretty much guess what they mean by looking at them, if you have any experience in programing *at all*!

      "I" means "integer"
      "|" means "or"
      "->" means "then"

      Is this really that fucking hard to learn?

    16. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      Taking out line breaks does not a one liner make. Just because it is syntactically correct, if I ever saw someone around me write that I would have to punch them in the face.

    17. Re:Looks interesting as replacement for Python by codepunk · · Score: 1

      "Forced whitespacing doesn't suit my debugging style"

      It may not, but it sure makes your crap easier for me to debug when it breaks.

      --


      Got Code?
    18. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      This is probably an attempt to gently introduce 'match' which is a bit addictive. F# supports the 'if' syntax you prefer.

      In my experience, the match syntax is very powerful for composing 'dialog' between components. Consider the simplest case of F#'s option:

      type Option =
              | None
              | Some of 'a

      You have a function that can fail, but you don't want to throw (to avoid debug headaches perhaps). You return an option value and:

              match value with
              | None -> // Handle failure case
              | Some x -> // x is the value you want

      And that is only the beginning.

      Just because the syntax is not what you are used to, it doesn't make it poor. If you have the time, learn it and see if it is valuable.

    19. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      In this case, you could use if/else in F# (or ML, Haskell, etc) and it would look very much like the Python version (although the test goes first, not in the middle), but it's more common to define functions case-wise (i.e. pattern-match on the arguments). Partly because that's the convention in mathematics, partly because pattern-matching is more general (using if/else only works when you only have two cases and one of them is "everything else").

      Although the simple base-case/inductive-case form is quite common, so is the situation with two base cases (e.g. empty list, single-element list, arbitrary list, or zero, one, many), or base/inductive for two arguments (giving four cases).

    20. Re:Looks interesting as replacement for Python by otter42 · · Score: 1

      Oh, please. What hogwash. You're making an assumption that not liking enforced whitespace means not having consistent style and respecting whitespace norms for all published programs. Anyone who does serious programming is capable of instantly figuring out whitespacing, even when it's inconsistent. If it's code that's been incorrectly formatted, it's dreadfully easy to fix it. Matlab, for instance, will automatically apply correct indents to an entire file, so I imagine that that's a feature available on many other editors.

      What's hard to figure out on your own is uncommented code. Should Python mandate comments, then? (Maybe just!)

      --
      www.eissq.com/BandP.html Ball and Plate System. Amuse your friends. Crush your enemies.
    21. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      Here's the corresponding F# one liner, same length and simplicity as the Python one liner:

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

      Here's another F# one liner factorial, without recursion:

      let factorial n = Seq.reduce (*) [1..n]

    22. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      Obviously someone's odd example on a wiki is a good reason why a language is weird..

      here is your python example in F#:
      ler rec factorial n = if n = 0 then 1 else n * factorial (n-1)

      Looks similar, doesn't it?

      The Wikipedia example tried to show pattern matching for a bit of more information, and the I at the end of numbers is to use "large" integers that grow in size, because factorial of 1000000 would overflow both the python and this F# example, but not the one you saw on wikiepdia because it's using bigints.

    23. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      This is example of mathers, often they looks better when there are five or more nodes... And of course, F# also has if...else.. So I believe your example is lack of imagination.

    24. Re:Looks interesting as replacement for Python by Anonymous Coward · · Score: 0

      The point is that Python doesn't optimize tail calls and therefore makes many problems harder and more verbose than they need to be. Ignoring this fact and focusing on the trivial example given is rather shortsighted.

    25. Re:Looks interesting as replacement for Python by McBeer · · Score: 1

      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.

      The problem here is with wikipedia not F#. The characters are normally a way of typecasting integer literals, however it it not necessary (nor even valid) to do that in a match statement. The wikipedia example should be:

      let rec factorial n =

              match n with

              | 0 -> 1

              | _ -> n * factorial (n - 1)

      or even more simply

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

      --
      Hikery.net - The best hiking site ever. Made by yours truly.
    26. Re:Looks interesting as replacement for Python by lahvak · · Score: 1

      I know absolutely nothing about F#. Let's see what I can make of it:

      My guess is that the I after the number means integer. We are defining a function named factorial, which takes one argument, n, and if it is exactly 0, it returns 1, and if it is anything else, it recurses. I am not sure what the "rec" means, perhaps it tells the compiler that it is a recursive function? It is also unclear to me what is going to happen if you feed it a non-integer, or a negative integer.

      As far as the python one-liner, I know python pretty well, but I have to think a bit to actually decipher what is it going to do. Does it mean

      (return 1) if n == 0 ... or return (1 if ...)?

      --
      AccountKiller
    27. Re:Looks interesting as replacement for Python by otter42 · · Score: 1

      Oh, I completely understand why you like it. The function itself doesn't even bother me. What bothers me is the name. If I say "you've got a range of options to choose from when programming, from C++ to Python," 100% of people would understand both C++ and Python to feature in the list. When we talk about functional programming, I understand programming that can be read outloud. This might be incorrect, but it's the way I imagine it should be.

      So, really, it's not a programming problem at all, it's just a terrible syntax problem. There's a myriad of bad and confusing function names that can be imagined, and more than a few seem to have wound up in Python.

      P.S. I'll have to look into the advantages range gives you. What you describe makes it seem like a nice function, in spite of the name.

      --
      www.eissq.com/BandP.html Ball and Plate System. Amuse your friends. Crush your enemies.
  21. Marketing? What the? by Puff_Of_Hot_Air · · Score: 3, Informative

    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 have devoted themselves to for years. Especially when they believe that it could bring functional programming into the mainstream. I have used F#, and personally really enjoy coding with it (and especially the different way in which solving problems in this manner makes you think). Might be a long time before it is excepted into production code though...

    1. Re:Marketing? What the? by Sponge+Bath · · Score: 1

      ...burst forth from the loins of Microsoft

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

    2. Re:Marketing? What the? by Anonymous Coward · · Score: 0

      I agree. I attended a lecture he gave recently. He is a smart guy and F# is solid language.

  22. Helloworld by petronije · · Score: 1

    For those who don't have a clue but still have urge to comment, here is "hello world" in F#:

    [start snipp]

    #light

    open System

    printfn "Hello world\n"

    Console.ReadKey(true)

    [end snipp]

    And another example illustrating what would would take a highschool kid to modify physics simulation:

    [start snipp]

    #light

    open System

    let gravity = -9.81

    let euler_explicit accel pos speed delta =
    pos + delta * speed, speed + delta * accel

    let euler_implicit accel pos speed delta =
    let speed2 = speed + delta * accel in
    pos + delta * speed2, speed2

    let pos, speed = euler_explicit gravity 0.0 0.0 1.0 in
    printfn "pos = %f speed = %f\n" pos speed

    let pos, speed = euler_implicit gravity 0.0 0.0 1.0 in
    printfn "pos = %f speed = %f\n" pos speed

    Console.ReadKey(true)

    [end snipp]

    (taken from http://sharp-gamedev.blogspot.com/2008_09_01_archive.html)

    Cheers

    1. Re:Helloworld by Anonymous Coward · · Score: 0

      Would have been more interesting if you'd written the physics bit with the F# measure syntax...

  23. Two great tastes that taste good together? by argent · · Score: 1

    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"?

  24. It's not Microsoft RESEARCH's offering... by El+Cabri · · Score: 2, Interesting

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

  25. a fully productized and supported language by Anonymous Coward · · Score: 1, Insightful

    Don't you mean - yet more Vendor lock-in ..

    1. Re:a fully productized and supported language by Anonymous Coward · · Score: 0

      Actually, OP probably means common sense. You should look into it. Or maybe you're one of those freetards that constantly expect people to give them free shit.

    2. Re:a fully productized and supported language by the+eric+conspiracy · · Score: 2, Insightful

      There is a basic rule about writing programs - choose not a vendor specific language, and the useful lifetime of your program will surpass the life of your hardware.

      F# is really just an OCaml variant anyway. Why should I buy something that is locked into a particular vendor and OS when I can get the same thing for free and run it on all the systems I own?

      This article smacks of marketing to developers too much for me to feel comfortable with it... ok for Microsoft tards but not for people who haven't sold their souls.

    3. Re:a fully productized and supported language by owlstead · · Score: 1

      "Actually, OP probably means common sense. You should look into it. Or maybe you're one of those freetards that constantly expect people to give them free shit."

      You must be one of those retards that think only capitalism works - and then buys into a vendor that does anything to disallow competition.

    4. Re:a fully productized and supported language by pydev · · Score: 1

      Or maybe you're one of those freetards that constantly expect people to give them free shit.

      Yes, I am one of those freetards. I used to be willing to pay for shit from companies like Microsoft, but I have gotten screwed too often.

      I'm still willing to pay for something, but I'm not willing to pay for something like a language compiler. If Microsoft wants to establish F# as a standard, they need to make it free and open source.

      Also, given that F# is largely a clone of a publicly financed, open source software project and has grown out of decades of publicly financed research, there is a reasonable expectation that F# should be free and open source.

    5. Re:a fully productized and supported language by shutdown+-p+now · · Score: 1

      There is a basic rule about writing programs - choose not a vendor specific language, and the useful lifetime of your program will surpass the life of your hardware.

      F# is really just an OCaml variant anyway. Why should I buy something that is locked into a particular vendor and OS when I can get the same thing for free and run it on all the systems I own?

      Once the final version of F# is released (as part of VS2010), the plans are to make it open sourced under Ms-PL. Combined with Mono, that would mean no vendor lock-in. There is no OS lock-in already, since F# supports Mono on Linux and OS X.

      As to why you'd prefer F# over OCaml - it depends. Maybe you want proper Unicode support in the language. Maybe you want to use the large number of libraries targeting .NET available out there (Gtk# comes to mind - I think it's more up-to-date, and covers more Gtk/GNOME APIs, than LablGTK). Maybe you don't mind Windows, and want a good IDE.

    6. Re:a fully productized and supported language by the+eric+conspiracy · · Score: 1

      The path to proprietary lock-in is paved with attractive features.

  26. Time to change by thetsguy · · Score: 3, Funny

    WTF#

    1. Re:Time to change by ther.geek · · Score: 1

      What the F#C# ?

  27. Evolution by Skeptical1 · · Score: 1

    Looks like the languages are breeding. Look at the 'DNA' combining. Not Pretty. Lots of extinctions. If you can't stand the mess get out of the pool.

  28. What About Functional C#? by Doc+Ruby · · Score: 1

    Aren't all the functional techniques in F# being pulled into C#? Like DryadLINQ, and other components from Microsoft?

    --

    --
    make install -not war

  29. Functional languages and recursion by bradley13 · · Score: 1

    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-recursive. This lack of optimization means that deeply recursive algorithms must be avoided - leading right back to (a).

    My question for /. is simply: why? Why co modern OO languages not provide decent optimizations for recursion? Why are most programmers uncomfortable with it? What can be done to break this cycle?

    --
    Enjoy life! This is not a dress rehearsal.
    1. Re:Functional languages and recursion by Anonymous Coward · · Score: 0

      "There are a lot of algorithms that can best be expressed and (theoretically) most efficiently solved by recursion", in some bearded Professor's basement.

      A lot of people that have never written a real program that actually does things and live in that basement agree with that statement.

      Meanwhile, somewhere in the real world, we write a loop in C that works in 1/n the time and call it a day.

    2. Re:Functional languages and recursion by ascari · · Score: 2, Funny

      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

    3. Re:Functional languages and recursion by chico_the_chihuahua · · Score: 1

      Probably because it's easier to express, recognise and optimise tail-recursion under the functional paradigm than the imperative space, especially true for the close-to-metal languages like C/C++.

      Funnily enough though, I may be wrong about this, but I don't believe that the IL has very good at tail recursive performance, so proper tail recursion is only used after some stack usage heuristic has been breached....
       

    4. Re:Functional languages and recursion by Anonymous Coward · · Score: 0

      Wow.

      What a douche.

    5. Re:Functional languages and recursion by pydev · · Score: 1

      There are a lot of algorithms that can best be expressed and (theoretically) most efficiently solved by recursion.

      Whether you use recursion or loops generally makes no difference for asymptotic performance, since they can be easily transformed into one another. For actual speed, loops are always at least as fast as recursion.

      (a) most programmers are not comfortable with recursion

      Most programmers don't seem to have a problem with recursion. They don't like tail recursion, but that's because tail recursion doesn't make a lot of sense in an OOL.

      My question for /. is simply: why? Why co modern OO languages not provide decent optimizations for recursion? Why are most programmers uncomfortable with it? What can be done to break this cycle?

      Tail recursion makes most sense if you want to avoid assignment. Since OOLs have assignment, often a loop is just the better construct. Most other kinds of recursion can't be optimized anyway.

      FWIW, gcc does support tail recursion optimization. Of course, if you rely on it, your program may not run as well on other compilers.

  30. Re:Python is waaaayyy better by Johnny+Loves+Linux · · Score: 1

    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 your posting, you've got lots of experience number crunching. Have you taken a look at numpy and scipy? There optimized modules to give python the speed of fortran for doing linear algebra, statistics, etc. Want to do an svd,linear regression, sampling, etc. in python fast and easy? numpy is your best friend.

    The one big showstopper I have with F# (which might (maybe) actually be an awesome language) is of course that it comes from Microsoft, who has a better proven history of screwing people and locking them into Windows than some Oil companies have of finding oil. On what platforms can I use this F# language? Please, no equivocating. I just want to be able to do: "sudo apt-get install F-sharp".

    Why should I wrote code in a language that's bound to a platform/OS that's inferior to the one I use on a daily basis from a company who's trying to lock me into their products, when I have free easy access to code from people who don't have as an agenda screwing me over with their licenses, restrictions, treating me like a suspected criminal? If I want a functional programming language, I can run lisp, ocaml, haskell, ML, erlang, none of which restrict me as to which platform or OS I use.

  31. Licensing? by halfdan+the+black · · Score: 1
    F# really is a nice language, but the last time I looked, the licensing is REALLY SCARY. Its under some sort of Microsoft shared source type license which essentially states that you can not use F# is any type commercial environment, unless you are using Windows. So, you are allowed to look at, and write programs, but you could not distribute them.

    Has this improved any? I really would like to used F# on Linux, but I will not go anywhere near something with licensing like this?

  32. Knee-jerk moderation? by ClosedSource · · Score: 2, Insightful

    As one might expect, you can get moderated as Flamebait if you say the same thing about opensource as somebody said about .Net.

    The funny thing is that the moderator missed the point. The AC was mocking the logic of the other poster, not really making a statement about OSS projects.

  33. My answer could be described as meta by Anonymous Coward · · Score: 0

    Q: What's wrong with C and Python?

    A: They are great programming languages, but it is my observation that using them turns you into the sort of dickhead who believes that their opinions are intrinsically superior.

  34. Re:Python is waaaayyy better by codepunk · · Score: 1

    Begin-End

    Stop it you are giving me pascal flashbacks.

    --


    Got Code?
  35. Re:HAHA Crappy open sores crashes again by Anonymous Coward · · Score: 0

    Actually, that crashes because of crappy closed source software, specifically Adobe Flash.

  36. open source license? by pydev · · Score: 1

    Are you going to make F# available under an open source license like Apache, BSD, or LGPL? The current shared source license really makes F# unattractive for both commercial and academic use. Given how much F# builds on OCAML, it would also only seem fair if F# itself becamse open source.

    1. Re:open source license? by shutdown+-p+now · · Score: 1

      According to Don:

      "The F# team's plan of record (i.e. the one we announced last year) is to make the source release of the compiler around the time it completes the productization process, i.e. corresponding to a supported release. This means approximately Visual Studio 2010 RTM, give or take a bit . The plan is for this to be under MS-PL."

    2. Re:open source license? by pydev · · Score: 1

      Thanks; however, as I recall, they've been promising open source releases earlier and they seem to keep getting pushed back.

    3. Re:open source license? by shutdown+-p+now · · Score: 1

      I suspect that it's as usual with the release cycle - they might have expected it to be a smooth ride early on, but as the deadline neared, there were still too many things to be done, and not enough time. Especially since they're a new addition to this release, not incremental evolution of something that was there before.

      IIRC, Don has already been saying the same thing about "open sourcing after VS2010 is out" since at least mid-2008, however, so the plan is seemingly stable for a while now.

    4. Re:open source license? by pydev · · Score: 1

      OK, well, let's hope so. I think having F# available under an open source license would be nice, but if it's not happening this year, I think they missed their chance.

  37. Re:Python is waaaayyy better by otter42 · · Score: 1

    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

    That *is* a neat feature.

    My only beef is that it can't help to solve the mess that is everyone else's Python code. Once I'm programming in Python, all these things will seem very natural. (It can't be worse than C!) But for people who are new to Python, and just want to modify a tiny section of code in someone's script because it almost, but not quite, does what they want it to, all the myriad Python bizarreness jumps up and bites them.

    --
    www.eissq.com/BandP.html Ball and Plate System. Amuse your friends. Crush your enemies.
  38. CEO fired for buying .NET system by mangu · · Score: 1

    The problem is not that badly written programs fail. The problem is that even programs that were supposed to be well written in .NET crash miserably.

    In the old days people would say "no one was ever fired for buying an IBM system". Well, there's at least one chief executive of a major corporation that has been fired for buying a .NET system.

    1. Re:CEO fired for buying .NET system by ClosedSource · · Score: 1

      So you provide a link to a story written by an obvious anti-MS guy with his interpretation of a particular failed implementation. This still doesn't support your contention that .Net has more problems than other languages/frameworks.

  39. Object oriented and functional cannot be combined by Frans+Faase · · Score: 1

    It is impossible to combine a object oriented language with a functional language. Functional languages are about values. Values are closed. Values are the opposite of objects. Functional languages could only work on closed collections of objects as a whole, because such a collection would behave as an object. Any attempt to combine the two will lead to very strange and counter intuitive semantics where either one of the two has is seriously damaged. Either you get a functional language (working on collections of objects as a whole) or you get a object oriented language with non-functional semantics. Everybody who claims that functional and object oriented can be joined either does not understand what these words mean or have an alternative interprettation of what of either one of the two terms.

  40. functions vs procedures by j1m+5n0w · · Score: 1

    I'm aware of the difference, but even so, C programmers typically call them functions, not procedures, and I've been a C programmer for a lot longer than a functional programmer, so that's what I (and many imperative programmers) are accustomed to calling them. It isn't as if I don't think it's important to use words correctly, but I don't think it's productive to argue about who is using what word in the wrong way if my meaning is clear. If it isn't, then that's my mistake, then.

  41. 1984 reference obligatory? by Anonymous Coward · · Score: 0

    Syme disappeared.

  42. Common Lisp is definitely both functional and object orientated.

    1. Re:CLOS? by Frans+Faase · · Score: 1

      Lisp already had variables. Thus not being purely functional. A pure functional language is a language where the functions do not have side effects.

  43. Mono is not .NET by Billly+Gates · · Score: 1

    How many times does it need to be said?

    I have not seen one and I mean one .NET program that can simply be recompiled to run on Unix. There are always problems or something dumb like winforms not being up to 1.0 equivalent due to them using COM.

    Novel Zenworks is the only thing that comes close because it has 2 different software versions due to the incompabilities of Mono. The linux version sucks very bad.

    The whole reason why Google Sketch does not have a Linux port is because of .NET. Its nearly impossible to port it.

    At any given bookstore how many books on .NET do you see that do not show Visual Studio and instructions on how to use it? Visual Studio and .NET seem to confuse programmers as the same product. ... in actuality they are. .NET is part of Microsoft's Visual Studio tools of Windows only development.

    Let me know when paint.net can simply be recompiled with a checkbox to GNU/mono?

    Its about as portable as C++ in my opinion in that you need the right apis on multiple platforms. This is why Java was created.

  44. Re:Object oriented and functional cannot be combin by shutdown+-p+now · · Score: 1

    It is impossible to combine a object oriented language with a functional language.

    You have to go tell OCaml authors that...

    Functional languages are about values.

    Not at all. I'm not sure what you mean by "values" here (I'll touch on that below), but the strict definition of a functional language is "a language that has functions as first-class values". That's all there is to it.

    Values are closed. Values are the opposite of objects.

    I think you need to provide your definition of "object" and "value" at this point. Are you referring to the fact that objects have inherent identity, while values do not? What about immutable objects, that are used solely for encapsulation and virtual dispatch (a la OCaml)? How are they any different from ADTs?

    Or do you refer to immutability? It's not a hallmark of a functional language, either. For example, both Scheme and Standard ML have mutable values, but they're definitely functional. On the other hand, XQuery is pure - output is a strict function of input, no mutable state at all - but it doesn't have function types nor values, and so it's non-functional.

    Everybody who claims that functional and object oriented can be joined either does not understand what these words mean or have an alternative interprettation of what of either one of the two terms.

    "Alternative" relative to what? Yet again, you really need to provide your definitions for this to be comprehensible.

  45. Re:Object oriented and functional cannot be combin by Frans+Faase · · Score: 1

    Not at all. I'm not sure what you mean by "values" here (I'll touch on that below), but the strict definition of a functional language is "a language that has functions as first-class values". That's all there is to it.

    I would define a functional language a language in which all expressions (including defined functions) have no side effects.

    Object oriented to me means the introduction of object identity. Object oriented languages often work with collections of objects, that have references between them. Of course it is possible to define a function that queries a collection of objects, but as soon as you introduces means to alter attributes of objects (including references between them) you get serious problems with definining the semantics of your language, because you are introducing side effects. Side effects have a profound implication on things like execution order, which in a purely functional language should not matter (think about lazy evaluation). The only way you can avoid these problems is to let all your functions work on the whole collection of objects. Which means that if you modify one attribute of an object, the whole collection of objects (closed over objects that reference each other) are modified, implying that all objects are modified that belong to that collection. When you reason like this way about a collection of objects, that collection of objects becomes a value.

    But often when people talk about object oriented, that put the objects (and not the 'universe', the collection of objects that they belong to) at the center of their attention. For more of my thought, read the articles The Art of Programming and Object-Oriented Considered Harmful.

  46. F#'s main weakness is the .Net. by sergueyz · · Score: 1
    F# does contain holes in its type system.

    I've read (Russian) that the following code crashes in runtime:

    let comp x y = x > y
    let result = comp (new Dictionary<object, object>) (new Dictionary<object, object>)

    (I am not an F# expert, I am a Haskell user;)

    1. Re:F#'s main weakness is the .Net. by Anonymous Coward · · Score: 0

      That thread is out of date - this design issues has been addressed in F#. The following (corrected) version of your code gives a type checking error in recent release of F#

      open System.Collections.Generic
      let comp x y = x > y
      let result = comp (new Dictionary()) (new Dictionary())

  47. Re:Object oriented and functional cannot be combin by shutdown+-p+now · · Score: 1

    I would define a functional language a language in which all expressions (including defined functions) have no side effects.

    I see. Well, this isn't the mainstream definition of "functional". What you defined is a "pure" (or "side-effect free") programming language, which, by the way, may or may not be functional. I already gave one example of such - XQuery, which fits your definition to the letter - no side effects whatsoever - but nonetheless it cannot be considered functional if only because it doesn't have first-class functions (no function types, no lambdas...).

    Furthermore, Scheme and ML are widely considered functional, and they have mutability and side-effects.

    Object oriented to me means the introduction of object identity.

    Agreed, but the presence of identity does not imply mutability. It may sound surprising, but nonetheless - look at XQuery again. It does have node identity, which is essentially the same as object identity - some "magical" quantity that nodes possess quite aside from the aggregated value of their attributes and children - but you cannot ever mutate anything in a node. It also has lazy evaluation etc.

  48. Re:Object oriented and functional cannot be combin by Anonymous Coward · · Score: 0

    In what sense is the set of values for the function type "int -> int" closed? The set encompasses all possible computable integer-to-integer functions. That seems like a lot of values.

    Indeed, it seems like exactly the same number of values as the number of objects with a base class with an abstract member taking an integer and returning an integer.

    In other words, what is you definition of "closed?", particularly for function types?