Linked by Thom Holwerda on Tue 23rd Oct 2007 20:59 UTC
General Development Are the C programming language and its object-oriented offspring - C++, C#, Objective-C - still well-suited to the requirements of multithreaded, network-oriented computing environments today? That's the question on the minds of engineers at Microsoft Research, whose latest programming language is today being officially moved off the back burner. The F# language has received the company's official blessing.
Order by: Score:
This put a smile in my face
by meianoite (3.76) on Tue 23rd Oct 2007 21:18 UTC
meianoite
Member since:
2006-04-05
Fans: 10

Am I the only one finding it amusing that they qualified a language derived from OCaml as being "experimental"? ;)

I mean, by OCaml's standards, object-orientation under a C-derived language could be called "experimental". But I digress ;)


Edit: a little clarification on what I meant in the first sentence

Edited 2007-10-23 21:19

RE: This put a smile in my face
by flanque (3.48) on Tue 23rd Oct 2007 22:52 UTC in reply to "This put a smile in my face"
flanque Member since:
2005-12-15
Fans: 3

I guess that would depend on why they call it experimental.

Good for multicore
by AndrewZ (1.72) on Tue 23rd Oct 2007 21:20 UTC
AndrewZ
Member since:
2005-11-15
Fans: 0

Not emphasized in the article, but functional languages are an excellent vehicle for writing multi-core, multi-thread, or SMP code. Functional languages don't have nearly as many variables, so there's less to synchronize.

RE: Good for multicore
by tyrione (1.04) on Wed 24th Oct 2007 00:49 UTC in reply to "Good for multicore"
tyrione Member since:
2005-11-21
Fans: 2

Which makes Apple's use of ObjC as a superset of C fantastic for leveraging all of C combined with ObjC's object messaging model we all know with the ever expanding collection of frameworks under the Cocoa moniker.

F# sounds interesting...
by Almafeta (3.44) on Tue 23rd Oct 2007 21:25 UTC
Almafeta
Member since:
2007-02-22
Fans: 5

But the article makes me ask two questions right away:

1) How suited would this be to OS programming? It seems like programming in F# would me much closer to machine language and the 'on-silicon' processes than most normal programming languages, C included.

2) Is this in any way related to the "C# variant" that Microsoft Research has used for programming Singularity?

It also reminds me, just a little bit, of when I programmed MUF (Multiuser Forth). God, I hated that language... ^^;

RE: F# sounds interesting...
by Ventajou (3.16) on Wed 24th Oct 2007 03:11 UTC in reply to "F# sounds interesting..."
Ventajou Member since:
2006-10-31
Fans: 0

It's a .Net language so you're really not close to machine language...

RE[2]: F# sounds interesting...
by Almafeta (3.44) on Wed 24th Oct 2007 04:59 UTC in reply to "RE: F# sounds interesting..."
Almafeta Member since:
2007-02-22
Fans: 5

I know it's .NET, but I meant in structure; functional languages are closer to how many chips work, if I understand functional languages right.

(Then again, there are apparently some chips that can run MSIL directly, which further complicates the issue.)

RE[3]: F# sounds interesting...
by renox (2.72) on Wed 24th Oct 2007 11:56 UTC in reply to "RE[2]: F# sounds interesting..."
renox Member since:
2005-07-06
Fans: 1

>functional languages are closer to how many chips work, if I understand functional languages right.

Well, I'd say that your understanding is wrong: many chips are stateful: they contain registers, memory..

And even pure combinatorial circuits are not really 'functional': their state depends on the time..

RE[3]: F# sounds interesting...
by TemporalBeing (1.68) on Wed 24th Oct 2007 15:27 UTC in reply to "RE[2]: F# sounds interesting..."
TemporalBeing Member since:
2007-08-22
Fans: 0

functional languages are closer to how many chips work, if I understand functional languages right.

Well, then you certainly understand it wrong.

The difference is more or less how programs are organized. And I personally break languages into the following categories:

1. Chaos - e.g. assembly, binary, etc. where you are not required to have any real structure.
2. Procedural/Functional/Structured - organized by the processing of functions and data structures
3. Object Oriented - organized by processing objects through their inherent interfaces (methods).

You could probably break Procedural/Functional/Structured into two if you really wanted to - Functional/Procedural and Structured, where the difference is between being centered around functions and being centered around data structures. (Whether you use "Functional" or "Procedural" is dependent upon the language family you use - e.g. C family or ALGOL/Modula family.)

