From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p089j8Bu029415 for ; Sat, 8 Jan 2011 10:45:08 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArwAAHPAJ03RVdivkGdsb2JhbACDd6BECBYBAQEJCRMRBCClB4k8PIIVhFIuhWYBAQMFgRyDN3QEiwo X-IronPort-AV: E=Sophos;i="4.60,293,1291590000"; d="scan'208";a="94816391" Received: from mail-qy0-f175.google.com ([209.85.216.175]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 08 Jan 2011 10:45:03 +0100 Received: by mail-qy0-f175.google.com with SMTP id 8so144931qyk.6 for ; Sat, 08 Jan 2011 01:45:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=kLus1ZMJMjgK7BHbI6kYOfNPnAlw9DRb8OA0ZEOnvgc=; b=v99/tDHMNKT6HaFTOdviMFXX4NjG/0Tif1zwR9+98m8FobsWvTg3Ol5huC+Z+D9LZJ Fad2YbqIeAhMIWT+f99dpiVH+nIBAmSTJzA3dJ+QqPb87GWAkWUxuHwhyGaDTj1YOwn/ XN37SgRuCF9I9Aj8gFbYpBi1jHoCnU8egKWq8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=TgRYEQUi9258JK+sLWRqg7aT40RD2WQqvjPIGEZidF20+fNp9evKvxc2ny/kKi/Gnr ljeYDfeub67p5STGDz42hIb6yI6QHaakA3wFkssZoaIPwzaucWKDJSDoC62508OhZiQ3 pgbu1jqq4pyTeJxwAJXEC8+BPwehV9GCjXzSc= Received: by 10.229.186.2 with SMTP id cq2mr1886534qcb.109.1294479903296; Sat, 08 Jan 2011 01:45:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.94.207 with HTTP; Sat, 8 Jan 2011 01:44:43 -0800 (PST) In-Reply-To: <41A45D6B-C556-4D60-BA6F-423B60E3A137@univ-orleans.fr> References: <699537.6718.qm@web111509.mail.gq1.yahoo.com> <41A45D6B-C556-4D60-BA6F-423B60E3A137@univ-orleans.fr> From: Jesper Louis Andersen Date: Sat, 8 Jan 2011 10:44:43 +0100 Message-ID: To: David Rajchenbach-Teller Cc: Damien Doligez , Dario Teixeira , caml-list@inria.fr Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Purity and lazyness On Fri, Jan 7, 2011 at 17:38, David Rajchenbach-Teller wrote: > Correct me if I'm wrong, but I wouldn't classify Erlang as "pure": sending and receiving messages -- which are two of the most important primitives in Erlang -- are definitely side-effects. > Also, asynchronous error-checking, Mnesia, etc. look quite impure to me. Right. Erlang with only the sequential primitives present is not pure either. There is a process_dictionary which is essentially a state for the process. Erlang programmers tend to avoid it, but it is used by some of the standard libraries. Keeping random seed state for instance. If you remove the process dictionary, then there is ETS, the erlang term storage (in use as the backend for mnesia). ETS is not pure either, it is essentially a finite map from erlang terms to erlang terms. Ok, strip out ETS. Then we have exceptions :) Exceptions are, to the best of my knowledge, yet another computational effect. And then there are all the concurrency primitives... -- J.