From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id BE282820A1 for ; Thu, 29 Aug 2013 18:00:03 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.89,984,1367964000"; d="scan'208";a="25132080" Received: from htr06-1-82-227-229-32.fbx.proxad.net (HELO [192.168.0.3]) ([82.227.229.32]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 29 Aug 2013 18:00:03 +0200 Message-ID: <521F7001.6090705@inria.fr> Date: Thu, 29 Aug 2013 18:00:01 +0200 From: Johan Grande User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: caml-list@inria.fr References: <20130828114527.GA5713@siouxsie> In-Reply-To: <20130828114527.GA5713@siouxsie> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] How to explain static typing to other people? 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