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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 615CF7EEFA for ; Tue, 10 Nov 2015 15:11:36 +0100 (CET) IronPort-PHdr: 9a23:RHNIRB2iWPTjYU93smDT+DRfVm0co7zxezQtwd8ZsegVI/ad9pjvdHbS+e9qxAeQG96LtrQY1qGL7ejJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6PyZjqnL3ss7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cY6Lod8JtLWKD+OqA5VqBwDTI8Mmlz6te4mwPESF6v630QSGQV2jBPBA2NuBH3WJvrsyjSqu1l3yjcJcrxVPY/XjH0vPQjcwPhlCpSb21xy2rQkMEl1K8= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=hendrik@topoi.pooq.com; spf=None smtp.mailfrom=hendrik@topoi.pooq.com; spf=None smtp.helo=postmaster@april.topoi.pooq.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of hendrik@topoi.pooq.com) identity=pra; client-ip=69.165.131.134; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="hendrik@topoi.pooq.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of hendrik@topoi.pooq.com) identity=mailfrom; client-ip=69.165.131.134; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="hendrik@topoi.pooq.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@april.topoi.pooq.com) identity=helo; client-ip=69.165.131.134; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="postmaster@april.topoi.pooq.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B3CADd+UFW/4aDpUVehFcBgwO9WYYQAoF3EQEBAQEBAQEBgQmCLoIHAQEBAwE6RAsLGAklDwUYXYgNCMJ1AQEIAiGLUoQ7AQFqgn2BFQWOEYg3jR4IXX6EQIMlkwU3LIQiIIQhgUEBAQE X-IPAS-Result: A0B3CADd+UFW/4aDpUVehFcBgwO9WYYQAoF3EQEBAQEBAQEBgQmCLoIHAQEBAwE6RAsLGAklDwUYXYgNCMJ1AQEIAiGLUoQ7AQFqgn2BFQWOEYg3jR4IXX6EQIMlkwU3LIQiIIQhgUEBAQE X-IronPort-AV: E=Sophos;i="5.20,270,1444687200"; d="scan'208";a="186940412" Received: from topoi.pooq.com (HELO april.topoi.pooq.com) ([69.165.131.134]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Nov 2015 15:11:34 +0100 Received: by april.topoi.pooq.com (Postfix, from userid 1001) id 5E5861A0452; Tue, 10 Nov 2015 09:11:33 -0500 (EST) Date: Tue, 10 Nov 2015 09:11:33 -0500 From: Hendrik Boom To: caml-list@inria.fr Message-ID: <20151110141133.GA13185@topoi.pooq.com> References: <87pozk6vjp.fsf@mid.deneb.enyo.de> <0F7D3B1B3C4B894D824F5B822E3E5A172CE3E747@IRSMSX102.ger.corp.intel.com> <56407297.2060309@frisch.fr> <564076EA.7020805@mpi-sws.org> <5640D8E0.6060102@lexifi.com> <5640E2EF.7070400@mpi-sws.org> <0F7D3B1B3C4B894D824F5B822E3E5A172CE3ED02@IRSMSX102.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A172CE3ED02@IRSMSX102.ger.corp.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] Newbie comment on constructor syntax On Tue, Nov 10, 2015 at 08:27:52AM +0000, Soegtrop, Michael wrote: > Dear Ocaml Users and Developers, ... ... > > Another note: it was suggested in this mail thread to enforce type > specifications for function arguments to make the life of beginners > easier. I would rather not do this. A functional language lives from > function arguments and in many cases it is clear what it is and being > forced to write this down would be just a nuisance. I enjoy the > flexibility to give the types only at interface functions and to leave > it away in internal functions where it is clear. People coming from > C++, where functional style programming is turned done a lot by the > heavy syntax required to write down what you want, will definitely > enjoy this. Please, the problem with C++ for functional programming isn't that you have to specify the types of functions; it's that the syntax of types in C++ is completely inside-out and insane. I've been programming in C since the 70's and I *still* find it confusing. OCaml type notation, like Algol 68 type notation, is a breath of fresh air by comparison. And of course, that C++ doesn't have first-class functions. Or has that changed recently? > What might help to make the life of beginners easier is to > have a compiler option to print the types of all defined functions. I > think many people don't start with ocamltop, but with the compiler. In > my case I started a project where I thought it is likely easier to > learn Ocaml and to write it in Ocaml than to write it in C++. Such > projects you don't start with ocamltop. But for high reliability code, > it would make sense to have a compiler option to enforce full type > specifications of all arguments. In any case, the problem with OCaml's apparent typelessness isn't that you don't have to write the types, it's that when you see someone else's code you can't read the types. --- hendr9ik