caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Modeling tool for OCaml?
Date: Sun, 4 Feb 2007 20:43:36 +0000	[thread overview]
Message-ID: <200702042043.37094.jon@ffconsultancy.com> (raw)
In-Reply-To: <1170614508.4843.12.camel@oxylin.no-ip.org>

On Sunday 04 February 2007 18:41, Julien Peeters wrote:
> I imagine that designing applications with functional languages is much
> different than with imperative ones.
>
> I was wondering on which points the difference is significant?

If you assume that by "imperative" you really mean "object oriented", as most 
of the main imperative languages are now OO (C++, Java, C# and Python), the 
difference is primarily that class hierarchies can often be represented more 
succinctly and efficiently using other constructs (like variant types) in 
functional programming languages like OCaml.

> Does common oriented object design patterns can be used with OCaml?

Most OO design patterns are redundant in OCaml. Basically, most OO design 
patterns solve problems creating by OO in the first place...

> And what, for a developer, is the work to do to change his way of
> thinking?

Try to write your programs using a minimal amount of mutation, replace all 
loops with higher-order functions, leverage trees and pattern matching 
whenever possible. Forget about the advanced features of OCaml (objects, 
polymorphic variants) to start with.

> I envisage to learn OCaml deeply and than I want to set the basis to do
> the change from imperative languages to functional ones.

Functional programming is often beneficial. I posted a simple OpenGL demo 
recently:

  http://www.ffconsultancy.com/free/bunny/

Although this is a very array-intensive program, operating on vertex and index 
arrays, it can still leverage functional programming by using the 
higher-order Array.iter and map functions extensively.

> P.S. : somebody have reference books which goes over this subject?

Yes, my book covers this subject (see my sig).

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


  reply	other threads:[~2007-02-04 20:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-04 15:33 Julien Peeters
2007-02-04 17:40 ` [Caml-list] " Robert Fischer
2007-02-04 17:56   ` Alwyn Goodloe
2007-02-04 18:41     ` Julien Peeters
2007-02-04 20:43       ` Jon Harrop [this message]
2007-02-04 23:30         ` skaller
2007-02-05 10:00       ` Stéphane DUPRAT

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200702042043.37094.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).