473,394 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

F# programming language


Microsoft Research are developing a functional programming language called
F# for .NET and I've been playing with it recently. I've uploaded some
demos here:

http://www.ffconsultancy.com/dotnet/fsharp/

I'm keen to see what Windows developers think of this language as we're
considering using it to develop commercial applications on the Windows
platform.

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 23 '06 #1
44 3510
"Jon Harrop" <jo*@ffconsultancy.comwrote in message
news:45**********************@ptn-nntp-reader02.plus.net...
>
Microsoft Research are developing a functional programming language called
F# for .NET and I've been playing with it recently. I've uploaded some
demos here:

http://www.ffconsultancy.com/dotnet/fsharp/

I'm keen to see what Windows developers think of this language as we're
considering using it to develop commercial applications on the Windows
platform.
F# does seem to fit in better with XAML, conceptually speaking.

Nice examples, although raytracer.fs does not compile under FSharp-1.1.12.5.

Cheers!

Chris.

Nov 23 '06 #2
Christopher Ireland wrote:
F# does seem to fit in better with XAML, conceptually speaking.
What is XAML good for? I've seen the demo where they say "you don't have to
write code", then they write a load of code in XML and get a window filled
with RSS feed. Does anyone have any better demos of this technology?

I'm a scientist by trade and know virtually nothing about "web programming"
but I'm very interested in learning about it.
Nice examples, although raytracer.fs does not compile under
FSharp-1.1.12.5.
Yeah, I'm on a prerelease 1.1.13.2 which should become publically available
this week. It adds some cool features like comprehensions for lists, arrays
and IEnumerables.

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 23 '06 #3
"Jon Harrop" <jo*@ffconsultancy.comwrote in message
news:45**********************@ptn-nntp-reader02.plus.net...
Christopher Ireland wrote:
>F# does seem to fit in better with XAML, conceptually speaking.

What is XAML good for? I've seen the demo where they say "you don't have
to
write code", then they write a load of code in XML and get a window filled
with RSS feed. Does anyone have any better demos of this technology?

I'm a scientist by trade and know virtually nothing about "web
programming"
but I'm very interested in learning about it.
I don't think it's just about "web programming". Have a look at this
article:
http://www.informit.com/discussion/i...ef74b617e&rl=1

I get the impression that is to be used XAML as a functional/declarative
language to enable XML-based documents to become self-describing
applications.
>Nice examples, although raytracer.fs does not compile under
FSharp-1.1.12.5.

Yeah, I'm on a prerelease 1.1.13.2 which should become publically
available
this week. It adds some cool features like comprehensions for lists,
arrays
and IEnumerables.
Nice one!

Cheers!

Chris.
Nov 23 '06 #4
Hi,

Christopher Ireland wrote:
I don't think it's just about "web programming". Have a look at this
article:
http://www.informit.com/discussion/i...ef74b617e&rl=1

I see XAML as a way to encourage graphics designers and software
developer to work more closely together. Pretty much everything you can
do in XAML, you can also do it in C#. However, people who never
programmed will definitely feel intimidated by the C# environment. XAML
will help, because it can easily be generated by Graphics Design
application (like Expression or Zam 3D), can then easily be modified by
a Graphics Designer (for example, animations, etc...), and then passed
to the software developer for code integration (for example DB
connectivity, web services integration, etc...).

And you're absolutely right, XAML is not thought just for web
programming. In fact, AFAIK, Microsoft sees it more as a replacement for
WinForms than for ASP.NET.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 23 '06 #5
All this confusion? Its really very simple -- conceptually -- and in fact
simplification of the sublime complexity of logic is the objective. The goal
is to allow line of business analysts who understand the business
initimately to become proficient as application developers. That's all there
is to it for the time being.

This is being accomplished by developing declarative languages that can be
manually edited after or during the use of a push button monkey code
generator. Those who want to know what will come of this trend can (and
probably should) read Isaac Asimov's "Foundation Trilogy" which is the name
his writings were referred to the first couple of times I read these works
in the early 1960s.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-...8&z=17&l=0&m=h

[1] http://en.wikipedia.org/wiki/The_Foundation_Series
"Laurent Bugnion" <ga*********@bluewin.chwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi,

Christopher Ireland wrote:
>I don't think it's just about "web programming". Have a look at this
article:
http://www.informit.com/discussion/i...ef74b617e&rl=1

I see XAML as a way to encourage graphics designers and software developer
to work more closely together. Pretty much everything you can do in XAML,
you can also do it in C#. However, people who never programmed will
definitely feel intimidated by the C# environment. XAML will help, because
it can easily be generated by Graphics Design application (like Expression
or Zam 3D), can then easily be modified by a Graphics Designer (for
example, animations, etc...), and then passed to the software developer
for code integration (for example DB connectivity, web services
integration, etc...).

And you're absolutely right, XAML is not thought just for web programming.
In fact, AFAIK, Microsoft sees it more as a replacement for WinForms than
for ASP.NET.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Nov 23 '06 #6
Jon Harrop <jo*@ffconsultancy.comwrote:
>I'm keen to see what Windows developers think of this language as we're
considering using it to develop commercial applications on the Windows
platform.
I wrote a recent project in F#: 6,000 lines of code.
But the users required a C# version so I had to rewrite: 30,000 lines
of code to do exactly the same thing.

--
Lucian
Nov 23 '06 #7
Hmmm... I always thought that F# was G!

;-)

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

Never trust a dunderhead with a blunderbuss.
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.comwro te in message
news:uy**************@TK2MSFTNGP02.phx.gbl...
All this confusion? Its really very simple -- conceptually -- and in fact
<snip>
>And you're absolutely right, XAML is not thought just for web
programming. In fact, AFAIK, Microsoft sees it more as a replacement for
WinForms than for ASP.NET.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch


Nov 23 '06 #8
Oops! I MEANT that I always thought F# was A!

;-)

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

Never trust a dunderhead with a blunderbuss.
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.comwro te in message
news:uy**************@TK2MSFTNGP02.phx.gbl...
All this confusion? Its really very simple -- conceptually -- and in fact
<snip>
>In fact, AFAIK, Microsoft sees it more as a replacement for WinForms than
for ASP.NET.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch


Nov 23 '06 #9
No, no, no. I was right the first time!

My musical skills are out of practice!

;-)

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

Never trust a dunderhead with a blunderbuss.

Nov 23 '06 #10
Lucian Wischik wrote:
I wrote a recent project in F#: 6,000 lines of code.
But the users required a C# version so I had to rewrite: 30,000 lines
of code to do exactly the same thing.
Wow! I guess it's a program that lent itself to a functional solution
quite nicely. Why would your users care what language it was written in?

Best Regards,

James Crosswell
Microforge.net LLC
http://www.microforge.net
Nov 23 '06 #11
Laurent Bugnion wrote:
And you're absolutely right, XAML is not thought just for web
programming. In fact, AFAIK, Microsoft sees it more as a replacement for
WinForms than for ASP.NET.
Indeed, one of the main benefits of XAML is that it separates the code
from the interface (so the coders can work on logic while designers work
on interfaces)... Such separation has existing for web based apps, in
one form or another, for years - so the biggest benefits of XAML are
probably for Windows apps.

Best Regards,

James Crosswell
Microforge.net LLC
http://www.microforge.net
Nov 23 '06 #12
Still wrong. F# would be Gb :)
Nov 23 '06 #13
This [1] is even more embarassing.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-...8&z=17&l=0&m=h

[1] http://www.rubyclr.com/

"Lucian Wischik" <lu***@wischik.comwrote in message
news:i3********************************@4ax.com...
Jon Harrop <jo*@ffconsultancy.comwrote:
>>I'm keen to see what Windows developers think of this language as we're
considering using it to develop commercial applications on the Windows
platform.