RE[4]: F# sounds interesting...
by rayiner (3.76) on Wed 24th Oct 2007 16:57 UTC in reply to "RE[3]: F# sounds interesting..."
rayiner Member since:
2005-07-06
Fans: 27

Functional and procedural are completely different. Procedural programs depend heavily on mutable state. Functional program may have no mutable state at all.

RE[5]: F# sounds interesting...
by TemporalBeing (1.68) on Wed 24th Oct 2007 17:12 UTC in reply to "RE[3]: F# sounds interesting..."
TemporalBeing Member since:
2007-08-22
Fans: 0

Functional and procedural are completely different. Procedural programs depend heavily on mutable state. Functional program may have no mutable state at all.

I guess you could make that argument too. It's still procedure (function) driven though. So it's kind of a half-state between Functional and Structured from that perspective.

RE: F# sounds interesting...
by netpython (2.44) on Wed 24th Oct 2007 08:57 UTC in reply to "F# sounds interesting..."
netpython Member since:
2005-07-06
Fans: 6

It seems like programming in F# would me much closer to machine language and the 'on-silicon' processes than most normal programming languages, C included.

On the contrary #F is right farther away as high level language.

RE: F# sounds interesting...
by xeoron (2.2) on Wed 24th Oct 2007 22:30 UTC in reply to "F# sounds interesting..."
xeoron Member since:
2007-03-25
Fans: 0

There is more information on F# at Ars Technica [ http://arstechnica.com/news.ars/post/20071023-microsoft-to-push-fun... }

Nice One Microsoft Research
by segedunum (3.08) on Tue 23rd Oct 2007 21:27 UTC
segedunum
Member since:
2005-07-06
Fans: 20

What an absolutely fantastic way to reproduce Haskell, and give us something truly new and innovative.

I'll have to dig out my old university notes on paradigms and functional languages. Thankfully, one lecturer at university actually wanted to teach and educate us about something different and potentially very useful, and expand our minds. Did Standard ML there too, but this guy liked Haskell. It's a sad indictment of computing as a profession today that most people won't know what a functional language is.

But, if it brings functional programming to wider audience then I won't complain. There are many useful applications of functional languages.

Edited 2007-10-23 21:29

RE: Nice One Microsoft Research
by MollyC (3.36) on Tue 23rd Oct 2007 22:16 UTC in reply to "Nice One Microsoft Research"
MollyC Member since:
2006-07-04
Fans: 36

F# isn't a reproduced Haskell, it's a reproduces OCaml. It began as a .NET'ized OCaml, and has been developed from that point on.

I've been playing with F# for over a year, even buying the "Foundations of F#" book (though the upcoming "Expert F#" book might be considered the more "official" F# book, as one of its authors is F# lead Don Syme (both are available at amazon.com). Very cool language.
Here's a couple relevant links:
http://research.microsoft.com/fsharp/fsharp.aspx
http://blogs.msdn.com/dsyme/default.aspx
http://www.fsharp.net/
http://fsharpnews.blogspot.com/
http://cs.hubfs.net/blogs/default.aspx

Microsoft has been using it internally (XBox Live makes use of it) and others have been using it, but it's remained a "research" language within Microsoft Research, so there hasn't been "official" support for it. I'm glad to see it being productized. ;) I've read the various Microsoft blogs on this, and unfortunately F# won't be included in VS 2008 since that's too close to shipping (though, apparently there was some thought of doing just that). It hasn't been decided yet how the productized version of F# will be released.

You mentioned Standard ML, well at the time that F# was started (based on OCaml), SML.NET was also started (based on SML). But its development stagnated, and isn't anywhere near the maturity of F#.

As for Haskell, maybe Microsoft will prodcutize that someday. Microsoft Research somehow gained maintenance control of the Glaskow Haskell Compiler a few years ago, and Haskell guru Simon Peyton Jones works at MSR now.

Bad name
by xultz (1.28) on Tue 23rd Oct 2007 21:59 UTC
xultz
Member since:
2006-05-09
Fans: 0

Bad name. Everybody will say, sooner or later, what the F# is that!?

RE: Bad name
by umccullough (3.44) on Tue 23rd Oct 2007 22:05 UTC in reply to "Bad name"
umccullough Member since:
2006-01-26
Fans: 24

My first thought was: Great, next we'll see the F#@$ extended specification...

Surely...
by yermalawl (1) on Tue 23rd Oct 2007 22:09 UTC
yermalawl
Member since:
2007-10-23
Fans: 0

MS should patent this new discovery before anyone else attempts to copy their 'functional' language.

Matlab
by hussam (1.84) on Tue 23rd Oct 2007 22:35 UTC
hussam
Member since:
2006-08-17
Fans: 0

