Inside Microsoft's New F# Language
robyn217 writes "There's a new language being formed in the bowels of Microsoft. Recently I got word that the language F# (pronounced F Sharp) is nearing workable stages at Microsoft Research. So, I went in for a look-see. What I found was an interesting blend of imperative (Java, C#) and functional languages(it's ML-based, too!). It looks pretty enticing to me from a computer science perspective, but I'm not sure it would fly in the professional market. I can see the ease of development that a language loosely based on ML would bring, but I can't see coders switching over in droves since it's a tough learning curve." Our previous story on F#.
F#ing Visual C++
F#ing VB.
F#ing Win32 API
It's OCaml for the .NET CLR. Not a new language. Nothing to see here. Move along.
"nearing workable stages at Microsoft Research"
:)
What a softball on a Slashdot story. I bet
21 joke made with reference to this phrase
Let's watch and see
---"What did I say that sounded like 'Tell me about your day?'"---
F-pound?
F-sharp?
F-UD?
Sheesh. Don't we have enough languages already? I thought C# was the absolute savior of the MS-centric tech world.
Just learn how to program in one language before you hit another one.
This space for rent.
I knew that someday Fortran will make its comeback and becomes the all mighty programming language !!!
#include "coucou.h"
I usually use an F#-word or two when dealing with one of Microsoft's programming languages. This is great for marketing "See, everyone's shouting praises of F(sharp)!".
Sometimes I doubt your commitment to Sparkle Motion.
A microsoft rep met with us a couple of weeks ago pushing .NET, win2k3, the whole enchilada. He mentioned they have MANY of these languages in development and are due to be released in the next year or so. They will still be pushing C# for mainstream development. The other languages will focus on niches where a modern OO language would be cumbersome.
;)
He wouldn't confirm whether they would have the X# naming convention
Heh
In the UK we call that square thingy a hash
Do you think C hash has done well here :-P
Will F hash do any better?
(Or does "making a hash of it" get lost in the translation?)
Anyone quoted by a reporter knows how little they understand
Don't believe what you read is the truth.
When developing for windoes "Microsoft F#&%", or "F#&%*!? .net" is the most common language our team uses.
Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated up.
Do you relize that an F# major has 6 sharps.
But, an F# is the same as a Gb (G flat) which has as 6 flats.
Now the C# scale has 7 sharps, but it's the same as a Db (D flat) which only has 5 flats.
Most people think (D flat) instead of C#.
F# is a very bright scale. It sounds very nice on an Alto Saxophone, whereas the C# scale is a little more moody, depressed.
Maybe Microsoft is trying to back off the use of C#.
Our company has recently started to introduce .NET development alongside our core J2EE platform. One of the issues that has come up has been how useful the multi-language/single-platform support would be. Rather than taking a "best of breed" language for all development, the use of the right tool for the right job could potentially lead to interesting results - A mix of C#/ML/PROLOG/etc. as appropriate for the immesdiate task at hand. I don't think MS is far enough down the road yet to capitalise on the idea, but it's certainly an intriguing possibility - Even if it would lead to a maintenance nightmare :)
Map then applies whatever function we pass in to every member in the array (called a list in functional programming).
So, all you functional programmers, remember... a list is just another name for an array :-P
Seriously, though... I was discussing the future of programming languages with some friends and we agreed that a real step forward would be to provide features such as higher order functions in a mainstream language... could this be it?
If so then it's a little worrying... I'd rather not see any revolutionary languages come out of MS, if at all possible...
(Cambridge's Computer Science degree teaches ML followed by Java in the first year... would they switch to teaching just F# if it became popular?)
My first year CS classes were taught in ML. It's a very potent language. I especially liked the type inference system. What other languages do in templates comes naturally in ML. Our CS prof gave us an example of Quicksort in 3 lines of readable code. As an academic language ML has problems interfacing with real life systems. OcaML was a step in the right direction and MS is building F# on it. I'll certainly try this one.
I wonder if F# has any relationship to the "ML for Microsoft" (I forget the name) efforts from Harlequin Software a few years ago? ML has always seemed an ideal fit for many single-user RAD developments, it just needed an appropriately stable, complete, clearly specified component library and professional quality IDE in order to reap productivity benefits over Java/C# et al.
F# will be learned by people when managers and not university lecturers decide that it is something that coders need to learn or even when coders decide it's necessary for something.
Stop thinking that the world is out to make you use MS products no matter what. The businesses that do the employment and the people who should be advising them (cough -you- cough) are the people who make those decisions.
Anyone learning Computer Science should in no way be gearing themselves with any particular product
Any university offering courses in computer science is doing students a dis-service if it sends them out of the institution without an MS-centric, Linux-centric or any other square peg solution to fit any hole they come across.
I always thought the aim of education and particularly any discipline that considers itself a science was to teach skills and thinking which could be applied across the field so the graduates would find themselves able to adapt to any language or equipment that they found it necessary to use.
Maybe they will start using Symbols like in Super Mario Brothers :)
<end/>
If they can patent/trademark/copyright all the notes used in music, they will be able to own the RIAA.
The have: C#,F#
Left: A,A#,B,C,D,D#,E,F,G,G#
Can't wait for the other 10 programming languages
I don't buy this for a minute. There's tons of comp sci programs that never even made the switch to Java as their "learning" language. People will learn what the job market dictates. There will ALWAYS be a need for COBOL and C programmers and I think that Java has, sadly enough, become ubiquitous enough that we'll always need Java programmers.
You'll lose your job if you only know a handful of trendy technologies and nothing more. If you know some languages that are passsing into the "legacy" category, you're better off.
And, you know, I've been working for a very large financial institution for 2.5 years. I've seen no sign of C# anywhere. Going to the programming racks at Borders would make you think differently. I honestly think there's more C# books out there now than all other programming language books put together. It's amazing.
No, they'll go A through G, then start making chords and arpeggios.
If you can't see the value in jet powered ants you should turn in your nerd card. - Dunbal (464142)
... the drive letters team is (still) working this one out.
Which only goes to show how much cleaner mapping functions to lists is.
map (fun x -> x*x) list
I Browse at +4 Flamebait
Open Source Sysadmin
In newer versions of
Not really. F# and g form a dissonance, called a minor second. It happens though that I like g-f#, a major seventh. But maybe a listen to too much contemporary music.
I know, AWT->SWING and a bunch of other examples, but a CORE PART of Java does not change. It remains the same as much as possible, in regards to the API.
MS goes ahead and changes things completely every few years. Java, for the most part, does NOT require tons of relearning. The API's are there if you need them, but a majority of them do not change. They might get "cleaned up" a bit, or a few deprecated here or there, or in my opinion a few too many may be created to do the same task, but if you could knock up a Java prog years back, it's the same way today for the most part. SIMPLE.
I certainly wouldn't hire an insecure prick for any job. Especially if he was so insecure he was grasping for straws as to why he wasn't succeeding. You think because someone doesn't speak english without an accent they're stupid? How's your hindi?
It's not wasting time, I'm educating myself.
The only time I read a # as "sharp" is when it is on a musical staff ie five parallel lines. Otherwise it is a hash as in #5 for number 5 or please press the hash key on the phone.
hash definitions
Of course when ever I see F# and Micro$oft together I read F#$%
The description reads like F# is OCaml on hash ie dumbed down.
-- it must be true, it's on the internet.
There are three levels to programming.
The first is for the silicon scrapers. Guys who write device drivers and who are amply served by assembler (for the real propeller-head bit-twiddlers) and and by C (Not C++, C) There is no sense of reality at this level.
The second level is for the tool makers. The guys who bring you APIs and services like TCP/IP, Tuxedo, database managers, OpenGL, compilers, browsers and the like. Those folks use C++ and Java. Its a mistake to think that you can make an application in C++ or Java or Smalltalk. You can cobble something together that will cost too much and be too brittle for real-world use and eventually break (or break the bank.) The world becomes real.
The last level is integrative. There aren't any languages which assimilate the concepts which programmers are confronted with in the real world.
The best we have to date is sort of the second and a half level with languages which, with the support of a whole bunch of other third party systems (both code and manual procedures,) are sort of capable of some mimetic link between soma (the code) and extro (the specs.) (Sort of like CICS COBOL on mainframes.)
From what I saw, F#, uh, isn't. Its better but still, its like C++, ObjectiveC or Smalltalk or any other container based language where contained objects have no clue that they contained unless the programmer creates and maintains explicit references to the container.
The flaw starts there and gets carried forward.
And computing is so fundamentally simple. Its a game of N-Dimensional topology bounded by finite vectors in every dimension. There's no mystery involved. You just need to maintain a meta-model of the system and you can generate the rest.
What do you think programmers are and what do you think they're doing? They're code generators that fetch their own meta-model. Some do itbetter than other and some such at code generation too.
MSBPodcast.com The opinions expressed here are my own. If you don't like 'em... Think up your own stuff.
I strongly suggest that Microsoft stick to making operat...(um), office pro..., (no thats not it...), web brow...(nope), how about video game...(nah)..., programming platfor...(not it either)...
100% Insightful
Same thing they do every night, Pinky. Try to take over the world.
F# looks like OCaml. You can have a look on the libraries already present for this fabulous language on the hump http://caml.inria.fr/humps/index.html
Microsoft says it:
F#ism is finally back in F#ion.
I guess this means all Microsoft programmers are F#ists.
Oh well, they're only in it for the C# anyway.
And computing is so fundamentally simple. Its a game of N-Dimensional topology bounded by finite vectors in every dimension. There's no mystery involved. You just need to maintain a meta-model of the system and you can generate the rest.
Christ, if that's simple, I'd hate to hear you describe complicated.
Until today, both ML and Haskell had a common problem: a lack of commercial and real world interest in it and therefore a lack of real-world libraries and supporting frameworks. But now things are going to be changed.
First Ericson came with Erlang, an excelent essence of FP, LP, scripting and networking. Now M$ (I know - evil, but anyway) came with F# bringing OCaml to the real world saving from being forgotten somewhere in Inria.
What next? I think that would be Haskell, the language even more suprior to ML, with already OOP, Parallel and Cuncurrent extensions. Also I like its Functional-Logical dialect - Curry. But who will bring it to the real world? IBM?
Less is more !
There's a new language being formed in the bowels of Microsoft.
This may help explain Microsofts process for developing new software. How are things "formed in the bowels" anyway? A simple understanding is that good stuff is essentially chewed to pieces and then deconstructed in an acidic bath. Once the good stuff reaches the bowels then an attempt is made to remove everything that is of value. Once that has been accomplished we are, I suppose, left with a Microsoft product that is ready to (careful here now) ship (Whew! Now that was one major Freudian slip just waiting to happen....).
--
As a matter of fact, I am a lawyer. But I play an actor on TV.
The second level is for the tool makers. The guys who bring you APIs and services like TCP/IP, Tuxedo, database managers, OpenGL, compilers, browsers and the like. Those folks use C++ and Java. Its a mistake to think that you can make an application in C++ or Java or Smalltalk. You can cobble something together that will cost too much and be too brittle for real-world use and eventually break (or break the bank.) The world becomes real.
I take issue with this. I have designed and implemented apps in both C++ and Java that were flexible enough that we were able accommodate unexpected customer requests. And they didn't break the bank, considering their feature set.
Funny. I remember a time when folks used to believe that Java and C++ (and other OOLs) weren't fit for such low-level work because of the compilers/linkers tended to make the code pretty inefficient. I guess I'm showing my age. :)
I think that if you examine the C# and F# languages, you'll find that they both fall flat.
"Smoking helps you lose weight - one lung at a time" -- A. E. Neumann
It's usually a very bad idea to include imperative aspects in functional languages.
Functional languages are amazing creatures. They're really strange to work in. They take a serious change of mindset. They can be very slow to execute. I/O is really odd when side effects are forbidden.
They have astounding benefits, too. The localization of effect means that they're really easy to debug. The lack of side effects means that some really enormous optimizations are open, which is crucial since the naive execution is slow.
Once you throw in any imperative aspects at all, these effects go right out the window. Even a single imperative statement potentially interferes with every optimization. ("Can I eliminate this execution branch? It seems like a redundant call but it might branch to that imperative statement.")
I think that this got in the way of ML. It can be easy to want to add just a tiny imperative element to make something easier, but that small crack opened up a lot of headaches for me. I greatly preferred the purity of Haskell.
I haven't read the F# spec, so I may be overreacting from the notoriously inaccurate Slashdot summary. That's next.
'Ghash!' muttered Gandalf, 'I wonder if that is what they meant: that the lower levels are on fire? Still we can only go on.'
'Ai! ai!' wailed Legolas. 'A Billrog! A Billrog is come!'
Your mind is squeezed by a blast of pain!
Functional Programming is a Very Good Thing to learn.
After being interested in functional programming languages for a while I had the opportunity to spend some time reviewing a textbook using ML. I figured that was the time to learn the language. Got frustrated quickly, I got several ML systems (including the one mentioned in the book) and no two worked alike. Hell, the syntax varies enough that there are ML dialects that look like completely different languages.
A while later I decided that perhaps it was time to spend some energy seriously learning Haskell. I got and installed Hugs (Haskell.org is a wonderful resource with several Haskell systems listed, tutorials, documentation, libraries and so on). Hugs implemented pretty much all of the Haskell described in the manual I found and the tutorials. (Today, I'd probably use the interactive GHC.)
It took a while, some dedication and a lot of grumbling to figure out how things worked and I'm still learning bits and pieces of the language and associated libraries and stuff.
Now Haskell is one of my favorite languages and I want to use functional tools (higher order functions, laziness, and so on) in every language I use. I'd say that Haskell changed my ideas about programming, my approach to problems, and my toolset both deeply and widely - and for the better. Probably as deep a shift in technology and technique for me as OOP (I started programming in Fortran, APL, Algol...) - but then OOP just always seemed Right to me.
Part of what made the learning process so effective was that Haskell makes it very hard to have side effects - so where in ML the books/tutorials often introduce mechanisms for building variable that work more or less like those in C - in Haskell this is very difficult.
So, while F# may be an interesting language, if you want to learn a new language, try Haskell. You may have to be obstinate. And if it works with you as it did me, it will drive you crazy until it clicks (and I remember exactly the problem that did it) and then you'll just kind do one of those quiet awestruck "wow"s and watch your view of programming change.
Haskell isn't the right language for everything. I also use Java, C and Python (and a few others) often - but for lots of problems, for doing a quick model of something to try it out, for just helping your mind think about a problem a bit differently ... Haskell is great.
But remember - you may well have to be stubborn about persisting till it clicks.
And on a related note...
Does anyone know if anything ever came out of the development of the functional scripting language "Sheep" for the amiga?
Rumor has it that Microsoft is working on a "lite" version of F# to be called "F Micro" or "Fu" for short.
Oh wait, their lawyers already use it. Must be past beta then.
Give me my freedom, and I'll take care of my own security, thank you.
So he talks about how you can implement that Map function on a list.
:: Map f t;
//prepare the vector
//And here we map sqrt on all elements in the vector
//And this is another type of mapping to print the vector
fun Map f [] = []
| Map f (h::t) = f h
And this is beautiful. I love functional languages. But just for completeness, this can also be done in C++.
The following code should compile with the proper headers on any platform that supports C++
vector<float> v_i;
v_i.push_back(1);
v_i.push_back(3);
v_i.push_back(5);
transform(v_i.begin(), v_i.end(), v_i.begin(), sqrt);
copy(v_i.begin(), v_i.end(), ostream_iterator<float>(cout, ", "));
The Internet is full. Go Away!!!
Want an "interesting mix of imperative and functional features" in a language any C/C++/Java programmer can start working with immediately? Try Nickle.
I don't work for a company that programs for Windows or anything, I've simply used the tools in my spare time to make useful little Windows programs. So I can say firsthand that it isn't really so bad. I still get my hands dirty with small Linux apps from time to time and I stick with C/C++ for all that (as if there was a huge choice). Seriously, though, I doubt it could be easier to learn how to make a full-fledged X-capable app with widgets in Linux than it is to just open up Visual Studio and whip up a simple app that does the backend stuff for you. On the same note, I understand that many people hate the abstraction that goes on here and that makes sense.
The bottom line is that if you've got to do some Windows programming, the tools are easy to use and there is plenty of documentation for learning.
Just my two cents.
That is one of the most ridiculous things I've ever read. What are Perl, Python, php and Java implemented in? C! If C wasn't portable enough to run on all the platforms those languages do, those language's runtimes wouldn't compile on those platforms!
Find me a platform that runs any of those languages that doesn't also have a gcc port that allows you to write portable code in C.
...that Ocaml is speed competitive with C when compiled, and with java when bytecoded. Meanwhile haskell is more in the same speed category as awk and tcl.
Data here.
is it just a coincidence or is Microsoft picking langauge names that a lot of search engines can't handle? C#? F#?
I just did some tests with C# and less than half the search engines I looked at actually used the full string for the query. The rest dropped the # as punctuation and gave me any generic "C" results it could find.
Was there any thought put into this? Have we heard any statements or interviews from Microsoft about this?
Personally, with C, C++, and C# all looking identical to some search engines, I think they are going to make life rough for developers trying to look up documents/tips/errors/FAQs about their respective languages...
In the Portland, Ore area and like card games? Check out: http://groups.yahoo.com/group/portlandgames/
Oh, wait...