I wrote a recent project in F#: 6,000 lines of code.
But the users required a C# version so I had to rewrite: 30,000 lines
of code to do exactly the same thing.

--
Lucian

Nov 23 '06 #14
James Crosswell wrote:
Indeed, one of the main benefits of XAML is that it separates the code
from the interface (so the coders can work on logic while designers work
on interfaces)... Such separation has existing for web based apps, in
one form or another, for years - so the biggest benefits of XAML are
probably for Windows apps.
I'm no expert on this stuff but, from my point of view, if you're trying to
create a technology that makes GUI design easy enough for non-coders then
you need a GUI, not another ASCII language. That's why I don't understand
what hole XAML is supposed to fill.

For one thing, it seems to be a bad programming language (from a language
design point of view), e.g. insufficient static checking. Even in the
14-line demo the author makes a mistake and can't see what is wrong.
Contrast that with Intellisense in a variety of languages...

I've just found another XAML demo here:

http://channel9.msdn.com/showpost.aspx?postid=116327

so I'll watch that and see what they're up to.

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 23 '06 #15
Generally speaking, only when using a 12 tone diatonic scale [1]

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-...8&z=17&l=0&m=h

[1] http://en.wikipedia.org/wiki/Diatonic
"Raymond Basque" <_NOSPAM_rbasque@_NOSPAM_jednm.comwrote in message
news:eW**************@TK2MSFTNGP04.phx.gbl...
Still wrong. F# would be Gb :)


Nov 23 '06 #16
Jon Harrop wrote:
I'm no expert on this stuff but, from my point of view, if you're trying to
create a technology that makes GUI design easy enough for non-coders then
you need a GUI, not another ASCII language. That's why I don't understand
what hole XAML is supposed to fill.
You're not actually supposed to write XAML - just like you're not
supposed to manually code gif or jpg files... it's a data format used to
store structures that will typically be designed/modified by design
tools like Sparkle (or whatever they're calling it now).
For one thing, it seems to be a bad programming language (from a language
design point of view),
I don't think it is really a programming language... no more than HTML
is a programming language. You create HTML template files for your
ASP.NET programs and the functionality for those GUIs is provided by a
separate piece of the puzzle - i.e. your C#/VB.NET/Chrome or whatever code.

I think you're probably missing the point. Check out some of the demos
on Sparkle on channel9.msdn.com - that gives you a good idea of how
useful XAML can be.

Best Regards,

James Crosswell
Microforge.net LLC
http://www.microforge.net
Nov 23 '06 #17
clintonG wrote:
Generally speaking, only when using a 12 tone diatonic scale [1]
Didn't you mention something about simplifying stuff up above ;-)

Best Regards,

James Crosswell
Microforge.net LLC
http://www.microforge.net
Nov 23 '06 #18
James Crosswell wrote:
Wow! I guess it's a program that lent itself to a functional solution
quite nicely.
That would seem to be most programs. I've written everything from symbolic
maths programs in OCaml that were 100x the code density of C and much
faster to graphical applications (Presenta) that were 4-5x the code density
of C++ and faster.
Why would your users care what language it was written in?
Especially given that the whole point of a CLR is interoperability. Maybe
they wanted to develop it without any decent developers. ;-)

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 23 '06 #19
Jon Harrop wrote:
James Crosswell wrote:
>Wow! I guess it's a program that lent itself to a functional solution
quite nicely.

That would seem to be most programs.
Like a business application that has grids and dialogs to edit
"entities" that are stored in a database? That's what the majority of
applications seem to be... but I fail to see how a functional solution
would reduce the amount of code for these apps. Don't get me wrong, I
think functional programming languages have their applications but just
because you have a hammer doesn't mean that everything else is a nail.
>Why would your users care what language it was written in?

Especially given that the whole point of a CLR is interoperability. Maybe
they wanted to develop it without any decent developers. ;-)
Aye, most developers don't get much exposure to functional programming
(outside of their university degrees). It's a slightly different mindset
for sure.