"the foundations for an interactive data visualization environment like MATLAB,"

This sounds nice.

Why?
by sigzero (2.12) on Tue 23rd Oct 2007 23:43 UTC
sigzero
Member since:
2006-01-03
Fans: 0

F# = Microsoft Only

OCaml = x-platform

RE: Why?
by MollyC (3.36) on Wed 24th Oct 2007 00:26 UTC in reply to "Why?"
MollyC Member since:
2006-07-04
Fans: 36

All (well most) languages have their place.
You mentioned OCaml's advantage over F#.
F#'s advantage over OCaml is that F# code can seamlessly operate with that of any .NET language, as well as access the .NET Framework libraries (e.g. BCL, WinForms, WPF, DirectX, LINQ), and non-Framework .NET libraries such as XNA and the numerous 3rd-party .NET libs. One could also program SilverLight 1.1 applets with F# (and SilverLight is x-platform (Windows and Mac, Linux (via Moonlight); IE, Safari, and Firefox), so SilverLight F# code is x-platform as well).

F#'s other advantage is that once it's productized, it'll have major financial backing from a large, high-profile, non-niche company. Including F# in a future Visual Studio or a A "Visual F# Express", for example, could be huge.

Edited 2007-10-24 00:32

RE[2]: Why?
by luicpend (1.5) on Wed 24th Oct 2007 00:42 UTC in reply to "RE: Why?"
luicpend Member since:
2007-09-24
Fans: 0

Not very sure about becoming a professional product.

It belongs to the Research section, at least for now, so it only has some acceptance from Microsoft, specially from the economical backup point of view.

Look at IronPython, yes, is fine and nice and etc, and backed up by Microsoft, but where is the industrial support or follow up?

RE[3]: Why?
by Almafeta (3.44) on Wed 24th Oct 2007 00:48 UTC in reply to "RE[2]: Why?"
Almafeta Member since:
2007-02-22
Fans: 5

IIRC, some scripting in Vista is done in IronPython.

RE[3]: Why?
by meianoite (3.76) on Wed 24th Oct 2007 00:55 UTC in reply to "RE[2]: Why?"
meianoite Member since:
2006-04-05
Fans: 10

Look at IronPython, yes, is fine and nice and etc, and backed up by Microsoft, but where is the industrial support or follow up?


This "industry" you're talking about runs C# and VB.NET. They don't know Python. With IronPython Microsoft tried to cater to the comp sci fresh-out-of-college people. IOW, it was a way to leverage the experience those college students had with scripting projects, while attracting them to the MS Mothership.

My impression is that IronPython is surrounded by a *load* of hype, if only for the fact that it meant Microsoft endorsing the poster child of Open Source programming languages, but IMO it's just a novelty. Then again, I'm biased towards Ruby (actually, anything that leans towards Lisp (or Prolog) and Smalltalk is bound to attract me), so I'm not the most trustworthy source of Python critique. Take my words with grains of 50/50 NaCl/KCl.


Edit: on a second thought, F# is probably targeting the academia as well. When I had AI classes, for instance, the computer was running Windows, but every time my professor had show us and run a piece of Prolog code, he'd SSH his Linux box upstairs and run it on GNU Prolog. I can easily imagine MS trying to recover some mindshare from the AI/functional programming academic community. Shared Source, IronPython, sponsoring teaching .NET and XNA in Games Design and Programming classes, and now F#... That sounds like a plan to me.

Edited 2007-10-24 01:06

RE[3]: Why?
by MollyC (3.36) on Wed 24th Oct 2007 01:05 UTC in reply to "RE[2]: Why?"
MollyC Member since:
2006-07-04
Fans: 36

Silverlight 1.1 has the ability not only to run compiled .NET code (produced by any .NET language), but also run textual source code of IronPython, IronRuby, JScript, and VBx. There's your IronPython "support and followup".

That said, IronPython isn't "productized" like C# and VB are. F# will be productized like C# and VB, so it'll get support akin to those languages rather than the Iron languages, I'm guessing (hoping).

RE[4]: Why?
by luicpend (1.5) on Wed 24th Oct 2007 01:12 UTC in reply to "RE[3]: Why?"
luicpend Member since:
2007-09-24
Fans: 0

Wrong, or missleading, at least.

IronPython, or IronRuby should have their own support and traceability. Mono, or Silverlight can be able to process IronPython code, just because of the produced intermediated code, but IronPython is not the target there!

Is the same as implying than JRuby or Jython are successfull because any JVM can execute them.

Besides, which is the current real support for Mono?

