Shop OBEX P1 Docs P2 Docs Learn Events
F# or C# ? — Parallax Forums

F# or C# ?

RsadeikaRsadeika Posts: 3,837
edited 2011-05-19 21:31 in General Discussion
I just heard about F#, what the heck is it? I was told it is the MS version of FORTH, and is a .net language. Anybody use it, and would it help in understanding how to use the Propeller version? Did we ever have a thread about the FORTH language? I mean in depth discussion about it.

Thanks

Ray

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-19 07:01
    Here's a link on the language. As far as I can tell, it has nothing whatsoever to do with other "F" languages like Forth or Fortran, thank goodness.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-05-19 07:11
    Since we have C sharp and now F sharp, maybe someone should write C flat and F flat.
  • ercoerco Posts: 20,260
    edited 2011-05-19 08:36
    If you don't C-sharp, you'll B-flat... groan...!
  • jazzedjazzed Posts: 11,803
    edited 2011-05-19 08:59
    If you B sharp, you'll C :)
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-19 09:08
    C Flat, so we need to write a B# compiler then :) ? Or just BCPL#? Two languages that I have yet to learn.
  • Mike GMike G Posts: 2,702
    edited 2011-05-19 09:12
    Since we have C sharp and now F sharp, maybe someone should write C flat and F flat.

    That would be B and E.

    F# is designed for mathematics.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-19 09:14
    "Mike wrote:
    That would be B and E.
    Ah, much easier, those two languages already exist.
  • Martin_HMartin_H Posts: 4,051
    edited 2011-05-19 10:47
    F# is a functional programming language. That puts it in the family of languages which includes Erlang, Haskell and Scheme. Lisp and Logo also support functional programming, but are not strictly functional languages.
  • kwinnkwinn Posts: 8,697
    edited 2011-05-19 12:42
    This sounds like the Tower of Babel under construction. I wonder how many languages we really need.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-19 13:20
    I have a 1982 article (i think from DR-DOBBS) that gives a brief and incomplete list of high level programming languages available for the desktop computers of that time, it lists 114 HLLs available for desktop computers and claims to be 'far from complete'.
  • wjsteelewjsteele Posts: 697
    edited 2011-05-19 20:14
    F# is based on the .NET Framework and, as such, can use all the base class libraries as well as interact with other .NET based languages like C# and VB.NET. However, it's most powerful features allow it to easily scale to multi processor environments and use and consume data. Parallel I/O is also a strong point of it.

    Microsoft actually uses F# in a lot of back end systems where there is a need for strong functional work, for example, the ad system in Bing is written in F#. There is even a version of Go written in F# for the XBox 360 that shows the power of it.

    Bill
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-05-19 20:27
    wjsteele wrote:
    F# is based on the .NET Framework

    Maybe this is better stated as... the F# language is based on ML/OCaml, and has been adapted to the .Net framework.

    Basically, it's OCaml .Net.
  • wjsteelewjsteele Posts: 697
    edited 2011-05-19 21:03
    Kevin, actually, F# is as further away from OCaml than C# is to Java. In fact, F# contains a bunch of features that are not present in OCaml. Here's just a few of several things that are exclusive to F# that make it very powerful:

    •Units of measure - that allow you to type-check code dealing with numerical calculations
    •Meta-programming using quotations - (which makes it possible to use LINQ in F# and is also essential for promissing projects like the WebSharper platform)
    •Active patterns - for creating abstractions for functional data types (and generally very useful feature for more complicated pattern matching applications)
    •Computation expressions - which is a langauge feature behing asynchronous workflows (a library for asynchronous I/O/web service/GUI programming)
    •.NET compatible object-system - that makes it possible to fully interoperate with the .NET platform (OCaml also has a support for objects but different - there are of course some benefits in both of the systems).
    •Overloaded operators - OCaml doesn't have overloaded operators - as an example, in F# you can use + for all numeric types as well as your types that support it.

    I think that if you stuck to very basic OCaml code, you could get it to compile in F#, but the real power is in it's ability to do the advanced math and multiprocessor i/o, which isn't a feature of OCaml. (In fact, there really is no benefit to using it other than these features in my opinion.)

    Bill
  • Peter KG6LSEPeter KG6LSE Posts: 1,383
    edited 2011-05-19 21:31
    as bad as this sounds My Music teacher in college was named David Sharp or D# for short ............ irony at its best !

    peter ..
Sign In or Register to comment.