Best Regards,

James Crosswell
Microforge.net LLC
http://www.microforge.net
Nov 23 '06 #20
James Crosswell wrote:
Like a business application that has grids and dialogs to edit
"entities" that are stored in a database? That's what the majority of
applications seem to be... but I fail to see how a functional solution
would reduce the amount of code for these apps.
Sounds like an ideal task for higher-order functions. :-)
Don't get me wrong, I
think functional programming languages have their applications but just
because you have a hammer doesn't mean that everything else is a nail.
Sure. That was based on my own experience, which is mostly science/
graphics/compilers.

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 23 '06 #21
Yes, I realized it while eating my Thanksgiving dinner. I haven't touched a
guitar in 10 years now. Back then I would have known it right off the bat.
I'm so ashamed!

:-(

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

Never trust a dunderhead with a blunderbuss.
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.comwro te in message
news:e6**************@TK2MSFTNGP03.phx.gbl...
Generally speaking, only when using a 12 tone diatonic scale [1]

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-...8&z=17&l=0&m=h

[1] http://en.wikipedia.org/wiki/Diatonic
"Raymond Basque" <_NOSPAM_rbasque@_NOSPAM_jednm.comwrote in message
news:eW**************@TK2MSFTNGP04.phx.gbl...
>Still wrong. F# would be Gb :)



Nov 23 '06 #22
I would think that the greatest benefit of XAML is eXtensibility. Being XML,
it is inherently extensible, platform-independent, and transformable (via
XSL) to virtually any GUI format.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

Never trust a dunderhead with a blunderbuss.
"James Crosswell" <ja***@microforge.netwrote in message
news:uW**************@TK2MSFTNGP04.phx.gbl...
Laurent Bugnion wrote:
>And you're absolutely right, XAML is not thought just for web
programming. In fact, AFAIK, Microsoft sees it more as a replacement for
WinForms than for ASP.NET.

Indeed, one of the main benefits of XAML is that it separates the code
from the interface (so the coders can work on logic while designers work
on interfaces)... Such separation has existing for web based apps, in one
form or another, for years - so the biggest benefits of XAML are probably
for Windows apps.

Best Regards,

James Crosswell
Microforge.net LLC
http://www.microforge.net

Nov 23 '06 #23
Jon Harrop wrote:
| Microsoft Research are developing a functional programming language
| called F# for .NET and I've been playing with it recently. I've
| uploaded some demos here:
|
| http://www.ffconsultancy.com/dotnet/fsharp/
|
| I'm keen to see what Windows developers think of this language as
| we're considering using it to develop commercial applications on the
| Windows platform.

I've just read on Don Syme's blog that you've started a blog of you're own
... all the best of luck with it!

P.S. it would be great if ray tracer compiled with the latest publicly
available version of F#!

--
Christopher Ireland

"Getting married for sex is like buying a 747 for the free peanuts."
Jeff Foxworthy
Nov 24 '06 #24
Christopher Ireland wrote:
P.S. it would be great if ray tracer compiled with the latest publicly
available version of F#!
No, that's a really bad idea. If you can tweak the code then you'll sink an
enormous amount of time into fiddling with it. Take yesterday for example,
I barely got any work done... ;-)

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 24 '06 #25
Jon Harrop wrote:
| Christopher Ireland wrote:
|| P.S. it would be great if ray tracer compiled with the latest
|| publicly available version of F#!
|
| No, that's a really bad idea. If you can tweak the code then you'll
| sink an enormous amount of time into fiddling with it. Take yesterday
| for example, I barely got any work done... ;-)

Out of interest, do you find your code more or less buggy in F# than in C#?
If there is a bug, in which language is it easier to trace and fix?

--
Christopher Ireland

"You can't have everything. Where would you put it?"
Steven Wright
Nov 24 '06 #26
Hi,

Kevin Spencer wrote:
Yes, I realized it while eating my Thanksgiving dinner. I haven't touched a
guitar in 10 years now. Back then I would have known it right off the bat.
I'm so ashamed!

:-(
Kevin Spencer
And now it's on Internet for ever and ever bwahahahaha ;-)

Don't let this spoil your holidays.

Greetings,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 24 '06 #27
"Christopher Ireland" <ci******@gmail.comwrote:
>Out of interest, do you find your code more or less buggy in F# than in C#?
If there is a bug, in which language is it easier to trace and fix?
The bugs were of a completely different nature. My F# code ends up
being far more ambitious in scope, far more sophisticated in its data
structures and algorithms, deals with more complex problems. The bugs
I get in it tend to be conceptual ones of algorithm design. My C# code
ends up less ambitious, more "engineery". The bugs I get in it tend to
be normal bugs, like missed initializations or unkept invariants. Also
the C# code never has the same "agility" as F#, the agility to easily
restructure the algorithms and datastructures.

The F# compiler tends to catch more bugs than the C# one does. That's
because it's somehow easier in F# to describe your abstractions in the
type system.

When there are normal bugs in F#, though, they're harder to trace than
C#. I think that's because F# code is more concise and tends to use
"lambdas" a lot more. Consider this F# code:
foldr (fn x y =x+y) 0 mylist;
versus this C# code:
int sum=0;
foreach (int x in mylist)
{ sum+=x;
}
In the C# it's easy to know where to set your breakpoint and where to
run it. In the F# it's not.

--
Lucian
Nov 24 '06 #28
Lucian Wischik wrote:
| The bugs were of a completely different nature.

That's very interesting, thank you for your insights!

--
Christopher Ireland

"You can't have everything. Where would you put it?"
Steven Wright
Nov 24 '06 #29
Hi,

Lucian Wischik wrote:
The bugs were of a completely different nature. My F# code ends up
being far more ambitious in scope, far more sophisticated in its data
structures and algorithms, deals with more complex problems. The bugs
I get in it tend to be conceptual ones of algorithm design. My C# code
ends up less ambitious, more "engineery". The bugs I get in it tend to
be normal bugs, like missed initializations or unkept invariants. Also
the C# code never has the same "agility" as F#, the agility to easily
restructure the algorithms and datastructures.

The F# compiler tends to catch more bugs than the C# one does. That's
because it's somehow easier in F# to describe your abstractions in the
type system.

When there are normal bugs in F#, though, they're harder to trace than
C#. I think that's because F# code is more concise and tends to use
"lambdas" a lot more. Consider this F# code:
foldr (fn x y =x+y) 0 mylist;
versus this C# code:
int sum=0;
foreach (int x in mylist)
{ sum+=x;
}
In the C# it's easy to know where to set your breakpoint and where to
run it. In the F# it's not.
Interesting post, thanks for sharing.

One more question though: You mention that C# is more "engineery". Is it
your opinion (like I think after reading what you wrote) that C# is more
targeted at software engineers (like me) and F# at scientists? I got the
feeling that scientists are more able to deal with the abstraction level
you mention, while engineers prefer to see what's going on in the code.

What are your thoughts?
Greetings,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 24 '06 #30
Christopher Ireland wrote:
Jon Harrop wrote:
| Christopher Ireland wrote:
|| P.S. it would be great if ray tracer compiled with the latest
|| publicly available version of F#!
|
| No, that's a really bad idea. If you can tweak the code then you'll
| sink an enormous amount of time into fiddling with it. Take yesterday
| for example, I barely got any work done... ;-)

Out of interest, do you find your code more or less buggy in F# than in
C#? If there is a bug, in which language is it easier to trace and fix?
I'm coming from a C++ vs ML background, so I can't comment on C# vs F#
specifically. For ML vs C++, I'd say:

1. ML is ~10x more productive, i.e. 1/10th development times.
2. ML has 2-5x higher code density.
3. ML code is much more reliable than C++ code but I can't quantify how
much.

