F# programming language

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jon Harrop

    #31
    Re: F# programming language

    Christopher Ireland wrote:
    Jon Harrop wrote:
    | Christopher Ireland wrote:
    || P.S. it would be great if ray tracer compiled with the latest
    || publicly available version of F#!
    |
    | No, that's a really bad idea. If you can tweak the code then you'll
    | sink an enormous amount of time into fiddling with it. Take yesterday
    | for example, I barely got any work done... ;-)
    >
    Out of interest, do you find your code more or less buggy in F# than in
    C#? If there is a bug, in which language is it easier to trace and fix?
    I'm coming from a C++ vs ML background, so I can't comment on C# vs F#
    specifically. For ML vs C++, I'd say:

    1. ML is ~10x more productive, i.e. 1/10th development times.
    2. ML has 2-5x higher code density.
    3. ML code is much more reliable than C++ code but I can't quantify how
    much.

    I guess the reliability of ML code is reflected in the development time.

    --
    Dr Jon D Harrop, Flying Frog Consultancy
    Objective CAML for Scientists
    Business Das perfekte Beratungsgespräch: Tipps und Tricks Sabine Henschel4. Juli 2024 Business Mindset Coach: Ihr Schlüssel zu einem neuen Denken Sabine Henschel4. Juli 2024 Familie Kollegiale Beratung in der Pflege: Zusammen stark Sabine Henschel3. Juli 2024 Familie Was kostet eine Beratung beim Notar wegen Erbrecht: Ein Ratgeber Sabine Henschel2. Juli 2024 Business Was kostet eine

    Comment

    • Jon Harrop

      #32
      Re: F# programming language

      Christopher Ireland wrote:
      If there is a bug, in which language is it easier to trace and fix?
      When I started programming in OCaml I found its errors messages mostly very
      good but sometimes devilishly obscure. F# is in a similar boat.

      However, it only took me 6 months to get more efficient in OCaml programming
      than I was in C++, having been programming in C++ for 10 years.

      Type inference is the main difference. You rarely declare types in F# code
      because the compilers infers them all for you. That is usually great
      because you write a lot less code and the code is a lot clearer. However,
      when it goes wrong, the error messages can be confusing primarily because
      they'll contain the wrong types because the wrong types have been inferred.

      I should also mention that, for a large class of problems, F# code tends to
      work first time once it is compiled. Aside from good language design, I
      don't think there is any logical reason to expect that but it certainly
      works. There are examples where F# is less effective at checking your code
      but it always seems to remain significantly more effective than the
      competition.

      --
      Dr Jon D Harrop, Flying Frog Consultancy
      Objective CAML for Scientists
      Business Das perfekte Beratungsgespräch: Tipps und Tricks Sabine Henschel4. Juli 2024 Business Mindset Coach: Ihr Schlüssel zu einem neuen Denken Sabine Henschel4. Juli 2024 Familie Kollegiale Beratung in der Pflege: Zusammen stark Sabine Henschel3. Juli 2024 Familie Was kostet eine Beratung beim Notar wegen Erbrecht: Ein Ratgeber Sabine Henschel2. Juli 2024 Business Was kostet eine

      Comment

      • Jon Harrop

        #33
        Re: F# programming language

        Laurent Bugnion wrote:
        One more question though: You mention that C# is more "engineery" . Is it
        your opinion (like I think after reading what you wrote) that C# is more
        targeted at software engineers (like me) and F# at scientists?
        I'm a scientist and I'd actually have said quite the opposite. F# seems to
        be taking leaves from Matlab's book and I consider Matlab to be an
        engineer's tool.

        There's a lot of overlap between scientists and engineers, of course, and I
        think a real killer feature for F# will be a graphical version of the
        interactive mode. It is actually really easy to start writing one, you just
        replace the pretty printer for a given type with one that pops up a window.
        I got the
        feeling that scientists are more able to deal with the abstraction level
        you mention, while engineers prefer to see what's going on in the code.
        We probably need a quiz to answer that. If the engineers in the audience can
        understand the comparison I drew between the C++ and OCaml implementations
        of my ray tracer then I think they'll be fine with F#:

        Business Das perfekte Beratungsgespräch: Tipps und Tricks Sabine Henschel4. Juli 2024 Business Mindset Coach: Ihr Schlüssel zu einem neuen Denken Sabine Henschel4. Juli 2024 Familie Kollegiale Beratung in der Pflege: Zusammen stark Sabine Henschel3. Juli 2024 Familie Was kostet eine Beratung beim Notar wegen Erbrecht: Ein Ratgeber Sabine Henschel2. Juli 2024 Business Was kostet eine


        I'll put a similar page up comparing C# and F# implementations if you
        like...

        --
        Dr Jon D Harrop, Flying Frog Consultancy
        Objective CAML for Scientists
        Business Das perfekte Beratungsgespräch: Tipps und Tricks Sabine Henschel4. Juli 2024 Business Mindset Coach: Ihr Schlüssel zu einem neuen Denken Sabine Henschel4. Juli 2024 Familie Kollegiale Beratung in der Pflege: Zusammen stark Sabine Henschel3. Juli 2024 Familie Was kostet eine Beratung beim Notar wegen Erbrecht: Ein Ratgeber Sabine Henschel2. Juli 2024 Business Was kostet eine

        Comment

        • Laurent Bugnion

          #34
          Re: F# programming language

          Hi,

          Jon Harrop wrote:
          Laurent Bugnion wrote:
          >One more question though: You mention that C# is more "engineery" . Is it
          >your opinion (like I think after reading what you wrote) that C# is more
          >targeted at software engineers (like me) and F# at scientists?
          >
          I'm a scientist and I'd actually have said quite the opposite. F# seems to
          be taking leaves from Matlab's book and I consider Matlab to be an
          engineer's tool.
          Really? I remember Matlab from my engineer's school day, wouldn't like
          to use that to build a product (I mean, something I can actually sell to
          someone). It was a great tool to study mathematical transformations and
          the like, but when I want something done, I really prefer C#.

          There's a lot of overlap between scientists and engineers, of course, and I
          think a real killer feature for F# will be a graphical version of the
          interactive mode. It is actually really easy to start writing one, you just
          replace the pretty printer for a given type with one that pops up a window.
          >
          >I got the
          >feeling that scientists are more able to deal with the abstraction level
          >you mention, while engineers prefer to see what's going on in the code.
          >
          We probably need a quiz to answer that. If the engineers in the audience can
          understand the comparison I drew between the C++ and OCaml implementations
          of my ray tracer then I think they'll be fine with F#:
          >
          Business Das perfekte Beratungsgespräch: Tipps und Tricks Sabine Henschel4. Juli 2024 Business Mindset Coach: Ihr Schlüssel zu einem neuen Denken Sabine Henschel4. Juli 2024 Familie Kollegiale Beratung in der Pflege: Zusammen stark Sabine Henschel3. Juli 2024 Familie Was kostet eine Beratung beim Notar wegen Erbrecht: Ein Ratgeber Sabine Henschel2. Juli 2024 Business Was kostet eine

          >
          I'll put a similar page up comparing C# and F# implementations if you
          like...
          That would be nice, but I don't think I will work with F# in the near
          future (no time...), so do it only if you really have the time, or if
          you gain something from it.

          Thanks!
          Laurent
          --
          Laurent Bugnion, GalaSoft
          Software engineering: http://www.galasoft-LB.ch
          PhotoAlbum: http://www.galasoft-LB.ch/pictures
          Support children in Calcutta: http://www.calcutta-espoir.ch

          Comment

          • Ben Voigt

            #35
            Re: F# programming language


            "Jon Harrop" <jon@ffconsulta ncy.comwrote in message
            news:456574ea$0 $8713$ed2619ec@ ptn-nntp-reader02.plus.n et...
            >
            Microsoft Research are developing a functional programming language called
            F# for .NET and I've been playing with it recently. I've uploaded some
            demos here:
            >
            Business Das perfekte Beratungsgespräch: Tipps und Tricks Sabine Henschel4. Juli 2024 Business Mindset Coach: Ihr Schlüssel zu einem neuen Denken Sabine Henschel4. Juli 2024 Familie Kollegiale Beratung in der Pflege: Zusammen stark Sabine Henschel3. Juli 2024 Familie Was kostet eine Beratung beim Notar wegen Erbrecht: Ein Ratgeber Sabine Henschel2. Juli 2024 Business Was kostet eine

            >
            I'm keen to see what Windows developers think of this language as we're
            Useful for math and logic, not so much for GUI stuff which really requires
            imperative programming. But .NET will let you call back and forth so use an
            appropriate mixture of languages.
            considering using it to develop commercial applications on the Windows
            platform.
            Last I checked F# was only available for research with no option for a
            commercial license. That could be an insurmountable obstacle.
            >
            --
            Dr Jon D Harrop, Flying Frog Consultancy
            Objective CAML for Scientists
            http://www.ffconsultancy.com/product...for_scientists

            Comment

            • Christopher Ireland

              #36
              Re: F# programming language

              "Jon Harrop" <jon@ffconsulta ncy.comwrote in message
              news:45670d91$0 $8741$ed2619ec@ ptn-nntp-reader02.plus.n et...
              >
              I'll put a similar page up comparing C# and F# implementations if you
              like...
              Thanks again for your input, Jon.

              Yes please <g>!

              Cheers!

              Chris.


              Comment

              • Lucian Wischik

                #37
                Re: F# programming language

                Jon Harrop <jon@ffconsulta ncy.comwrote:
                >Type inference is the main difference. You rarely declare types in F# code
                >because the compilers infers them all for you. That is usually great
                >because you write a lot less code and the code is a lot clearer. However,
                >when it goes wrong, the error messages can be confusing primarily because
                >they'll contain the wrong types because the wrong types have been inferred.
                The most important F# lesson I learnt: always declare complete types
                for my functions! And declare types for any complicated-looking
                variables. This habit reduced my type-inference-debugging-time a lot.

                --
                Lucian

                Comment

                • Jon Harrop

                  #38
                  Re: F# programming language

                  Laurent Bugnion wrote:
                  Jon Harrop wrote:
                  >I'm a scientist and I'd actually have said quite the opposite. F# seems
                  >to be taking leaves from Matlab's book and I consider Matlab to be an
                  >engineer's tool.
                  >
                  Really? I remember Matlab from my engineer's school day, wouldn't like
                  to use that to build a product (I mean, something I can actually sell to
                  someone). It was a great tool to study mathematical transformations and
                  the like, but when I want something done, I really prefer C#.
                  You wouldn't use Matlab to make an application but you might write a toolbox
                  for Matlab and sell it. I think it is possible to do the same thing for F#
                  but, at the same time, you can write your applications in F# instead of C#.

                  --
                  Dr Jon D Harrop, Flying Frog Consultancy
                  Objective CAML for Scientists
                  Business Das perfekte Beratungsgespräch: Tipps und Tricks Sabine Henschel4. Juli 2024 Business Mindset Coach: Ihr Schlüssel zu einem neuen Denken Sabine Henschel4. Juli 2024 Familie Kollegiale Beratung in der Pflege: Zusammen stark Sabine Henschel3. Juli 2024 Familie Was kostet eine Beratung beim Notar wegen Erbrecht: Ein Ratgeber Sabine Henschel2. Juli 2024 Business Was kostet eine

                  Comment

                  • Jon Harrop

                    #39
                    Re: F# programming language

                    Ben Voigt wrote:
                    "Jon Harrop" <jon@ffconsulta ncy.comwrote in message
                    news:456574ea$0 $8713$ed2619ec@ ptn-nntp-reader02.plus.n et...
                    >Microsoft Research are developing a functional programming language
                    >called F# for .NET and I've been playing with it recently. I've uploaded
                    >some demos here:
                    >>
                    > http://www.ffconsultancy.com/dotnet/fsharp/
                    >>
                    >I'm keen to see what Windows developers think of this language as we're
                    >
                    Useful for math and logic, not so much for GUI stuff which really requires
                    imperative programming.
                    I'm going to try to write some GUI programs and I'll see how F# compares.
                    Presumably C# is likely to come out on top when there is a big GUI and not
                    much under the hood?
                    But .NET will let you call back and forth so use
                    an appropriate mixture of languages.
                    I've obviously been writing F# code that calls C# APIs but I've yet to try
                    it the other way around. I assume you have to restrict yourself to the C#
                    subset of F# when you want your F# code to be callable from C#.

                    Potentially I could write code in F# and sell it as a DLL for other .NET
                    programmers to use and they would never even know that I wrote it in F#.
                    I'd like try that but I've no idea if it is feasible... :-)
                    >considering using it to develop commercial applications on the Windows
                    >platform.
                    >
                    Last I checked F# was only available for research with no option for a
                    commercial license. That could be an insurmountable obstacle.
                    I'm sure you can write commercial software in F# and sell it. I think the
                    author is trying to get the whole thing released under a commercial license
                    so you will even be able to bundle the F# compiler with your product, e.g.
                    to do metaprogramming .

                    --
                    Dr Jon D Harrop, Flying Frog Consultancy
                    Objective CAML for Scientists
                    Business Das perfekte Beratungsgespräch: Tipps und Tricks Sabine Henschel4. Juli 2024 Business Mindset Coach: Ihr Schlüssel zu einem neuen Denken Sabine Henschel4. Juli 2024 Familie Kollegiale Beratung in der Pflege: Zusammen stark Sabine Henschel3. Juli 2024 Familie Was kostet eine Beratung beim Notar wegen Erbrecht: Ein Ratgeber Sabine Henschel2. Juli 2024 Business Was kostet eine

                    Comment

                    • Christopher Ireland

                      #40
                      Re: F# programming language

                      "Jon Harrop" <jon@ffconsulta ncy.comwrote in message
                      news:45673ac1$0 $8712$ed2619ec@ ptn-nntp-reader02.plus.n et...
                      I've obviously been writing F# code that calls C# APIs but I've yet to try
                      it the other way around. I assume you have to restrict yourself to the C#
                      subset of F# when you want your F# code to be callable from C#.
                      I think it must be, given that the assemblies built from F# are MSIL.

                      Try downloading Reflector for .NET (http://www.aisto.com/roeder/dotnet/) and
                      opening your raytracer.exe .. you'll be able to see the whole thing in C#
                      (or even Delphi, for that matter <g>).

                      Cheers!

                      Chris.


                      Comment

                      • Lucian Wischik

                        #41
                        Re: F# programming language

                        Laurent Bugnion <galasoft-lb@bluewin.chwr ote:
                        >One more question though: You mention that C# is more "engineery" . Is it
                        >your opinion (like I think after reading what you wrote) that C# is more
                        >targeted at software engineers (like me) and F# at scientists?
                        We're called software engineers but I don't think there's very much
                        engineering discipline in our work. We're expected to produce lots of
                        features, quickly, and track down lots of bugs, and we often don't
                        even have the time to sit back and calmly document how what we've done
                        works. F# seems good for this audience.

                        --
                        Lucian

                        Comment

                        • Laurent Bugnion

                          #42
                          Re: F# programming language

                          Hi,

                          Lucian Wischik wrote:
                          Laurent Bugnion <galasoft-lb@bluewin.chwr ote:
                          >One more question though: You mention that C# is more "engineery" . Is it
                          >your opinion (like I think after reading what you wrote) that C# is more
                          >targeted at software engineers (like me) and F# at scientists?
                          >
                          We're called software engineers but I don't think there's very much
                          engineering discipline in our work. We're expected to produce lots of
                          features, quickly, and track down lots of bugs, and we often don't
                          even have the time to sit back and calmly document how what we've done
                          works. F# seems good for this audience.
                          I am lucky enough to work for Siemens, where software engineers are
                          engineers ;-) We do a lot of architecture and design, for example.

                          Also, note that in Switzerland, you can only use the title software
                          engineer if you are really an engineer. In my case, I did an engineer
                          school in electricity and electronics before I made a postgrade study in
                          software. Non-engineers who followed the same postgrade are not allowed
                          to use the title software engineer.

                          Greetings,
                          Laurent
                          --
                          Laurent Bugnion, GalaSoft
                          Software engineering: http://www.galasoft-LB.ch
                          PhotoAlbum: http://www.galasoft-LB.ch/pictures
                          Support children in Calcutta: http://www.calcutta-espoir.ch

                          Comment

                          • Christopher Ireland

                            #43
                            Re: F# programming language

                            "Laurent Bugnion" <galasoft-lb@bluewin.chwr ote in message
                            news:eT%23H7gAE HHA.4668@TK2MSF TNGP03.phx.gbl. ..
                            Also, note that in Switzerland, you can only use the title software
                            engineer if you are really an engineer. In my case, I did an engineer
                            school in electricity and electronics before I made a postgrade study in
                            software. Non-engineers who followed the same postgrade are not allowed to
                            use the title software engineer.
                            No duck typing in Switzerland, then!

                            ;-)

                            Cheers!

                            Chris.


                            Comment

                            • Lebesgue

                              #44
                              Re: F# programming language

                              >Useful for math and logic, not so much for GUI stuff which really
                              >requires
                              >imperative programming.
                              >
                              I'm going to try to write some GUI programs and I'll see how F# compares.
                              Presumably C# is likely to come out on top when there is a big GUI and not
                              much under the hood?
                              Just a side note: One can use F# to write ASP.NET applications:

                              Project page: http://www.codeplex.com/fscodedom


                              Comment

                              • Jon Harrop

                                #45
                                Re: F# programming language

                                Christopher Ireland wrote:
                                P.S. it would be great if ray tracer compiled with the latest publicly
                                available version of F#!
                                A new version of F# has just come out that can compile my ray tracer! :-)

                                --
                                Dr Jon D Harrop, Flying Frog Consultancy
                                Objective CAML for Scientists
                                Business Das perfekte Beratungsgespräch: Tipps und Tricks Sabine Henschel4. Juli 2024 Business Mindset Coach: Ihr Schlüssel zu einem neuen Denken Sabine Henschel4. Juli 2024 Familie Kollegiale Beratung in der Pflege: Zusammen stark Sabine Henschel3. Juli 2024 Familie Was kostet eine Beratung beim Notar wegen Erbrecht: Ein Ratgeber Sabine Henschel2. Juli 2024 Business Was kostet eine

                                Comment

                                Working...