Congratulations on the release of Beta 1! I have a question about Edit and Continue with F#, will it be supported with 2010? If so, what are the tricky parts of getting it working, specificly working around immutability.
And what happened to your blog?
can f# functions be made available as c#/vb extension methods? that one feature would increase the usefulness of f# for the avarage .net programmer like ten times
@35:00
that c# code could have been made a lot more compact with a linq statement when written in linq the f# and c# versions wouldnt look all that diffrent imo
But why would you do that when you can do it more naturally in F#? There are many things that you can do in C# that you can do in F#. In fact, Luke showed this over and over again when he was C# program manager. This is part of why he was the natural choice to PM F#... I'd argue that you should use the right tool for the job at hand. If you simply want to use the power of monadic query comprehensions in C# (exposed as LINQ syntax), then use LINQ in your C# or VB.NET. If you want to program in a functional style and use less syntax to get the job done, then F# is the natural choice. The fact that F# is a .NET language means you can use it for constructing algorithms that it lends a very helping hand for at composition time and then use any number of other .NET languages that are better suited for other compositional tasks.
C
well, that perticular part of code may be more convenient to write in f# but if your whole project is a c# project, the convenience of a single method might not be worth it compared to the effort of creating and integrating a new project right? it all depends how much code like that you have..
but thats not my point, my point was that this perticular c# code is not representative of what c# is capable of, i argue that a c# linq query is not hugely diffrent from the f# example shown. there are plenty of other examples where f# really do provide a compact bit of code that really isnt possible to write in c# (pattern matching for example), im just saying a scenario like that would make for a better example of the f# coolness
beeing able to write f# extension methods usable from c# would be a really great enabler for doing just what your saying, using the right tool for the write job. surely you dont disagree with at part of my post?
I'm not disagreeing. I'm simply asking questions.
hehe ok
i guess my awnser is that if most of my code is most easily written in c# but f# is more suitable for some parts, id make a c# project and pay the inconvecience of either integrating two projects or writing it all in c#
but if i can write the f# suitable parts in f# and expose them as extension methods, i dont have to choose at all
What's wrong with writing a shared library for, say, computation-heavy tasks, in F# and then using it in a C# (or VB.NET or whatever.NET) project?
I totally agree
I currently try to make usefull F# examples for the company that I currently work for. I use C# for creating stuff like front-ends, main architecture, etc. And I build shared F# libraries to perform the actual computations/data processing in such a way that it easily plugs into the main architecture... (thanks to the excellent support for OO design and .NET in F# )
I love F# because it allows me to focus on the complex problem that I want to solve, without being distracted by all the plumbing code in the background.
p.s.: Thanks to all the people at C9 for all the excellent F# video's!
nothing, i havent said that there is im just saying its a trade of with how much code we're talking about and how genericly applicable it is.. i mean you woudnt create a library just to be able to write one single specific method that is only used in one place in f#, espscially not if the penalty is of writing it in c# is so small. (comparing a c# linq statement with the equvalent f#). a generic library is another story
and again, beeing able to create extension methods in f# doesnt contradict what you're saying at all, it further enables it [im still not clear on if thats possible or not]