unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Linus Björnstam" <linus.internet@fastmail.se>
To: "Damien Mattei" <damien.mattei@gmail.com>,
	guile-user <guile-user@gnu.org>,
	guile-devel <guile-devel@gnu.org>
Subject: Re: Scheme+
Date: Mon, 20 Dec 2021 09:15:49 +0100	[thread overview]
Message-ID: <14e10823-2655-48c2-9736-383708da492e@www.fastmail.com> (raw)
In-Reply-To: <CADEOadfSqmtx7m7bZaNmGgyigdLbwNCKVrH2xDAA+Vf=ciqORw@mail.gmail.com>

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 adds a layer of indirection to memory access, meaning slower code (apart from the more obvious problems of continuation safety and threading safety). It 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 to 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 lot faster.

-- 
  Linus Björnstam

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  ← (or  <-), [ ],⥆ (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.md
>
> 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



  parent reply	other threads:[~2021-12-20  8:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20  0:05 Scheme+ Damien Mattei
2021-12-20  7:22 ` Scheme+ Dr. Arne Babenhauserheide
2021-12-20  8:15 ` Linus Björnstam [this message]
2021-12-20  9:20   ` Scheme+ Damien Mattei
2021-12-20 17:33   ` Scheme+ Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14e10823-2655-48c2-9736-383708da492e@www.fastmail.com \
    --to=linus.internet@fastmail.se \
    --cc=damien.mattei@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).