Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

All extremists should be taken out and shot.


devel / comp.lang.scheme / Help with modify tinyscheme to do late binding of unbound variable to a foreign func

SubjectAuthor
* Help with modify tinyscheme to do late binding of unbound variable toLloyd Konneker
`* Re: Help with modify tinyscheme to do late binding of unboundLloyd Konneker
 `- Re: Help with modify tinyscheme to do late binding of unboundJeff Peck

1
Help with modify tinyscheme to do late binding of unbound variable to a foreign func

<a902ccce-8a91-4540-994a-c80d256239ffn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=63&group=comp.lang.scheme#63

  copy link   Newsgroups: comp.lang.scheme
X-Received: by 2002:a37:9445:: with SMTP id w66mr14857096qkd.410.1625500533790;
Mon, 05 Jul 2021 08:55:33 -0700 (PDT)
X-Received: by 2002:aca:d58f:: with SMTP id m137mr10097591oig.34.1625500533641;
Mon, 05 Jul 2021 08:55:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.scheme
Date: Mon, 5 Jul 2021 08:55:33 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2605:a601:a621:1800:e077:35dd:785:ed22;
posting-account=6tgp3QoAAABjRARvt3B0hzSi10AI4y4B
NNTP-Posting-Host: 2605:a601:a621:1800:e077:35dd:785:ed22
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a902ccce-8a91-4540-994a-c80d256239ffn@googlegroups.com>
Subject: Help with modify tinyscheme to do late binding of unbound variable to
a foreign func
From: konnekerl@gmail.com (Lloyd Konneker)
Injection-Date: Mon, 05 Jul 2021 15:55:33 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Lloyd Konneker - Mon, 5 Jul 2021 15:55 UTC

I am hacking at the TinyScheme interpreter that is embedded in the GIMP open source image editing app.

Is this an appropriate forum to get help? or please point me to a more appropriate forum.

The idea is that whenever an unbound variable is encountered and the name exists in the GIMP API, create a foreign function object and bind it to the symbol in the global environment.

In C code of the tinyscheme interpreter, at the point the interpreter determines a symbol is unbound, more or less:

scheme_define (sc,
sc->global_env,
symbol,
sc->vptr->mk_foreign_func (sc, script_fu_marshal_procedure_call);

and then simply use the new binding as it would have been used if it was found in the first place.

Where symbol is an object of the interpreter ( type field is T_SYM and name field is "gimp-drawable-desaturate") and where script_fu_marshal_procedure_call is a foreign C function.
It seems to work, but right after the TS interpreter calls the foreign func, the symbol object is trashed: its name field is garbage. Whereas I expected it to still exist.

Probably just a stupid programming error, but is the concept sound?

Re: Help with modify tinyscheme to do late binding of unbound variable to a foreign func

<3878dc53-5daa-4b99-b899-298489aceb91n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=64&group=comp.lang.scheme#64

  copy link   Newsgroups: comp.lang.scheme
X-Received: by 2002:a05:620a:126e:: with SMTP id b14mr20032769qkl.36.1625582185243;
Tue, 06 Jul 2021 07:36:25 -0700 (PDT)
X-Received: by 2002:a9d:7ad7:: with SMTP id m23mr15763648otn.138.1625582184950;
Tue, 06 Jul 2021 07:36:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.scheme
Date: Tue, 6 Jul 2021 07:36:24 -0700 (PDT)
In-Reply-To: <a902ccce-8a91-4540-994a-c80d256239ffn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2605:a601:a621:1800:d951:854b:950d:81ee;
posting-account=6tgp3QoAAABjRARvt3B0hzSi10AI4y4B
NNTP-Posting-Host: 2605:a601:a621:1800:d951:854b:950d:81ee
References: <a902ccce-8a91-4540-994a-c80d256239ffn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3878dc53-5daa-4b99-b899-298489aceb91n@googlegroups.com>
Subject: Re: Help with modify tinyscheme to do late binding of unbound
variable to a foreign func
From: konnekerl@gmail.com (Lloyd Konneker)
Injection-Date: Tue, 06 Jul 2021 14:36:25 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Lloyd Konneker - Tue, 6 Jul 2021 14:36 UTC

Nevermind, and sorry to pollute the forum. It was my stupid programming error.

Re: Help with modify tinyscheme to do late binding of unbound variable to a foreign func

<46fe51e6-ebed-464c-a677-27d3b9461bbdn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=135&group=comp.lang.scheme#135

  copy link   Newsgroups: comp.lang.scheme
X-Received: by 2002:a37:a52:0:b0:67b:3225:4aaa with SMTP id 79-20020a370a52000000b0067b32254aaamr21043756qkk.525.1648577265651;
Tue, 29 Mar 2022 11:07:45 -0700 (PDT)
X-Received: by 2002:a25:ab81:0:b0:633:c474:9330 with SMTP id
v1-20020a25ab81000000b00633c4749330mr28249251ybi.383.1648577265182; Tue, 29
Mar 2022 11:07:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.scheme
Date: Tue, 29 Mar 2022 11:07:44 -0700 (PDT)
In-Reply-To: <3878dc53-5daa-4b99-b899-298489aceb91n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=73.241.233.237; posting-account=34lL-AoAAAC40SpJskQI8JbPXhCffzlL
NNTP-Posting-Host: 73.241.233.237
References: <a902ccce-8a91-4540-994a-c80d256239ffn@googlegroups.com> <3878dc53-5daa-4b99-b899-298489aceb91n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <46fe51e6-ebed-464c-a677-27d3b9461bbdn@googlegroups.com>
Subject: Re: Help with modify tinyscheme to do late binding of unbound
variable to a foreign func
From: jpeckj@gmail.com (Jeff Peck)
Injection-Date: Tue, 29 Mar 2022 18:07:45 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 6
 by: Jeff Peck - Tue, 29 Mar 2022 18:07 UTC

Oh, good!
So maybe I'm not the last person on the planet using TinyScheme/script-fu on GIMP.

Since you have been into the source code, I wonder if you are able to get the gimp-server working?
I did quick hack with emacs comint-mode to send the header-bytes and text, but gimp-server just hangs/dies.
[the window "Console" is painful to use... so integrating with emacs would be super nice]

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor