Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

An Interview With F# Creator Don Syme

kdawson posted more than 4 years ago | from the same-as-g-flat-if-you're-tempered dept.

Programming 267

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

cancel ×

267 comments

Sorry! There are no comments related to the filter you selected.

There going to run out of musical notes soon... (4, Funny)

Wingman 5 (551897) | more than 4 years ago | (#31050946)

Will D flat be the same language as c#?

Re:There going to run out of musical notes soon... (5, Funny)

Anonymous Coward | more than 4 years ago | (#31050978)

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

Re:There going to run out of musical notes soon... (1)

yo303 (558777) | more than 4 years ago | (#31051298)

It's funny 'cause it's true.

HAHA Crappy open sores crashes again (-1, Troll)

Anonymous Coward | more than 4 years ago | (#31051526)

http://flashcrash.dempsky.org/ [dempsky.org]

Firefox crashes.. IE8, Chrome, Opera, dont. LOL..

Firefox bloated piece of shit. Yet again OSS community has made another turd..

Re:There going to run out of musical notes soon... (1, Informative)

Anonymous Coward | more than 4 years ago | (#31051318)

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

Re:There going to run out of musical notes soon... (1)

JamesP (688957) | more than 4 years ago | (#31051598)

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

Re:There going to run out of musical notes soon... (0)

Anonymous Coward | more than 4 years ago | (#31051708)

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

Re:There going to run out of musical notes soon... (0)

Anonymous Coward | more than 4 years ago | (#31051718)

Not true, go educate youself.

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

Re:There going to run out of musical notes soon... (3, Informative)

bipbop (1144919) | more than 4 years ago | (#31051006)

Now that would be unjust.

Anyone else think is was a .NET Fortran? (1)

IvyKing (732111) | more than 4 years ago | (#31050952)

Being an old fuddy-duddy, my first thought that Microsoft was doing a dot NET version of Fortran, but...

Obvious retort is why?

Re:Anyone else think is was a .NET Fortran? (1, Interesting)

serps (517783) | more than 4 years ago | (#31050998)

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. [wikipedia.org] ".

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

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.

Re:Anyone else think is was a .NET Fortran? (1)

Dunderflute (1001355) | more than 4 years ago | (#31051034)

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

Re:Anyone else think is was a .NET Fortran? (0)

Anonymous Coward | more than 4 years ago | (#31051060)

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.

Re:Anyone else think is was a .NET Fortran? (2, Insightful)

hairyfeet (841228) | more than 4 years ago | (#31051142)

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.

Re:Anyone else think is was a .NET Fortran? (1)

jonwil (467024) | more than 4 years ago | (#31051968)

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)

Re:Anyone else think is was a .NET Fortran? (4, Informative)

j1m+5n0w (749199) | more than 4 years ago | (#31051200)

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.

Re:Anyone else think is was a .NET Fortran? (1)

rahuja (751005) | more than 4 years ago | (#31051020)

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

It is, kind of (2, Interesting)

_merlin (160982) | more than 4 years ago | (#31051176)

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.

Re:Anyone else think is was a .NET Fortran? (3, Informative)

shutdown -p now (807394) | more than 4 years ago | (#31051234)

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

Re:Anyone else think is was a .NET Fortran? (4, Informative)

shutdown -p now (807394) | more than 4 years ago | (#31051238)

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

Re:Anyone else think is was a .NET Fortran? (1)

Leynos (172919) | more than 4 years ago | (#31051702)

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

Re:Anyone else think is was a .NET Fortran? (1)

da_matta (854422) | more than 4 years ago | (#31051870)

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

Re:Anyone else think is was a .NET Fortran? (1)

ByteSlicer (735276) | more than 4 years ago | (#31051910)

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.

never programmed before??? (1, Troll)

madddddddddd (1710534) | more than 4 years ago | (#31050962)

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.

Re:never programmed before??? (2, Interesting)

Mr. Freeman (933986) | more than 4 years ago | (#31051120)

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.

Re:never programmed before??? (2, Insightful)

shutdown -p now (807394) | more than 4 years ago | (#31051252)

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

Re:never programmed before??? (4, Informative)

EsbenMoseHansen (731150) | more than 4 years ago | (#31051388)

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 [wikipedia.org] of the famous factorial program and compare to the Haskell [wikipedia.org] version(s). I think anyone would be hard-pressed to prefer the F# version, but who knows?

Re:never programmed before??? (3, Insightful)

shutdown -p now (807394) | more than 4 years ago | (#31051432)

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

Re:never programmed before??? (3, Informative)

EsbenMoseHansen (731150) | more than 4 years ago | (#31051684)

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

Re:never programmed before??? (1)

madddddddddd (1710534) | more than 4 years ago | (#31051650)

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.

Re:never programmed before??? (1)

madddddddddd (1710534) | more than 4 years ago | (#31051766)

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

F is for Fun? (4, Funny)

gad_zuki! (70830) | more than 4 years ago | (#31050964)

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

Re:F is for Fun? (1, Funny)

Anonymous Coward | more than 4 years ago | (#31050972)

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

dom

Re:F is for Fun? (1)

giuseppemag (1100721) | more than 4 years ago | (#31051150)

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

What might f otherwise be for? (1)

jonaskoelker (922170) | more than 4 years ago | (#31051246)

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

fgrep??

functional programming is for autists (-1, Troll)

Anonymous Coward | more than 4 years ago | (#31050976)

insane in the membrane :(

Checkbox marketing (4, Insightful)

Anonymous Coward | more than 4 years ago | (#31050984)

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.

Re:Checkbox marketing (0)

Anonymous Coward | more than 4 years ago | (#31051082)

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

Re:Checkbox marketing (3, Interesting)

shutdown -p now (807394) | more than 4 years ago | (#31051182)

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 [ffconsultancy.com] 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).

Re:Checkbox marketing (0)

Anonymous Coward | more than 4 years ago | (#31051342)

Mono gives your OS Mononucleosis

Re:Checkbox marketing (2, Interesting)

Ethanol-fueled (1125189) | more than 4 years ago | (#31051086)

You forgot "paradigm" [wikipedia.org] . 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.

Re:Checkbox marketing (3, Insightful)

ClosedSource (238333) | more than 4 years ago | (#31051362)

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?

Re:Checkbox marketing (2, Funny)

mangu (126918) | more than 4 years ago | (#31051908)

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

Anecdotes [computerworld.com] 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.

Re:Checkbox marketing (0, Redundant)

Bucc5062 (856482) | more than 4 years ago | (#31052032)

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.

Re:Checkbox marketing (3, Informative)

shutdown -p now (807394) | more than 4 years ago | (#31051168)

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

Marketing? What the? (3, Informative)

Puff_Of_Hot_Air (995689) | more than 4 years ago | (#31051576)

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

Re:Checkbox marketing (1)

Dachannien (617929) | more than 4 years ago | (#31051894)

Yes, but does it shift paradigms outside the box?

Specific question? Vague answer! (0)

Anonymous Coward | more than 4 years ago | (#31050992)

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

Re:Specific question? Vague answer! (0)

Anonymous Coward | more than 4 years ago | (#31051102)

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

.NET Framework (5, Interesting)

Yuioup (452151) | more than 4 years ago | (#31051062)

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.

Why not Groovy? (2)

SuperKendall (25149) | more than 4 years ago | (#31051110)

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

Re:Why not Groovy? (2, Informative)

shutdown -p now (807394) | more than 4 years ago | (#31051210)

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 [wikipedia.org] 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.

Re:Why not Groovy? (2, Informative)

Yuioup (452151) | more than 4 years ago | (#31051698)

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

 

Re:.NET Framework (0)

Anonymous Coward | more than 4 years ago | (#31051256)

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

Re:.NET Framework (4, Informative)

Paradigma11 (645246) | more than 4 years ago | (#31051514)

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

Re:.NET Framework (5, Funny)

daveime (1253762) | more than 4 years ago | (#31051928)

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

Re:.NET Framework (1)

JamesP (688957) | more than 4 years ago | (#31051602)

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)

Re:.NET Framework (1)

SparafucileMan (544171) | more than 4 years ago | (#31051670)

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.

Re:.NET Framework (2)

Yuioup (452151) | more than 4 years ago | (#31051772)

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.

Re:.NET Framework (2, Interesting)

fredrik70 (161208) | more than 4 years ago | (#31051758)

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.

Re:.NET Framework (1)

maxume (22995) | more than 4 years ago | (#31052008)

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)

The optimal blend... (2, Interesting)

mandelbr0t (1015855) | more than 4 years ago | (#31051076)

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

Re:The optimal blend... (1)

Nigel Stepp (446) | more than 4 years ago | (#31051170)

*head explodes*

Re:The optimal blend... (3, Interesting)

shutdown -p now (807394) | more than 4 years ago | (#31051196)

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.

Re:The optimal blend... (2, Interesting)

MichaelSmith (789609) | more than 4 years ago | (#31051308)

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.

Re:The optimal blend... (2, Insightful)

shutdown -p now (807394) | more than 4 years ago | (#31051360)

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 [haskell.org] . 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.

Syntax parser. (2, Funny)

Ranzear (1082021) | more than 4 years ago | (#31051078)

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

Re:Syntax parser. (2, Funny)

shutdown -p now (807394) | more than 4 years ago | (#31051242)

No, it's called Visual Studio [msdn.com] , actually.

Hmmm.....

What's wrong with C and Python? (0)

Anonymous Coward | more than 4 years ago | (#31051088)

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.

Re:What's wrong with C and Python? (1)

shutdown -p now (807394) | more than 4 years ago | (#31051218)

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.

Re:What's wrong with C and Python? (1)

loufoque (1400831) | more than 4 years ago | (#31051904)

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

reliability (1)

j1m+5n0w (749199) | more than 4 years ago | (#31051274)

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.

Re:reliability (0)

Anonymous Coward | more than 4 years ago | (#31051376)

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.

F is for FUCK Micro$oft! (-1, Troll)

Anonymous Coward | more than 4 years ago | (#31051114)

http://www.msversus.org/ [msversus.org]

F# is awesome (1, Insightful)

Anonymous Coward | more than 4 years ago | (#31051122)

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.

F# for Scientists?! (0)

Anonymous Coward | more than 4 years ago | (#31051208)

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?

Re:F# for Scientists?! (1)

shutdown -p now (807394) | more than 4 years ago | (#31051240)

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.

FParsec (3, Insightful)

shutdown -p now (807394) | more than 4 years ago | (#31051226)

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

Re:FParsec (1)

loufoque (1400831) | more than 4 years ago | (#31051922)

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

Not even going to RTFA (1, Insightful)

Agamous Child (538344) | more than 4 years ago | (#31051250)

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?

Re:Not even going to RTFA (3, Informative)

shutdown -p now (807394) | more than 4 years ago | (#31051304)

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 [ecma-international.org] is the C# language specification, if you ever want to write your own C#compiler. Here [ecma-international.org] 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 [embarcadero.com] , 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?

Re:Not even going to RTFA (1)

0ld_d0g (923931) | more than 4 years ago | (#31051350)

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.

C++ original? (0)

Anonymous Coward | more than 4 years ago | (#31051292)

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.

Re:C++ original? (2, Interesting)

shutdown -p now (807394) | more than 4 years ago | (#31051324)

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.

Looks interesting as replacement for Python (2, Interesting)

otter42 (190544) | more than 4 years ago | (#31051356)

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.

Re:Looks interesting as replacement for Python (2, Interesting)

shutdown -p now (807394) | more than 4 years ago | (#31051384)

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 [microsoft.com] .

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.

Re:Looks interesting as replacement for Python (1)

otter42 (190544) | more than 4 years ago | (#31051596)

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.

Re:Looks interesting as replacement for Python (1)

k33l0r (808028) | more than 4 years ago | (#31051586)

How about you give Ruby [ruby-lang.org] a try?

Re:Looks interesting as replacement for Python (1)

monoi (811392) | more than 4 years ago | (#31051722)

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.

Re:Looks interesting as replacement for Python (1)

chico_the_chihuahua (925601) | more than 4 years ago | (#31051760)

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

Re:Looks interesting as replacement for Python (4, Interesting)

selven (1556643) | more than 4 years ago | (#31051780)

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.

Re:Looks interesting as replacement for Python (2, Interesting)

chico_the_chihuahua (925601) | more than 4 years ago | (#31051874)

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.

Re:Looks interesting as replacement for Python (1, Informative)

Anonymous Coward | more than 4 years ago | (#31051952)

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.

Re:Looks interesting as replacement for Python (0)

Anonymous Coward | more than 4 years ago | (#31051916)

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.

Helloworld (1)

petronije (1650685) | more than 4 years ago | (#31051610)

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 [blogspot.com] )

Cheers

Re:Helloworld (0)

Anonymous Coward | more than 4 years ago | (#31051644)

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

Two great tastes that taste good together? (1)

argent (18001) | more than 4 years ago | (#31051648)

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

It's not Microsoft RESEARCH's offering... (2, Interesting)

El Cabri (13930) | more than 4 years ago | (#31051656)

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

a fully productized and supported language (1, Insightful)

Anonymous Coward | more than 4 years ago | (#31051924)

Don't you mean - yet more Vendor lock-in [wikipedia.org] ..

Time to change (3, Funny)

thetsguy (1211146) | more than 4 years ago | (#31051934)

WTF#
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>