Malcolm, On Mon, Apr 12, 2010 at 12:04 PM, Malcolm Greene <[email protected]> wrote: > Bob, > > Why your interest in F# over a more established and cross-platform > language like Python?
I have at various times gotten into Python and Ruby and like them both as far as they go. I have a slight preference for Ruby, mainly because I like its syntax and dynamic object model a little more. Python's philosophical emphasis on feature minimalism is a virtue to a point, but I don't view it as so compelling that my search for new language is over. F# interests me because of its semantic support for functional as well as imperative programming styles. Ocaml, its progenitor, has been around at least as long as Python, and many of its innovations have made way into .NET via F#. (Haskell has been another more subtle influence... if you know what a monad is, you're close to grokking what LINQ expression trees are trying to do.) Ocaml has demonstrated in real-world applications the virtue of being able to use whichever (of the two styles) works best for a particular problem, and it's optimizing compiler with strong type inferencing generates native code that rivals the best C/C++ compiler technology. Similarly, F# compiles code that is as fast as C# but with syntax that is very lightweight by comparison, relying on type inferencing to give both the syntactic convenience of dynamic languages and the type safety guarantees of strictly or statically typed languages. I like F#'s language-oriented programming features such as quotations, which allow you to treat chunks of F# code as data and pass them around for processing or transformation at a later time (or even on another machine) using active patterns, and the incorporation of lex/yacc clones for the language. Ocaml has similar features, but it's not got reflection or dynamic compilation to quite the degree F# offers on the CLR. Speaking of patterns, once you get your head around patten matching as a syntactic feature of a language, you'll not be able to imagine how you got about without it before! Computation expressions make it possible to build powerful abstractions in the language, such as the out of the box support for "asynchronous workflows" and sequence statements. (Python's list comprehensions are a form of this, but in F# you can define your own such language features.) Asynchronous programming is a particular strength of F# over, say, Python and Ruby. The ability to write computationally complex \programs with relative syntactic ease of expression is a big deal in an increasingly multi-core world. Don't get me wrong: I don't expect most programmers to be enamored of F#. It's syntax, and the very idea of blending computational paradigms in one semantics, is probably a bit over the top for folks who just want to build business apps. What I am pondering is creating an evolutionary successor to FoxPro using F# to do it, targeting Mono (and .NET), and picking a UI toolkit that just seems "right" for the task. While it could compete in the same space I suppose as Ed's Dabo, I am actually looking at it as more of a language for computational finance and scientific computing involving distributed architectures. If a relatively "programmer friendly" language backed by that kind of power were available for general development, I think people might go for it. Maybe, enough even to make it worthwhile. I became a believer in F# last year when I created a stock analysis and trading execution system involving just IQFeed and OptionsXpress XML API in just a few months that would have been much harder to do in C#/Java/C++, with real-time data-intensive analysis features that would have been impossible to build without a lot more development time. Knowing FoxPro's (UI threading) limitations, there is absolutely no way I could have built it in FoxPro. But, I can imagine a language to make what I built even easier to conceive that might look a lot like FoxPro. BTW, if you like Python, Mono's Boo borrows many fine concepts from Python and does some interesting things with them on Mono. One of Boo's claim to fame is it makes creating DSLs (Domain Specific Languages) relatively easy. So, Boo interests me as well. But I'm totally smitten by F# for the aforementioned reasons. :) - Publius > > Malcolm > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

