From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.devel Subject: a rehash of the question of optimizing some prompt ideoms Date: Fri, 30 Aug 2013 20:54:35 +0200 Message-ID: <2849568.naTrYEPBA4@warperdoze> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: ger.gmane.org 1377888901 14347 80.91.229.3 (30 Aug 2013 18:55:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Aug 2013 18:55:01 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Aug 30 20:55:04 2013 Return-path: Envelope-to: guile-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 1VFTqa-0005yN-5S for guile-devel@m.gmane.org; Fri, 30 Aug 2013 20:55:04 +0200 Original-Received: from localhost ([::1]:52006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFTqZ-00037t-SQ for guile-devel@m.gmane.org; Fri, 30 Aug 2013 14:55:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFTqR-00037Y-HM for guile-devel@gnu.org; Fri, 30 Aug 2013 14:55:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFTqJ-00056F-CM for guile-devel@gnu.org; Fri, 30 Aug 2013 14:54:55 -0400 Original-Received: from mail-lb0-x22e.google.com ([2a00:1450:4010:c04::22e]:42754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFTqJ-000565-3y for guile-devel@gnu.org; Fri, 30 Aug 2013 14:54:47 -0400 Original-Received: by mail-lb0-f174.google.com with SMTP id w6so2160406lbh.19 for ; Fri, 30 Aug 2013 11:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=ntZULz4aeF9S455DF/Ay/ar4e6tSrVj1qswenDsQc70=; b=J1E1bJy3/lTBR5K77Wcv8EV+Iy/NR9ygSw3XeXVLwVM6Ej8H8zjZ7Ycd7pQ40qgCor 3W5dLkRo8597/SNkG1pSoShscE6Ej9kW27Lo9P1xMKPrX//RiZgeFk/wLx1s/40coyg6 kpGGoiE8FQ6Zc2eJPH19cOYvvBjSRQxmVFZS4fxNDSRv2TK6NhomZlFjER1/ZbNIMN4/ 28yCSr5idOsdhIi8lldbH8Z2L4oyNepVqnRCmVCBAKSg6c8tzqC2DwlB3vmnOBlOCwIR 2lw3NYKdassowh4MSL5nyPrcU3JG8nF1U2gM2aTTrhXkeotSkQ3BcF0MjOSaF7h9lLJK G9nA== X-Received: by 10.152.19.70 with SMTP id c6mr9219402lae.25.1377888885201; Fri, 30 Aug 2013 11:54:45 -0700 (PDT) Original-Received: from warperdoze.localnet (1-1-1-39a.veo.vs.bostream.se. [82.182.254.46]) by mx.google.com with ESMTPSA id l1sm14543547lbj.14.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 Aug 2013 11:54:43 -0700 (PDT) User-Agent: KMail/4.9.5 (Linux/3.5.0-30-generic; KDE/4.9.5; x86_64; ; ) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16598 Archived-At: Hi all, In the wake of the wowely code Andy Mark and Noah have been producing I want to lift the question of what we can do to compile some delimeted continuation code effeciently. Delimeted continuations can be looked upon as a generalization of common lisps tagbody e.g. it's trivial to produce tagbody semantics with the help of prompts. Now a quesiton is how we should make sure that most sane code that can be compiled to goto's in the rtl backend really get that far. As I understand the cps compiler is well suited to take on this task. But we should not aim towards atgbody, but also generators and similar constructs. To see what kind of semantics to support maybe the code in https://gitorious.org/guile-coroutines/guile- coroutines/source/fc49d41dfa0cc0647aaeeddf8fb15d55dc2fb6ef:stis/coroutine.scm Can help as well as the example in the same repo, https://gitorious.org/guile-coroutines/guile- coroutines/source/fc49d41dfa0cc0647aaeeddf8fb15d55dc2fb6ef:stis/coroutine/test.scm So what can we do in rtl that we cannot do before? To note here is that in rtl we can basically allocate a region of the register space for e.g. a generator. The nice thing with rtl is that all functions are executed at the end of the register space and therefore we could basically use named gotos to jump between the different generators located at different stack areas. This is not possible in a stack based VM. So not only do we skip expensive function call's but tear down and setup of the stack is not needed. Of cause to be able to take advantage of this not all generators can be used in such a scheme. (It would be nice to get Academic references for this) but it should be doable. We would need some more one more instruction from RTL, namely named gotos. It's also perhaps possible to enlarge the ideas to separate where functions are evaluated and where the "local rigister area" of the generator is situated. E.g. An area allocated from the heap. But this lead to a complete redesign of RTL but it would could be a cool concept. WDYT?