From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: Elisp containers Date: Sun, 09 Sep 2018 12:53:08 -0600 Message-ID: <875zze4i5n.fsf@tromey.com> References: <871sa5xdz2.fsf@tromey.com> <87d0tnvlkj.fsf@exinda.orion.oneofus.la> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536519119 3957 195.159.176.226 (9 Sep 2018 18:51:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2018 18:51:59 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) Cc: Tom Tromey , Stefan Monnier , emacs-devel@gnu.org To: Vladimir Sedach Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 09 20:51:55 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fz4oM-0000tK-Qb for ged-emacs-devel@m.gmane.org; Sun, 09 Sep 2018 20:51:54 +0200 Original-Received: from localhost ([::1]:48427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fz4qT-0004Xe-AP for ged-emacs-devel@m.gmane.org; Sun, 09 Sep 2018 14:54:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fz4pn-0004XY-3v for emacs-devel@gnu.org; Sun, 09 Sep 2018 14:53:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fz4pg-0004c4-F0 for emacs-devel@gnu.org; Sun, 09 Sep 2018 14:53:19 -0400 Original-Received: from gateway24.websitewelcome.com ([192.185.50.71]:21905) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fz4pb-0004ZE-SJ for emacs-devel@gnu.org; Sun, 09 Sep 2018 14:53:13 -0400 Original-Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 1D99B296B for ; Sun, 9 Sep 2018 13:53:10 -0500 (CDT) Original-Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id z4pZfXB0rkBj6z4pZfiqtk; Sun, 09 Sep 2018 13:53:10 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OrB3mCrrv6d24RQsZCr5fkOzwZtuxRRiKuvVZCO7UfQ=; b=bwm/c1UVEUo6zrWXWYqQiHSR+d iN6nI2jMawH5jfCfucBsHf1of8NIwfb/qb6YQtcg8vzDpqnept38LP3OKw3TBqdpfd4I1Wi4mrFfh fwpxyZLcGAkATRsQXemkdGAae; Original-Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:44236 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fz4pZ-002nOj-N0; Sun, 09 Sep 2018 13:53:09 -0500 X-Attribution: Tom In-Reply-To: <87d0tnvlkj.fsf@exinda.orion.oneofus.la> (Vladimir Sedach's message of "Sat, 08 Sep 2018 12:25:00 -0700") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.85.72 X-Source-L: No X-Exim-ID: 1fz4pZ-002nOj-N0 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-85-72.hlrn.qwest.net (bapiya) [75.166.85.72]:44236 X-Source-Auth: tom+tromey.com X-Email-Count: 21 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.50.71 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:229571 Archived-At: >>>>> "Vladimir" == Vladimir Sedach writes: Vladimir> One way to solve the problems of "which environment to start from?" Vladimir> and expensive copying is to implement environments as a fully Vladimir> persistent (AKA purely functional) table. This will let you do Vladimir> roughly the equivalent of fork(2) in a single address space quickly Vladimir> (with the real cost amortized over the whole system). One other consideration in this case is that one must apply the changes to the actually existing Emacs. Reading the portable dumper thread or the variable binding code makes this seem less possible. Though perhaps I am pessimistic. Vladimir> Virtualizing the environment with a shared heap is an IMO interesting Vladimir> idea that has not been well explored yet, but it requires a very Vladimir> different approach to Lisp system functions (they will all have to be Vladimir> based around immutable data structures) I should have mentioned immutable data structures. This seems like a difficult change as well. In practice I guess I would not worry too much about existing elisp code. Probably if one is reaching for threads or containers, one is willing to adapt one's code to immutability as well. But I wonder how it would be implemented. Tag bits are in short supply and there isn't leftover space in a cons for a flag AFAIK. Other types might not be as troublesome. >> Finally, this approach greatly reduces debuggability and the ability to >> mess around. Emacs would no longer be an open system -- threads would >> have private data and there would be no way to access that. Vladimir> The debugger could point to the environment of the thread from which Vladimir> it was invoked. The same could be done for REPLs. So the whole Vladimir> tool set would have to be changed to accommodate this virtualization. Thanks, this is a nice idea. Tom