|
List Info
Thread: "ocaml_beginners"::[] The F#.NET Journal
|
|
| "ocaml_beginners"::[] The
F#.NET Journal |
  United Kingdom |
2007-04-17 13:47:55 |
|
Flying Frog Consultancy just started the F#.NET Journal, an on-line
publication composed of articles, example source code and tutorial videos
aimed at beginner programmers learning the F# programming language from
Microsoft Research:
http://www.ffconsultancy.com/products/fsharp_journal/?ob
Given the current explosion in the adoption of functional programming
languages, we're considering trying to mimic this success with an OCaml
Journal. If you'd be interested in subscribing, please let us know.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?ob
__._,_.___
.
__,_._,___
|
| Re: "ocaml_beginners"::[] The
F#.NET Journal |
  United States |
2007-04-17 14:16:33 |
|
I've got a few questions about F# as an OCaml programmer. Perhaps you
could give your thoughts.
1) How big is the F# community? Bigger or smaller than OCaml. I would
expect smaller, but perhaps it is an easier transition for people who
are grounded in the Microsoft world.
2) How seriously does Microsoft take F#? Do they take it into account
when planning the future of their platform, or is it something that's
just going to fade away once the researchers working on it stop
promoting it?
3) What are the performances differences between F# and OCaml. I would
expect F# to have similar execution speed (maybe a little slower) with
moderately higher memory usage.
4) I would expect it to be really trivial to write basic windows
applications with F#, right? And is deploying these applications to
different Windows machines simple because the Windows machines all have
.net?
Thank you,
Karl
__._,_.___
.
__,_._,___
|
| Re: "ocaml_beginners"::[] The
F#.NET Journal |
  United Kingdom |
2007-04-17 15:05:40 |
|
On Tuesday 17 April 2007 20:16, Karl Zilles wrote:
> I've got a few questions about F# as an OCaml programmer. Perhaps you
> could give your thoughts.
Excellent questions!
> 1) How big is the F# community? Bigger or smaller than OCaml. I would
> expect smaller, but perhaps it is an easier transition for people who
> are grounded in the Microsoft world.
I'm not sure but I've sold only 2 copies of OCaml for Scientists this week but
3 subscriptions to the F# Journal! Having said that, I am advertising the
journal any which way I can right now (tell everyone you know!).
My guess is that the F# community is roughly half the size of the OCaml
community but its members are used to paying for stuff. I also predict that
F# will overtake OCaml in popularity this year, mainly due to the publication
of 3 books (Foundations of F#, Expert F# and F# for Scientists) as well as
commercial software.
> 2) How seriously does Microsoft take F#? Do they take it into account
> when planning the future of their platform, or is it something that's
> just going to fade away once the researchers working on it stop
> promoting it?
Note that Microsoft Research Cambridge is very different from Microsoft. The
creator of F# (Don Syme) has many people in different groups within MSR
Cambridge using F#, so they will all want it to survive. They also have four
or five people working directly on F# now (including a few interns, who are
temporary). So they have quite some investment in it. Various groups inside
MS (e.g. XBox group, adwords group) are adopting F#.
> 3) What are the performances differences between F# and OCaml. I would
> expect F# to have similar execution speed (maybe a little slower) with
> moderately higher memory usage.
No easy answer. Pros:
1. The F# stdlib is vastly better written, often much faster (e.g. half the
allocation in the Set module) and safer (all tail recursive).
2. The .NET platform is optimized for C#, so F# code that looks like C# will
give "good" performance. That means that looping over arrays of floats is
fast, sometimes slightly faster than OCaml.
3. The F# top-level (called the "interactive mode") compiles to native code,
so it is typically 5x faster than OCaml's byte-code-interpreted top-level.
Cons:
1. F# is more generic than OCaml in many ways. It carries run-time type
information (which gives you type-safe marshalling, generic printing,
run-time type specializations etc.) which can be baggage.
2. Allocation is much slower than OCaml, largely because it has concurrent GC,
so allocation-intensive F# code is often 5x slower than OCaml (e.g.
n-queens). However, you get some performance back on an unloaded dual-core
machine because the GC runs concurrently with your program on the other CPU
core, and such programs often have a 1:2 load of GC vs main thread.
If your program can be parallelized then F# is a big win. Functional
programming lends itself very well to parallelism. We translated 15kLOC of
Presenta from OCaml/OpenGL to F#/DirectX and the whole program only required
4 locks to be thread-safe and concurrent.
> 4) I would expect it to be really trivial to write basic windows
> applications with F#, right? And is deploying these applications to
> different Windows machines simple because the Windows machines all have
> .net?
Yes. Windows Forms is trivial to use. There is a nice demo of that on our
site:
http://www.ffconsultancy.com/dotnet/fsharp/rule30/
Try running the exe on any machine with .NET 2 installed and see if it works.
AFAIK, it should.
You also have the opportunity to use lots of .NET libraries, e.g. for graphing
and charting.
Then there's 3D. This is currently a mess, IMHO. There was Managed DirectX
(MDX) but the word on the street is that it is being deprecated. Then there's
XNA, which is meant for games programmers and isn't really suited to
visualization (e.g. it takes over the screen). There's also Windows
Presentation Foundation (WPF), which is meant for graphic web designers and
works well with XAML but exposes some hideous imperativeness.
For the time being, I'm using MDX via a nice functional wrapper library (which
I'm going to describe in a journal article). Once you're past the nasty
stuff, it is just beautiful. I can now describe a 2D or 3D scene
declaratively, as you would in Mathematica:
Triangle((-1., 0., 0.), (0., 1., 0.), (1., 0., 0.));;
and the F# interactive session automatically spawns a window (running on a
separate thread) that renders the scene in real time, with interactive
control and export to PNG.
Words cannot express just how cool that is. Beats Mathematica and Matlab hands
down. =
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?e
__._,_.___
.
__,_._,___
|
| Re: "ocaml_beginners"::[] The
F#.NET Journal |
  United Kingdom |
