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 825837EEFA for ; Tue, 10 Nov 2015 15:40:46 +0100 (CET) IronPort-PHdr: 9a23:WECELxU2Z9mu/Y2KXWBPqpeFEFbV8LGtZVwlr6E/grcLSJyIuqrYZhyFt8tkgFKBZ4jH8fUM07OQ6PC9HzBdqsjf+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8CVP1gD2mT1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu3SNp41Rr1ADTkgL3t9pIiy7UGCHkOz4S48X2MaiBtLSyLC6xSyCpf8tCfgt+lVxC6COsywVbczQHKp6KI9GzHyjyJSNjs8+WfKh8g4iKNHsgimuxw3l4/QYZ2HLv1ifovSeNobQSxKWcMHBH8JOZ+1c4ZaV7lJBu1ftYSo4gJW9RY= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=ilitzroth@gmail.com; spf=Pass smtp.mailfrom=ilitzroth@gmail.com; spf=None smtp.helo=postmaster@mail-io0-f169.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ilitzroth@gmail.com) identity=pra; client-ip=209.85.223.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ilitzroth@gmail.com"; x-sender="ilitzroth@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of ilitzroth@gmail.com designates 209.85.223.169 as permitted sender) identity=mailfrom; client-ip=209.85.223.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ilitzroth@gmail.com"; x-sender="ilitzroth@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-io0-f169.google.com) identity=helo; client-ip=209.85.223.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ilitzroth@gmail.com"; x-sender="postmaster@mail-io0-f169.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0C0AADmAEJWm6nfVdFehA5vBoQPqmGFMYwQFwEJhSVKAoEyBzwQAQEBAQEBAQEQAQEBAQEGCwsJIS6CLoIHAQEBAwESER0BGxILAQMBCwYFCw0NHQICIgERAQUBChIGExIHCYd2AQMKCA2kP4ExPjGLSIFqgnmGUgoZJwMKVoNzAQEBAQEBBAEBAQEBAQEBARQBBQ6GRoR+gnGBSgEBS4IzOhOBMQWGCwyQMYUdiAmBW0mDd4MlkTgSJIEXESeCLyOBXj00g22BQQEBAQ X-IPAS-Result: A0C0AADmAEJWm6nfVdFehA5vBoQPqmGFMYwQFwEJhSVKAoEyBzwQAQEBAQEBAQEQAQEBAQEGCwsJIS6CLoIHAQEBAwESER0BGxILAQMBCwYFCw0NHQICIgERAQUBChIGExIHCYd2AQMKCA2kP4ExPjGLSIFqgnmGUgoZJwMKVoNzAQEBAQEBBAEBAQEBAQEBARQBBQ6GRoR+gnGBSgEBS4IzOhOBMQWGCwyQMYUdiAmBW0mDd4MlkTgSJIEXESeCLyOBXj00g22BQQEBAQ X-IronPort-AV: E=Sophos;i="5.20,270,1444687200"; d="scan'208";a="186946616" Received: from mail-io0-f169.google.com ([209.85.223.169]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 10 Nov 2015 15:40:45 +0100 Received: by iofh3 with SMTP id h3so2502534iof.3 for ; Tue, 10 Nov 2015 06:40:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=VwbkasPKcpfz+pjE4rvOOfjiwGXk4hPLB7bMvB7726c=; b=oBxvaN3mj29ceC0681N6iIy67N93ooL2BiwD2hV0uvqyZLLtubybEb/+AydXxWZYGp 6ahdLJCp79+FfUNh7IQrh7e5IuAoZD2Rktc8rb5VnIMYbVgHVl8Z/2F6iYDNMKSXrNpJ hSQcMbyf6CmTP3ljRRbEj7I0NG/nhqIut2VlnRYaZa2egLPrjY5V/McNNpynm305ul7z 2y1Hm6cY80IgLR2oU0wKINB9z4skOBWYXsGIXNt8tAIurID7NmkF5XRru+iJn146fDbE TG1oBBLriUE4Fr1jb5BUmOs5iBLQolPWIzBpFlClPTGNn4CXrclSc5thEtuVNYQNQ2HC InMQ== X-Received: by 10.107.10.233 with SMTP id 102mr3993431iok.31.1447166443837; Tue, 10 Nov 2015 06:40:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.32.17 with HTTP; Tue, 10 Nov 2015 06:40:24 -0800 (PST) In-Reply-To: <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> <20151110141133.GA13185@topoi.pooq.com> From: immanuel litzroth Date: Tue, 10 Nov 2015 15:40:24 +0100 Message-ID: To: Hendrik Boom Cc: OCaML List Mailing Content-Type: multipart/alternative; boundary=001a113ee3ecd0e2bb052430b154 Subject: Re: [Caml-list] Newbie comment on constructor syntax --001a113ee3ecd0e2bb052430b154 Content-Type: text/plain; charset=UTF-8 1) Recent c++ has several syntaxes for specifying types of functions, see e.g: http://en.cppreference.com/w/cpp/utility/functional/function 2) C++ has the equivalent of first class functions. One of the main problems of functional programming in C++ is that it doesn't really support composition of algorithms very well. This guy explains it very well: https://www.youtube.com/watch?v=BFnhhPehpKw Greetz, i On Tue, Nov 10, 2015 at 3:11 PM, Hendrik Boom wrote: > 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 > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --001a113ee3ecd0e2bb052430b154 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
1) Recent c++ has several syntaxes for specifying types of= functions, see e.g:
http://en.cppreference.com/w/cpp/utility/functional/f= unction

2) C++ has the equivalent of first class funct= ions.

One of the main problems of =C2=A0functional= programming in C++ is that it doesn't really
support composi= tion of algorithms very well. This guy explains it very well:
Greetz,
i
<= br>

On Tue, Nov 10, 2015 at 3:11 PM, Hendrik Boom <hendrik@topoi.pooq= .com> wrote:
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<= br> > 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<= br> have to specify the types of functions; it's that the syntax of types i= n
C++ is completely inside-out and insane.=C2=A0 I've been programming in= C
since the 70's and I *still* find it confusing.=C2=A0 OCaml type notati= on,
like Algol 68 type notation, is a breath of fresh air by comparison.

And of course, that C++ doesn't have first-class functions.=C2=A0 Or ha= s 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<= br> > 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 c= ode,
> 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 t= hat
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

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocam= l_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--001a113ee3ecd0e2bb052430b154--