RE: Why?
by Almafeta (3.44) on Wed 24th Oct 2007 00:49 UTC in reply to "Why?"
Almafeta Member since:
2007-02-22
Fans: 5

I think both of those could be easily replaced with "language of choice = cross-platform."

The language is not the implementation.

RE: Why?
by saxiyn (3.04) on Wed 24th Oct 2007 00:51 UTC in reply to "Why?"
saxiyn Member since:
2005-07-08
Fans: 0

F# runs on Mono. Check your facts.

Yol! (Yet Other Language)
by luicpend (1.5) on Wed 24th Oct 2007 00:25 UTC
luicpend
Member since:
2007-09-24
Fans: 0

I guess this helps keeping up with the taks to learn a new language every year. Studying a similar language will always be easier than trying a radically different concept!

More seriously, it is really great to see a new language, or an evolution of an existing one. No language is perfect, or the continuous evolution of computing renders existing languages less suitable.

C#, MS or not, made a better Java, learning of the mistakes of the Sun language; even small things as requiring specific syntax to define overriden methods helps catching potential problems, which is definitely an improvement. And this happen with (most) new (or evolved) languages.

I am a Python programmer (in heart, I make a living out of C++), and it is obvious to me than deep changes will be required to keep up with multicore programming... or creating a new language for that purpose, hopefully with the simplicity of Python.

Now, whether functional programming is the path to follow, I keep my doubts. I enjoy a lot writting Lisp code, and learning functional programmming probably made a better overall programmer out of me, but I definitely favour traditional declarative languages (did I say I make a living out of C++?)

What really calls my attention is this possibility to build up programs with a good mix of declarative programming (say C#) and functional programming. And scripting, do not forget IronPython!

In any case, this is somehow also achievable on Java. As far as I know, it exists an Ocaml-Java project, and the Scala language is considered functional as well.

Good times, anyway, at least if you enjoy languages for the sake of it.

Nice misleading opening caption
by tyrione (1.04) on Wed 24th Oct 2007 00:50 UTC
tyrione
Member since:
2005-11-21
Fans: 2

What the hell does:


Are the C programming language and its object-oriented offspring - C++, C#, Objective-C - still well-suited to the requirements of multithreaded, network-oriented computing environments today? That's the question on the minds of engineers at Microsoft Research, whose latest programming language is today being officially moved off the back burner. The F# language has received the company's official blessing.


have to do with the article?

It's a circle jerk for their own future language technolgy, F#.

Oh... It's the Harropian times
by malkia (1.32) on Wed 24th Oct 2007 00:59 UTC
malkia
Member since:
2005-07-17
Fans: 0

Flying frogs and all that.

http://www.ffconsultancy.com/

But pretty cool page if you want to get hooked on F#, Ocaml, etc.

I've just installed it, and can't compile the Life
by malkia (1.32) on Wed 24th Oct 2007 01:18 UTC
malkia
Member since:
2005-07-17
Fans: 0

I've just installed it, and can't compile the Life example.

It requires some MailboxProcessor class, but I could not find any info for it on the net.

Musical Notes?
by Sodapop (1.84) on Wed 24th Oct 2007 01:48 UTC
Sodapop
Member since:
2005-07-06
Fans: 0

Is there some reason why these languages are being names after musical notes?. As a guitar player, all I see are notes.

E F F# G G# A A# B C C# D D#. Coincidence maybe seeing as there are no +'s. Just a thought.

RE: Musical Notes?
by tyrione (1.04) on Wed 24th Oct 2007 04:37 UTC in reply to "Musical Notes?"
tyrione Member since:
2005-11-21
Fans: 2

Good questions considering sharps on the piano are the least used and flats are more commonly used.

RE[2]: Musical Notes?
by google_ninja (2.48) on Wed 24th Oct 2007 14:11 UTC in reply to "RE: Musical Notes?"
google_ninja Member since:
2006-02-05
Fans: 13

What would be really funny is E#, or B#

RE[3]: Musical Notes?
by losethos2 (-1.32) on Wed 24th Oct 2007 17:08 UTC in reply to "RE[2]: Musical Notes?"
losethos2 Member since:
2007-10-22
Fans: 0

You seem to be interested in music. My operating system doesn't support standard music files types, but it plays songs if you enter notation. One voice, though. Here's a nice song.

"e"=eighth note
"et"=eighthnote triplet
"q"=quarter note


void EndTsk()
{
Sound(0);
Exit;
}

void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
while (TRUE) {
Play("eDEqFqFetEEFqDeCDeDEetCGF");
Play("eDEqFqFetEEFqDeCDeDEetCGF");
Play("eDCqDqEeAAetEEFetEDGetBDCqF");
Play("eDCqDqEeAAetEEFetEDGetBDCqF");
}
}

