“Rumors of a new .NET language have been circulating around the cyber-grapevine for the last year or so, but have picked up speed as of late. The fire was fed by Mary Jo Foley’s (columnist, Microsoft Watch) recent news story Add F# To the Alphabet Soup. Strangely enough, there hasn’t been a peep from Microsoft. The only published information I can find is hosted on the Microsoft Research (MR) site. So, I donned my thinking cap, and proceeded with reckless abandon. Here begins the tale…” Read the article at ExtremeTech.
I’m fond of functional languages. They taught us ML (F# is apparently based off O’Caml (a very cool ML variant)) in school and it really does make some things _much_ easier. I can totally picture myself using it for anything non-interactive. But applications? I worry that I’m missing something because no functional programming language FAQ ever answers this question. How am I supposed to write a web browser or a word processor in your language? The lack of side-effects make programming simple, but it makes it damn hard to communicate with the user. And once you start adding in side effects, you start to lose some of the advantages the functional paradigm and things just get sloppy. So my question to other OSNews readers is: are the functional programmers ignoring the so called “elephant in the living room” and are applications the reason everyone still writes in imperative languages? Or, does there exist a method for writing interactive applications in functional langauges that is clean and consistant and it’s just intertia holding people back? The closest thing I’ve found is O’Haskell. They use reactive objects to allow interaction and it sound cool, but I really need to read more before I comment.
All i need is jave
We have enough languages around :pascal,c,C++,per,php …etc.
That name is a joke we hope :
# What is F#?
# What is the origin of F#?
# What the purpose of F# and what would it do for me?
It always sound like a rude name
RTFA – Read The F# Article
“The best way to learn F# is to get your hands dirty.”
As we didn’t know it …already LoooL
“There are minimal requirements for running the F# compiler.”
“You will need to have one of the above installed on your system in order to run F# programs.
You will also need to have the F# libraries installed in the Global Assembly Cache or copied to your application directory. This is done when you install the F# compiler on your computer.”
Maybe is the same joke as the iLoo to atract people to the
services .The lack of MS imagination
http://www.canada.com/technology/story.html?id=F48B8335-B966-425F-B…
“””But applications? … How am I supposed to write a web browser or a word processor in your language? The lack of side-effects make programming simple, but it makes it damn hard to communicate with the user. And once you start adding in side effects, you start to lose some of the advantages the functional paradigm and things just get sloppy.”””
You answered your own question: you end up using side-effects when you have to and avoiding them in other places. There are a couple of good examples of interactive appilcations: Emacs, Hemlock, Efuns (all similiar); there’s a scheme-based web-browser out there somewhere; or you can go the guile route and use it for the backend and leave I/O and Interaction to another language.
“””Or, does there exist a method for writing interactive applications in functional langauges that is clean and consistant and it’s just intertia holding people back?”””
It’s inertia, and a general lack of experience with/ignorance about the functional paradigm.
MS very likey must have started working on this language even before C# was formally released. I wonder why they just didn’t hold off and wait for this one?
Because not everybody is going to want to program in a functional language and MS wanted it to be easy for c/c++ and java programmers to be able to learn it.
I guess what I was really asking is if there’s a way to write applications in purely functional languages. It sounds like you agree that there isn’t. So that leaves two possibilities for writing applications: imperative, or hybrid (imperative/functional). I’m willing to discard pure imperative languages (not because they suck, just because we seem to agree that functional languages have useful features).
I’d further split that hybrid category into language hybrids and binding hybrids. We’ve obviously got functional languages that have imperative features (OCaml has tons of these) and we’ve got imperative languages with functional parts (Python’s got lambdas, map, etc).
In terms of binding, we’ve always had lower level bindings, between the functional languages and imperative code (considering most OSes and libraries are written in C), newer systems allow the calls to pass both ways. These systems have always been clunky and inconvient. Now though, the CLI seems to be promising a much smoother interaction.
So, all that rambling gets me to a new question: What makes more sense, writing everything in one hybrid-language that support both imperative and functional programming styles, or writing your imperative code in an imperative language, writing your functional code in a functional langauge and binding them together using tools like .NET?
Wait a second esasy to use , the power of c and java , access to large class library and it can do functional programming. Sounds like Ms is trying to invent Python 🙂
(only (a (functional (programmer (would (nest (parens (like that))))))))
Of course, I’m just kidding. I’m rather new to functional programming, but from what I’ve seen of Clean, Haskell, and OCaml, it looks rather interesting. Definately going to learn more of it in the future. I’m especially interested in recent developments that are making steps to introducing a somewhat functional style to C++. Though, I must say that it irks me how some of the rudest flamers on the net hang out on comp.lang.functional and comp.lang.lisp
There is a way to write I/O in purely function languages. Clean and Haskell are both purely functional languages. Clean uses something called uniqueness typing to do I/O, and Haskell uses something called I/O monads. I haven’t gotten that far yet in my study of functional languages, but from my exposure to Clean’s GUI API, it looks rather straight-foward. I/O monads, on the other hand, have a reputation for being at once easy to use and extremely difficult to understand.
What makes more sense, writing everything in one hybrid-language that support both imperative and functional programming styles, or writing your imperative code in an imperative language, writing your functional code in a functional langauge and binding them together using tools like .NET?
>>>>>>
Depends what you’re doing. One of the things I like about C++ is that I can use straight OOP most of the time, but when I need to I can switch over to something else. These bits here and there don’t really warrent the pain of switching to another language entirely, and don’t really suffer from the fact that C++ is less than ideal for that style of code. However, if you’re working on something where you’ll be using a different style for significant amounts of code, it might be worth it to write those segments in a different language.
Rebol is functional language too, and it is relatively easy to write average applications using Rebol. Of course forget to write complex Excel or MS Word clone 🙂
-pekr-
So what exactly are you saying is missing from functional languages that precludes a user interface?
(print (read))
(MessageBox
(getWindowText
(getActiveControl
(getActiveWindow)
)
)
)
-hj
The code you’ve written looks imperative to me. Parenthesis do not a functional language make. The whole point of the print, read, and messagebox functions is their side effects. Neither print nor MessageBox is being called for it’s return value. Remember, a functional program is just one big expression. No statements.
You should really check out clean. Its unique variables really make writing GUI applications much easier. It might not be as pure functional as haskells monads, but it is a very simple and efficient concept.
Clean comes with a really nice GUI libray, and the official clean IDE is itself written in clean.
And by the way: it is *fast*. If you use the unique types in a clever way, it can be as fast as straight c.
Here is a link to the IDE download: <http://www.cs.kun.nl/~clean/> There are some nice demo programs including 2d games. The only thing I missed was a debugger.
F# looks a bit of like: “Hey, functional programming is cool, but we can’t get our heads around the paradigm, so let’s break it”.
That’s what it *looks* like. I may be wrong.
Maybe MS should look at H# (H for Haskell
I agree that Clean is a pretty nifty language. Heck, the compiler produces code that is dependency free enough to use in kernel mode However, it’s rather Windows-centric (the new GUI toolkit and the experimental language features in 2.0 are only available in Windows).
Did you even read pass the first paragraph of the article? C# (and Java for all that matters) is very different from F#.
Maybe this is Microsofts alternative to COBOL which is still widely used in business.
All languages have their place, it is up to the developer to chose which one it the appropriate one to use.
Charles Simonyi, the inventor and author of Microsoft Word, has created a very interesting new technology venture outside of Microsoft.
As Microsoft does whenever someone leaves and starts to make something cool, they put together a crash team to duplicate a good chunk of it and get it to market as quickly as possible, thus fucking over the Microsoft ‘traitor’.
Here is what Charles is up to:
http://intentsoft.com/
Intentional Software Corporation will develop tools and technology based on a synthesis of recent innovations including aspect-oriented programming (AOP), generative (or transformational) programming (GP), intentional programming (IP), model-integrated computing (MIC) and others.
It doesn’t sound like Microsoft see him as a traitor. Sounds like Simonyi and Microsoft are still one big happy family.
http://intentsoft.com/pr_091702.html
Just look at what happened to WebGain. At first, things were giggles and laughs all around. And then WebGain got more and more popular… and more Microsofters starting leaving the company to go work at WebGain… the hatred began… and festered…. and it ended up WebGain was sold to BEA.
Unless F# is actually from Intentsoft, I think the time of happy spin is over and Microsoft is back to their normal ruthless kill-their-young behaviour.