From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Phil Hagelberg Newsgroups: gmane.emacs.devel Subject: Re: Kickstarter for Emacs Date: Wed, 25 Apr 2012 16:33:52 +0000 Message-ID: <8762cnahzj.fsf@hagelb.org> References: <87wr5dfm9v.fsf@gnu.org> <87398118ys.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1335371731 27285 80.91.229.3 (25 Apr 2012 16:35:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 25 Apr 2012 16:35:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 25 18:35:30 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SN5Bh-0002lv-DP for ged-emacs-devel@m.gmane.org; Wed, 25 Apr 2012 18:35:29 +0200 Original-Received: from localhost ([::1]:39839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SN5Bg-0003Z1-HD for ged-emacs-devel@m.gmane.org; Wed, 25 Apr 2012 12:35:28 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SN5Ba-0003YH-SF for emacs-devel@gnu.org; Wed, 25 Apr 2012 12:35:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SN5BU-00044f-G8 for emacs-devel@gnu.org; Wed, 25 Apr 2012 12:35:22 -0400 Original-Received: from caiajhbdccac.dreamhost.com ([208.97.132.202]:49327 helo=homiemail-a20.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SN5BT-0003tZ-2g for emacs-devel@gnu.org; Wed, 25 Apr 2012 12:35:16 -0400 Original-Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id 32A017EC060; Wed, 25 Apr 2012 09:35:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=hagelb.org; h=from:to:cc:subject :references:date:in-reply-to:message-id:mime-version: content-type; q=dns; s=hagelb.org; b=zMO3HVFjKc9wU1KK1jRAXT9DAAl pw3Mb9rNWitNgJl+oK/A98D03NnBi7WzWz0ZYSR+8uCy90QxJjUE4X2vUwJGZTG1 egzb+CHd4KPn561w8OrDImhYmt1RDpiirBE9x6PFXVd6Y4FJWLsnJJBorHmvF6LA szRVOTXxS5M/y4hY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=hagelb.org; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version: content-type; s=hagelb.org; bh=VB5kYvaACmNncNedcWLLyasXYtQ=; b=i sutnfxajBe7BabrHXOv0tvKSjjt1i0WevvRn/nHua1JLpcJ5BeocYmL1Y/y73/lS xA1Y+O5FlVTama0ZydYwPXs45wvuKhhIlcLcfWevzFQ5lY0Z9ShT30+GKCCfjs40 mxt7S0HZ0q/LdUWpibQxFz4C/QprnUsCp8fDB7hmZ8= Original-Received: from enigma (71-23-19-98.war.clearwire-wmx.net [71.23.19.98]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: send@technomancy.us) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id 6E37B7EC064; Wed, 25 Apr 2012 09:35:06 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 23 Apr 2012 22:01:13 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.97.132.202 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:150010 Archived-At: Stefan Monnier writes: >>> The problem still remains: what would be the benefit? >> I must confess this is difficult for me to express, simply because >> it's something I've taken for granted for so long; it's like being >> asked why I like garbage collection. Anyhow, the most obvious benefit >> would be that you have a chance at writing code that you know will >> function correctly while run concurrently. =) > > I'm an academic working in functional programming and type systems, so > you don't have to convince me of the general virtues of > side-effect-free code. > > So my question is specifically in the context of Emacs where you need to > balance the theoretical benefits against the downsides (mostly > incompatibilities and efforts that could be spent elsewhere). I guess the main specific benefit (beyond the general "easier to write functions you know are correct") is that once you introduce concurrency, you will need a way to share data between different threads. Shared mutable state is very very difficult to get right; in order to avoid race conditions you must construct complex, error-prone, and non-composable locking strategies and adhere to them rigidly. Another option of course would be to force all cross-thread communication to go through channels that cause data to be copied, but this would probably feel unnatural and would be difficult to enforce in addition to being more expensive. The benefit in Emacs as it is today might not be too clear, but I believe this to be an important step to take as we move into the concurrent world. -Phil