I guess the reliability of ML code is reflected in the development time.

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 24 '06 #31
Christopher Ireland wrote:
If there is a bug, in which language is it easier to trace and fix?
When I started programming in OCaml I found its errors messages mostly very
good but sometimes devilishly obscure. F# is in a similar boat.

However, it only took me 6 months to get more efficient in OCaml programming
than I was in C++, having been programming in C++ for 10 years.

Type inference is the main difference. You rarely declare types in F# code
because the compilers infers them all for you. That is usually great
because you write a lot less code and the code is a lot clearer. However,
when it goes wrong, the error messages can be confusing primarily because
they'll contain the wrong types because the wrong types have been inferred.

I should also mention that, for a large class of problems, F# code tends to
work first time once it is compiled. Aside from good language design, I
don't think there is any logical reason to expect that but it certainly
works. There are examples where F# is less effective at checking your code
but it always seems to remain significantly more effective than the
competition.

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 24 '06 #32
Laurent Bugnion wrote:
One more question though: You mention that C# is more "engineery". Is it
your opinion (like I think after reading what you wrote) that C# is more
targeted at software engineers (like me) and F# at scientists?
I'm a scientist and I'd actually have said quite the opposite. F# seems to
be taking leaves from Matlab's book and I consider Matlab to be an
engineer's tool.

There's a lot of overlap between scientists and engineers, of course, and I
think a real killer feature for F# will be a graphical version of the
interactive mode. It is actually really easy to start writing one, you just
replace the pretty printer for a given type with one that pops up a window.
I got the
feeling that scientists are more able to deal with the abstraction level
you mention, while engineers prefer to see what's going on in the code.
We probably need a quiz to answer that. If the engineers in the audience can
understand the comparison I drew between the C++ and OCaml implementations
of my ray tracer then I think they'll be fine with F#:

http://www.ffconsultancy.com/free/ra...omparison.html

I'll put a similar page up comparing C# and F# implementations if you
like...

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 24 '06 #33
Hi,

Jon Harrop wrote:
Laurent Bugnion wrote:
>One more question though: You mention that C# is more "engineery". Is it
your opinion (like I think after reading what you wrote) that C# is more
targeted at software engineers (like me) and F# at scientists?

I'm a scientist and I'd actually have said quite the opposite. F# seems to
be taking leaves from Matlab's book and I consider Matlab to be an
engineer's tool.
Really? I remember Matlab from my engineer's school day, wouldn't like
to use that to build a product (I mean, something I can actually sell to
someone). It was a great tool to study mathematical transformations and
the like, but when I want something done, I really prefer C#.

There's a lot of overlap between scientists and engineers, of course, and I
think a real killer feature for F# will be a graphical version of the
interactive mode. It is actually really easy to start writing one, you just
replace the pretty printer for a given type with one that pops up a window.
>I got the
feeling that scientists are more able to deal with the abstraction level
you mention, while engineers prefer to see what's going on in the code.

We probably need a quiz to answer that. If the engineers in the audience can
understand the comparison I drew between the C++ and OCaml implementations
of my ray tracer then I think they'll be fine with F#:

http://www.ffconsultancy.com/free/ra...omparison.html

I'll put a similar page up comparing C# and F# implementations if you
like...
That would be nice, but I don't think I will work with F# in the near
future (no time...), so do it only if you really have the time, or if
you gain something from it.

Thanks!
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 24 '06 #34

"Jon Harrop" <jo*@ffconsultancy.comwrote in message
news:45**********************@ptn-nntp-reader02.plus.net...
>
Microsoft Research are developing a functional programming language called
F# for .NET and I've been playing with it recently. I've uploaded some
demos here:

http://www.ffconsultancy.com/dotnet/fsharp/

I'm keen to see what Windows developers think of this language as we're
Useful for math and logic, not so much for GUI stuff which really requires
imperative programming. But .NET will let you call back and forth so use an
appropriate mixture of languages.
considering using it to develop commercial applications on the Windows
platform.
Last I checked F# was only available for research with no option for a
commercial license. That could be an insurmountable obstacle.
>
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists

