caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Johan Grande <johan.grande@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] How to explain static typing to other people?
Date: Thu, 29 Aug 2013 18:00:01 +0200	[thread overview]
Message-ID: <521F7001.6090705@inria.fr> (raw)
In-Reply-To: <20130828114527.GA5713@siouxsie>

Le 28/08/2013 13:45, oliver a écrit :
> did you ever get the response, that one could use Java,
> when you talked about the static typing advantages of
> languages like OCaml or Haskell?

I haven't used Java in a while but if I remember correctly, although 
Java features static typing, it allows you to use not so safe tricks 
such as cast and null, while OCaml doesn't.

Moreover, OCaml allows to define complex types (and use them with 
pattern matching) very easily and thus makes you want to use the type 
system instead of trying to circumvent it.

type 'a option = Some 'a | None
How many lines to express that in Java?

OCaml's type inference is also very useful even if you choose to write 
some type information as good practice.

Last but not least, OCaml is a functional language. Well, I haven't 
tried Java 7.

-- 
Johan


      parent reply	other threads:[~2013-08-29 16:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 11:45 oliver
2013-08-28 12:18 ` Francois Berenger
2013-08-28 19:25   ` Raoul Duke
2013-08-28 19:40     ` oliver
2013-08-29 14:53 ` Florent Monnier
2013-08-29 16:00 ` Johan Grande [this message]

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=521F7001.6090705@inria.fr \
    --to=johan.grande@inria.fr \
    --cc=caml-list@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).