From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Mattei Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: Scheme+ Date: Mon, 20 Dec 2021 10:20:41 +0100 Message-ID: References: <14e10823-2655-48c2-9736-383708da492e@www.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37768"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user , guile-devel Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Dec 20 17:26:26 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzLUX-0009hl-SX for guile-user@m.gmane-mx.org; Mon, 20 Dec 2021 17:26:25 +0100 Original-Received: from localhost ([::1]:47860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzLUW-0004AH-R7 for guile-user@m.gmane-mx.org; Mon, 20 Dec 2021 11:26:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzKbX-0006Gv-Ol; Mon, 20 Dec 2021 10:29:36 -0500 Original-Received: from [2607:f8b0:4864:20::331] (port=39522 helo=mail-ot1-x331.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzKbV-0003H2-6l; Mon, 20 Dec 2021 10:29:34 -0500 Original-Received: by mail-ot1-x331.google.com with SMTP id r10-20020a056830080a00b0055c8fd2cebdso12962634ots.6; Mon, 20 Dec 2021 07:29:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=W4uf13uDTE49QzeQTIP9IUB+eqAtqoX+ebxIlKHDzt8=; b=IKcCfcaPXR94cvNc/l8UvfrwUveT+NAkF6IQ3gqss3DowgZI2i9P8+OiYbR73gWYwp Ovg+4Cp2eZ2BuaO2w60ijyxyyQJgCn5kMDih4X0KTX2I/ZYy/8tjfhh188xaG6AZ7Yif 98uOn23JI1IbQ9GklXkCP/rJTG1l2WPTW+JAU35Cu7t0cwUh/4ttuxFqOYqlCBdRYxIT buR5wn63nzCdNz5S5nz2imzW6e8OMOvnZ9TuvU2UXrtU4AQOEkfNXfoPyWOG2HtmpwmF xqh89GGeV2ad6cgFxMpXekDR7+Or6RuWQuBAouPwnGufwZhrSMYB5/lYVQYqq5y3tXYw y5Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=W4uf13uDTE49QzeQTIP9IUB+eqAtqoX+ebxIlKHDzt8=; b=xjh5NaFe2ioB9GEwHrdvwnTg/FeqKpRLqjjLscbDbuN0kMNyy81J/1rqzeHIZpeufD +hI1zTU4vYtJpQTdREbv2Y0C+mbyEu4PHQaIiD0PABmZr0M7CyA1MNpEe9h4r+FkYkIg iMCqiIFoydcJo9XJfOIDYf6+5gB/WXx+QP68AgtuMawtltTV7c15lykKWCQyUPjJ1/NR 7Rtxn2LurDSk8XlpsBvDtxClSt4rQzqRipUk12JIGSuRO0ZDQ+eqUhx8uUAJnYJ2WSMm QN4aSQRg+ZofY5+NeIOxfcO5dmhV+pudOIUsx3ZIkDHkEJ4AxYQyKICNR6NhvtxblANH Itvg== X-Gm-Message-State: AOAM533eujoL5oDMP2S5Q6wU5Y8HZ0WatMSppwHY6aR4ZsaAcxL4NAU0 CYexwYGZlSOSACqEYlFLmLsQhJbN1OUESO0CXIM0EFTZ X-Google-Smtp-Source: ABdhPJx9bpZjlGH/Qoo7ei/E9B3lZqQxEQFayI7yQrVOXBI7jq5+EsA/6eC4nvxhUs8p2TeYbA0ivrqfJ9DPdDP2OTk= X-Received: by 2002:a25:d743:: with SMTP id o64mr20174764ybg.81.1639992052490; Mon, 20 Dec 2021 01:20:52 -0800 (PST) In-Reply-To: <14e10823-2655-48c2-9736-383708da492e@www.fastmail.com> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::331 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::331; envelope-from=damien.mattei@gmail.com; helo=mail-ot1-x331.google.com X-Spam_score_int: 2 X-Spam_score: 0.2 X-Spam_bar: / X-Spam_report: (0.2 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17887 gmane.lisp.guile.devel:21017 Archived-At: yes it is based on SRFI-105 as explained in section 7: Features. The project is based on R6RS (R5RS too) and SRFI for compatibility. Linus we had a discussion about bindings month ago and Scheme+ take in account the impossibility in Scheme to have a single operator for defining a variable anywhere . There is no more mutation in Scheme+ than in other code. If you code already use mutation with set! array-set! then Scheme+ encapsulate it with new and easy operator,that's all. Scheme+ is 100% compatible with R6RS and SRFI. I used it to convert a big code (see section 20:Scheme+ in action) and it worked at the first time. let/ec, which i did not knew, is not standardised but i will work on this,thank you for your advice. Scheme+ is really fast because macro are generally one step expanded ,or have recusivity depth of the size of the object (example array dim 3 , we recall three time the macro expansion) and on a compiled Scheme as Guile i'm not sure it is slower.(I could have done better as SRFI arrays which define a macro for each dimension 1,2,3,.... until a fixed number) If someone have counter example with call/cc or threads making fail Scheme+ i will do my best to fix that and improve it. This is only version 1.0. Damien On Mon, Dec 20, 2021 at 9:16 AM Linus Bj=C3=B6rnstam wrote: > Hi Damien! > > I played around with it and it seems to rely heavily on mutation, which > makes guile (and chez and racket for that matter) box the values. That ad= ds > a layer of indirection to memory access, meaning slower code (apart from > the more obvious problems of continuation safety and threading safety). I= t > could be partially fixed with a very much not fun to write syntax case > macro: you expand a body as far as possible into a letrec* (and > letrec-syntax) shadowing bindings when needed and use set! only in places > where bindings are not declared. > > The workhorse you need for that is syntax-local-binding. > > If you want this system to be resilient and work well with other scheme > code that is probably the path to go. One could imagining having a > procedure form that is fully expanded, analyzed and then > some-kind-of-CPS-transformed so that all variables are passed as state. > That way you would get continuation and thread safety, while allowing > something that seems like and, at least locally, behaves like mutation to > take place. > > This (the local mutation part) is tangential to something I have wanted t= o > write for a long time, but I have not had the time (nor intelligence). If > you want to discuss some ideas or have any question we can take this > off-list. > > Another thing would be to not use call/cc in the def form. Let/ec is a lo= t > faster. > > -- > Linus Bj=C3=B6rnstam > > On Mon, 20 Dec 2021, at 01:05, Damien Mattei wrote: > > Hi, > > I finished today the first version of Scheme+. > > Scheme+ is an extension of the syntax of the Scheme language. > > Scheme+ makes it easy the assignment of Scheme objects in infix (works > also > > in prefix) notation with a few new operators =E2=86=90 (or <-), [ ],= =E2=A5=86 (or <+) . > > > > Scheme+ does much more things,see: > > > > https://damien-mattei.github.io/Scheme-PLUS-for-Guile/Scheme+io.html > > > > or: > > > > > https://github.com/damien-mattei/Scheme-PLUS-for-Guile/blob/main/README.m= d > > > > static light HTML page: > > https://damien-mattei.github.io/Scheme-PLUS-for-Guile/Scheme+.html > > > > direct link to code and README: > > https://github.com/damien-mattei/Scheme-PLUS-for-Guile > > > > Best regards, > > > > Damien Mattei >