Nov 24 '06 #35
"Jon Harrop" <jo*@ffconsultancy.comwrote in message
news:45**********************@ptn-nntp-reader02.plus.net...
>
I'll put a similar page up comparing C# and F# implementations if you
like...
Thanks again for your input, Jon.

Yes please <g>!

Cheers!

Chris.
Nov 24 '06 #36
Jon Harrop <jo*@ffconsultancy.comwrote:
>Type inference is the main difference. You rarely declare types in F# code
because the compilers infers them all for you. That is usually great
because you write a lot less code and the code is a lot clearer. However,
when it goes wrong, the error messages can be confusing primarily because
they'll contain the wrong types because the wrong types have been inferred.
The most important F# lesson I learnt: always declare complete types
for my functions! And declare types for any complicated-looking
variables. This habit reduced my type-inference-debugging-time a lot.

--
Lucian
Nov 24 '06 #37
Laurent Bugnion wrote:
Jon Harrop wrote:
>I'm a scientist and I'd actually have said quite the opposite. F# seems
to be taking leaves from Matlab's book and I consider Matlab to be an
engineer's tool.

Really? I remember Matlab from my engineer's school day, wouldn't like
to use that to build a product (I mean, something I can actually sell to
someone). It was a great tool to study mathematical transformations and
the like, but when I want something done, I really prefer C#.
You wouldn't use Matlab to make an application but you might write a toolbox
for Matlab and sell it. I think it is possible to do the same thing for F#
but, at the same time, you can write your applications in F# instead of C#.

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 24 '06 #38
Ben Voigt wrote:
"Jon Harrop" <jo*@ffconsultancy.comwrote in message
news:45**********************@ptn-nntp-reader02.plus.net...
>Microsoft Research are developing a functional programming language
called F# for .NET and I've been playing with it recently. I've uploaded
some demos here:

http://www.ffconsultancy.com/dotnet/fsharp/

I'm keen to see what Windows developers think of this language as we're

Useful for math and logic, not so much for GUI stuff which really requires
imperative programming.
I'm going to try to write some GUI programs and I'll see how F# compares.
Presumably C# is likely to come out on top when there is a big GUI and not
much under the hood?
But .NET will let you call back and forth so use
an appropriate mixture of languages.
I've obviously been writing F# code that calls C# APIs but I've yet to try
it the other way around. I assume you have to restrict yourself to the C#
subset of F# when you want your F# code to be callable from C#.

Potentially I could write code in F# and sell it as a DLL for other .NET
programmers to use and they would never even know that I wrote it in F#.
I'd like try that but I've no idea if it is feasible... :-)
>considering using it to develop commercial applications on the Windows
platform.

Last I checked F# was only available for research with no option for a
commercial license. That could be an insurmountable obstacle.
I'm sure you can write commercial software in F# and sell it. I think the
author is trying to get the whole thing released under a commercial license
so you will even be able to bundle the F# compiler with your product, e.g.
to do metaprogramming.

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Nov 24 '06 #39
"Jon Harrop" <jo*@ffconsultancy.comwrote in message
news:45**********************@ptn-nntp-reader02.plus.net...
I've obviously been writing F# code that calls C# APIs but I've yet to try
it the other way around. I assume you have to restrict yourself to the C#
subset of F# when you want your F# code to be callable from C#.
I think it must be, given that the assemblies built from F# are MSIL.