Song;

I am not sure I get it ...
by kristoph (2.81) on Wed 24th Oct 2007 02:09 UTC
kristoph
Member since:
2006-01-01
Fans: 0

I can do this in Ruby (assuming there were similar classes) by doing the following, which looks much cleaner and is less verbose (am I missing something about this F# language) ...

menu_open = MenuItem.new( "&Open...", Shortcut.CtrlO ) do

d = OpenFileDialog.new() do | d |

d.initial_directory = "c:\"
d.filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
d.filter_index = 2
d.restore_directory = true

if d.show_dialog() = DialogResult.OK

d.open_file() do | file |

puts "The first line of the file is: %s!n" % file.readline ()

end

end

RE: I am not sure I get it ...
by jayson.knight (3.68) on Wed 24th Oct 2007 02:24 UTC in reply to "I am not sure I get it ..."
jayson.knight Member since:
2005-07-06
Fans: 7

You're missing the point. It's not about syntax...you can do everything you outlined in any language. The point is that F# is a purely functional language...I'd highly recommend reading up on what makes a functional language...well, functional.

F# interview
by WorknMan (3.64) on Wed 24th Oct 2007 04:10 UTC
WorknMan
Member since:
2005-11-13
Fans: 3

If anyone is interested, here's an interview with a guy who wrote a book on F#:

http://www.hanselminutes.com/default.aspx?showID=94

I just got started with C#/.NET, so I don't even pretend to understand most of it, but thought somebody might find it useful ;)

BTW, there is a F language
by pica (1.25) on Wed 24th Oct 2007 07:15 UTC
pica
Member since:
2005-07-10
Fans: 0
v Not to mention
by leplatdujour (1.86) on Wed 24th Oct 2007 08:02 UTC
F# is nice, but article writer is clueless
by tuttle (2.8) on Wed 24th Oct 2007 08:29 UTC
tuttle
Member since:
2006-03-01
Fans: 2

F# is an interesting language, but the article writer has no clue at all about functional programming.

First of all, he makes it sound as if functional programming is "a step back in language evolution". This is of course not the case. OCaml makes C based OO look like a toy.

Then he gives an ugly, unindented block of code as an example. How is anybody supposed to see the beauty of functional languages when looking at this code.

And then he mentions multithreading but gets sidetracked to some boring webservices application. The real advantage of functional languages wrt. multithreading is that you can actually use a quad or 8 core machine without having to resort to low level threading primitives like locking.

That is a _huge_ advantage.

ECMAScript
by Treza (1.76) on Wed 24th Oct 2007 09:17 UTC
Treza
Member since:
2006-01-11
Fans: 0

About another functional programming language, a revised summary of ECMAScript 4 is available since yesterday :

http://www.ecmascript.org/es4/spec/overview.pdf

(Well, Javascript is a FL disguised with C syntax :-)

(sorry for bad English)

functional programming
by donn (1.5) on Wed 24th Oct 2007 18:17 UTC
donn
Member since:
2006-11-28
Fans: 0

F# is not pure functional, right? just as Objective CAML is not. It does support mutable state, it has "for" loops, you can modify a string in place (which you can't even do in Python.) The folks who would write C as if it were FORTRAN, can write F# as if it were C. It's really not in the same league with Haskell.

Does it have the "Objective" part? I thought Objective CAML's OOP model was kind of interesting.

I see a couple of uses of "declarative" above in a sense that I think may be confusing. Declarative programming expresses a computation as a sort of formula, as opposed to a procedure - which is exactly what functional programming is about. C# et al., not so much.

RE: functional programming
by MollyC (3.36) on Wed 24th Oct 2007 23:22 UTC in reply to "functional programming"
MollyC Member since:
2006-07-04
Fans: 36

Yes, many here have gotten the impression that F# is strictly a "pure" functional language. It can be used that way, but like OCaml, it supports functional, imperative, and object oriented programming.

Besides that, even "purely functional" F# programs that make use of objects provided by other .NET assemblies inherit the non-functional nature of those assemblies (depending on what methods the F# program calls).

Java side
by John Nilsson (2.6) on Wed 24th Oct 2007 19:18 UTC
John Nilsson
Member since:
2005-07-06
Fans: 0

For those of you who want something on the Java side take a peek at Scala[1]

Not purley functional like F# though, but instead a mix of OOP and FP

[1] http://www.scala-lang.org/