2007-04-18 09:51:55 |
|
On Wednesday 18 April 2007 14:52, Peng Zang wrote:
> Though I have used OCaml for small code snippets on and off for the past
> few years, I have only now begun the transition to making OCaml my primary
> language and plan on using it for my PhD work.
Alas, I was too slow to learn OCaml in time for my PhD. I have been pimping it
aggressively ever since though.
> I have some concern however, towards its sustainability.
I really wouldn't worry. A proportion of the OCaml community, including Xavier
himself, have a history of projecting the demise of OCaml but it will only
really demise when it is superceded by ocamlp3l.
In reality, OCaml code remains compilable for a lot longer than many other
languages, including C++ and Python.
> A robust
> community and large user base are important to that end. In otherwords, as
> sad as it may be, generally speaking, a language needs some minimal level
> of popularity. Especially recently, many functional programmers (and
> would-be functional programmers) seem to have been turning to Haskell
I hear that a lot but I don't believe it is true. There are a few people in
the Haskell community who make assertions like that but they just don't seem
to be backed by any facts. From my point of view, Haskell has always been
roughly as popular as OCaml and the next FPL. Indeed, do a Google fight
for "haskell code" vs "ocaml code" and they both get ~45k hits.
The only FPL that is significantly more popular is Lisp, but that is a family
of languages.
> and now you project F# to eclipse OCaml in popularity by the end of the
> year.
Yes. Note that this prediction does not imply that OCaml will become less
popular. Indeed, I suspect OCaml will become more popular as F# broadens the
market. For example, the release of Practical OCaml sparked a great deal of
interest in OCaml and sales of my own OCaml book quadrupled. When you're
dealing with markets this small, they don't compete.
> That concerns me, but I don't have much background. How actively is OCaml
> developed these days?
Several releases every year.
> How large is the user base and are they active in terms of usage and
> contributions the community code base?
There are new bindings to the latest FFTW:
http://sourceforge.net/projects/ocaml-fftw/
New bindings to OpenGL 2.1:
http://glcaml.sourceforge.net/
Updates to many data structures in the past 6 months:
http://www.lri.fr/~filliatr/ftp/ocaml/ds/
and many more active projects. So I don't think OCaml is going anywhere. 
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?e
__._,_.___
.
__,_._,___
|
[1-4]
|
|