Try downloading Reflector for .NET (http://www.aisto.com/roeder/dotnet/) and
opening your raytracer.exe .. you'll be able to see the whole thing in C#
(or even Delphi, for that matter <g>).

Cheers!

Chris.
Nov 24 '06 #40
Laurent Bugnion <ga*********@bluewin.chwrote:
>One more question though: You mention that C# is more "engineery". Is it
your opinion (like I think after reading what you wrote) that C# is more
targeted at software engineers (like me) and F# at scientists?
We're called software engineers but I don't think there's very much
engineering discipline in our work. We're expected to produce lots of
features, quickly, and track down lots of bugs, and we often don't
even have the time to sit back and calmly document how what we've done
works. F# seems good for this audience.

--
Lucian
Nov 24 '06 #41
Hi,

Lucian Wischik wrote:
Laurent Bugnion <ga*********@bluewin.chwrote:
>One more question though: You mention that C# is more "engineery". Is it
your opinion (like I think after reading what you wrote) that C# is more
targeted at software engineers (like me) and F# at scientists?

We're called software engineers but I don't think there's very much
engineering discipline in our work. We're expected to produce lots of
features, quickly, and track down lots of bugs, and we often don't
even have the time to sit back and calmly document how what we've done
works. F# seems good for this audience.
I am lucky enough to work for Siemens, where software engineers are
engineers ;-) We do a lot of architecture and design, for example.

Also, note that in Switzerland, you can only use the title software
engineer if you are really an engineer. In my case, I did an engineer
school in electricity and electronics before I made a postgrade study in
software. Non-engineers who followed the same postgrade are not allowed
to use the title software engineer.

Greetings,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 24 '06 #42
"Laurent Bugnion" <ga*********@bluewin.chwrote in message
news:eT****************@TK2MSFTNGP03.phx.gbl...
Also, note that in Switzerland, you can only use the title software
engineer if you are really an engineer. In my case, I did an engineer
school in electricity and electronics before I made a postgrade study in
software. Non-engineers who followed the same postgrade are not allowed to
use the title software engineer.
No duck typing in Switzerland, then!

;-)

Cheers!

Chris.
Nov 25 '06 #43
>Useful for math and logic, not so much for GUI stuff which really
>requires
imperative programming.

I'm going to try to write some GUI programs and I'll see how F# compares.
Presumably C# is likely to come out on top when there is a big GUI and not
much under the hood?
Just a side note: One can use F# to write ASP.NET applications:
http://cs.hubfs.net/blogs/tomasp/arc...08/13/475.aspx
Project page: http://www.codeplex.com/fscodedom
Nov 25 '06 #44
Christopher Ireland wrote:
P.S. it would be great if ray tracer compiled with the latest publicly
available version of F#!
A new version of F# has just come out that can compile my ray tracer! :-)

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...for_scientists
Dec 3 '06 #45

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: user | last post by:
Hi all, At the outset, I regret having to post this slightly OT post here. However, I strongly feel that people in this group would be the best to advise me on my predicament. I am working as...
2
by: Matt | last post by:
I always heard dialet of programming language. For example, Objective-C is a dialet of C programming language. What does it really mean? C is already standardize, why there are dialets? Or when...
134
by: evolnet.regular | last post by:
I've been utilising C for lots of small and a few medium-sized personal projects over the course of the past decade, and I've realised lately just how little progress it's made since then. I've...
25
by: Dave | last post by:
I want to spend two minutes on my soapbox. I love C#. I am so productive in it it's ridiculous. But it's so easy to write code that uses poor design principles. Example: just making...
7
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already...
30
by: Jakle | last post by:
I have been googling, but can seem to find out about C GUI libraries. My main platform is Windows, but it would be nice to find a cross platform library. I've been programming with php, which...
29
by: SG | last post by:
Hi everyone, I am a complete novice at computers and programming and right now, all i need to know is that why do many people prefer C to C++? Is it just because they are used to using C and are...
111
by: Enteng | last post by:
Hi I'm thinking about learning C as my first programming language. Would you recommend it? Also how do you suggest that I learn it?What books/tutorials should I read for someone like me? Thanks...
14
by: deko | last post by:
For building Windows desktop apps, the clear favorite is C#. But my clients can't afford to buy Microsoft products. So I need to develop software for Linux users and web applications. In the...
17
by: CoreyWhite | last post by:
I bought this book years ago, when I was just learning C++. Since then I've gone through every math course offered at my college, taken courses on coding C & thinking in terms how how to make the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.