From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Dr. Arne Babenhauserheide" Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] add language/wisp to Guile? Date: Wed, 15 Feb 2023 09:36:23 +0100 Message-ID: <87a61fjp6i.fsf@web.de> References: <87h6w2fkz8.fsf@web.de> <877cwxe4ar.fsf@web.de> <2f7d015d-ceb4-ef8f-b4fe-b69e39b723f8@telenet.be> <87357ldqaq.fsf@web.de> <1a70460e-11fb-9f5d-0d5f-1eb507d5af0d@telenet.be> <87ilg4j65e.fsf@web.de> <87edqsj5vt.fsf@web.de> <01212259-37dd-5d67-7bbc-101e01d96d01@telenet.be> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15394"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.13; emacs 28.1 Cc: guile-devel@gnu.org To: Maxime Devos Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Feb 15 09:42:06 2023 Return-path: Envelope-to: guile-devel@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 1pSDMb-0003lR-SI for guile-devel@m.gmane-mx.org; Wed, 15 Feb 2023 09:42:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSDMQ-0004YZ-Ui; Wed, 15 Feb 2023 03:41:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSDMP-0004YQ-Mt for guile-devel@gnu.org; Wed, 15 Feb 2023 03:41:53 -0500 Original-Received: from mout.web.de ([212.227.15.14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSDMN-0000IR-Fc for guile-devel@gnu.org; Wed, 15 Feb 2023 03:41:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1676450508; bh=GAvgRO5CGAUPAqWOVzua/giUwL8gST2ZgdxegK/A+Pk=; h=X-UI-Sender-Class:References:From:To:Cc:Subject:Date:In-reply-to; b=Vwi6pLdfL+LGDyh2nAs+oGGWkXea+ju/n56MGTmUzHkzqt0tygKSFNnLZgSRq21jg WMxy8RJkhj+7DSMwjse5F+/4lY0qvVvcgsjIn4SylMOHURQM0wnB3/5CJjd436pPLp jGGwVeIHFqmQGaUs7JnPtSI9Z1Ryhf2fAtmZEOlZoT+S17s9QW+vNbSUfFTJkUiiwP 20OtCjAY053blxse9MFrY4qqIAp6RwIBtEcilfoB0XLzKtpyPvkUKuOO/PbQQUhtge DtG6+EAu7aff18X0ZFRo6OxMN63af3LhDvonnfSc2ULofwezWvJWp4NRXD1AEviEj+ QFkILMwxm4VhQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from fluss ([84.149.95.143]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MzkST-1og0Uf1M6D-00viib; Wed, 15 Feb 2023 09:41:48 +0100 In-reply-to: <01212259-37dd-5d67-7bbc-101e01d96d01@telenet.be> X-Provags-ID: V03:K1:TIJz9KadUGSQv+3zJJvmf4YR5rstYIZPvCAWsgt5AKO1AUnntJK P1VwfxQYYwn/BzHj24bj6PCqjsZ1EVaRfYtoA2b4IFxo+GiLdPhrmwJv5AMla71juNTWtOD xwbWpW0OFvuucVz8WmI/fgASmUmJfGGh5WHtE1X8pE2DBOY8R7gZspzHO9FQTo3TxKDIxlb CZVjeELPADYJVfgUf29rA== UI-OutboundReport: notjunk:1;M01:P0:02q5qzb8n8I=;rS8hIDTkQ/AHfx6V3/sk0dVd4j9 0wovq3Cay8FgavKjpcqZ079t+e9c0EnJp9JaenY7s1LFmp0icgF3vgREUauUHuUVURM8gP2sU Yh1OuGqquVgJJaKks5sa5nmb2UoXkiWvZI38tugSvL8khtttXE6A7/o/qY/AdNNlj7wjsMFgH tGOHG/P/DEJmAoqc7WcEzulzu6Ufh0F5PIxRYmyCek/8QwLW5mSgrZn0GxgO3bc6k3CAiwusq GHu/I8U1hJnISa2ZLOB7reBtJC62zFrnQ0urKDgLoKXuYyM6oS1ULK83wh9xhqnFQRevDhPBA dhSwslrWP9rQQ4wRegTJijlXI1+XDMC2RzclzwUc/2CyVu8omvhi4vT0cLlabRmsERxdg+RcS T31/uRUWsigMry0aUUK/rAfbA0TinK1/8tgCaJSKwTlzAL2iYt8VX+n6vb1oyg+SDvN44X/fs mvRUudf8jVusf0DzJWQe/ifsBVuDIOLyYFiUCZyhxjGl9h1Wp7u6cH2GKyhlXQtp5DdSHPOfM Jljvtz7OtaKg4P9jAtDJh/A/SYMHTvpdQM7SIZb7EDmG+nBGBAzjSQ3urljNiBQYg9nMbv8AK sEGdz8V1KQ+cXchr6VZMhv79tFh1mlK7pmmEUwN8F0U2c7kmeEx5vH76V1CodD1lEyDB51rHj pKioE8Sce713UX9qoUNdzZuuKiRuZSb33Y+8KYdJlE4MTUGnZOrDHiaM3ldddpzZRKH82sE8b 2UGDFMIhdiZ2/S7+Ik2f8OUlwODmXaEnrQOCyIZhlTs7pZH2OXxrxp1OQDlMzJLAMfgkL3Zx Received-SPF: pass client-ip=212.227.15.14; envelope-from=arne_bab@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21704 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Maxime Devos writes: >> [...] >> That would be nice, but would require doing changes in a critical core >> part of Guile. It would change this addition from a risk-free added >> feature to a risky core change. > > I maintain that a new language shouldn't be merged until the > Scheme-specific load path stuff is fixed/extended to work for > non-Scheme things (e.g. Wisp) too -- if this requires somewhat risky > (*) changes to core parts, then that just means we'll have to do some > risky stuff, then. > > I also expect that Guile maintainers will have the opposite opinion > (i.e., =E2=80=98fixing the load path stuff isn't necessary for merging a = new > language implementation=E2=80=99). > > (*) FWIW I disagree on the 'risky' assessment -- it seems like a =E2=80= =98if > it runs, it will work=E2=80=99 thing to me. That it modifies a core part= of > Guile, makes it less risky IMO, as it would automatically be more > tested. > > Aside from the (*) and the 'I also expect [...],', I don't have > anything new to say about this, so I'll stop here. Thank you for your suggestions and contributions so far. They help me a lot! >> [...] >> That would also enable shipping pre-compiled software without >> sourcecode, > > That can already be done -- besides legalities, nothing stops people > from putting [^] or [^] .scm files in $GUILE_LOAD_PATH and putting .go > in $GUILE_LOAD_COMPILED_PATH. > > [^]: Redacted to not give people ideas on how to circumvent stuff. > I can elaborate by non-public e-mail if you like. Thank you! (for redacting) =E2=80=94 I hope I=E2=80=99ll never need that :-) > On 14-02-2023 22:24, Dr. Arne Babenhauserheide wrote: >> PS: So what=E2=80=99s still missing here is to avoid setting the locale.= Do you >> happen to have a hint how to actually do this right? > > I think you might have forgotten about this: > >> -- Scheme Procedure: set-port-encoding! port enc >> -- C Function: scm_set_port_encoding_x (port, enc) >> Sets the character encoding that will be used to interpret I/O to >> PORT. ENC is a string containing the name of an encoding. Valid >> encoding names are those defined by IANA >> (http://www.iana.org/assignments/character-sets), for example >> =E2=80=98"UTF-8"=E2=80=99 or =E2=80=98"ISO-8859-1"=E2=80=99. >> As such, I propose calling set-port-encoding! right in the beginning >> of read-one-wisp-sexp. Yikes, yes. I shouldn=E2=80=99t spend so much time thinking about implicati= ons when I haven=E2=80=99t yet applied all the clear and uncontested improvemen= ts. Thank you! > More concretely, replace > > (define (read-one-wisp-sexp port env) > ;; allow using "# foo" as #(foo). > (read-hash-extend #\# (=CE=BB (chr port) #\#)) > (cond > ((eof-object? (peek-char port)) > (read-char port )); return eof: we=E2=80=99re done > (else > (let ((chunk (wisp-scheme-read-chunk port))) > (cond > ((not (null? chunk)) > (car chunk)) > (else > #f)))))) > > by > > (define (read-one-wisp-sexp port env) > ;; Allow using "# foo" as #(foo). > ;; Don't use the globally-acting read-hash-extend, because this > ;; doesn't make much sense in parenthese-y (non-Wisp) Scheme. > ;; Instead, use fluids to temporarily add the extension. > (define %read-hash-procedures/parameter > (fluid->parameter %read-hash-procedures)) > (parameterize ((%read-hash-procedures/parameter > `((#\# ,(=CE=BB (chr port) #\#)) > ,@(%read-hash-procedures/parameter)))) > ;; Read Wisp files as UTF-8, to support non-ASCII characters. > ;; TODO: would be nice to support ';; coding: whatever' lines > ;; like in parenthese-y Scheme. > (set-port-encoding! port "UTF-8") > (if (eof-object? (peek-char port)) > (read-char port) ; return eof: we=E2=80=99re done > (let ((chunk (wisp-scheme-read-chunk port))) > (and (not (null? chunk)) ; <---- XXX: maybe (pair? chunk) > (car chunk)))))) > > (untested). > > (I've also done the read-hash-extend stuff and simplified the 'cond' > expressions.) Thank you again for that! Which begs an important question: How would you like to be attributed? I plan to also merge this back to the wisp repo and I=E2=80=99d like to attri= bute you there, too. Best wishes, Arne =2D-=20 Unpolitisch sein hei=C3=9Ft politisch sein, ohne es zu merken. draketo.de --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJEBAEBCAAuFiEE801qEjXQSQPNItXAE++NRSQDw+sFAmPsmsgQHGFybmVfYmFi QHdlYi5kZQAKCRAT741FJAPD66IAD/9wDW8hsTTnBbjah7LcAHp/HWC7FD2GLJeu fa1oKQd0VO/N5dIEIKpn5oudvruJGqEheJMcuneq394eFgDvJqTZ5I06oANapkHx SBhHYmTUQwU7zLKGbnL9vH6DwlNeaD3P02jNs8BCCujBA/ljx2tINlNsIikyEBYV E87myO/pWr8Phx4K4WTV3jtkaVyQDhDT7HHRZUFcU+sNuQr5qbdgTcssWF5G/csL WwsH8p/HwUvJUae/QbfRI7U1Zt87J3Yrk/JlXl5wkln9jCoohIhi4BgyLKgOSBAX Sz2JvqBpPewl/ovWksd6cJ+Uos7Xhh7B8O9kqthZoGXjeAUz0KdLtXUgKO4P7IQM eUqs6MjCZhpTF5sLZ7VB9rXbuxJf1bwPS6o8A8qLIDP+RqyNILiHAGC6R0z+/C3D FSxCcxWzESdsKkoVBJLKAEOd/1YMPtLrEZ3X7INkbuDJzMgE4Tipqz52EDCcMvcA Odl1BUmPIBZ/9p5pB8T7//tJ5KXFq5QWhdwyVQBFRaVCVuvam2Px3oEjDI69osnn I3BpK8XN/xfwrOYJWSJEEN7yYIYgDqqZZRpweX7O+SgNc7NEEWAOUE69yHJt4Eql T7ZzlD04Tv2yCAiilvD01513kynFmpRpkLcfqwoakXibUOhLB27h72tofaoaLzgE mzzxTFN9+ojEBAEBCAAuFiEE3Si95tmHXKvOSosd3M8NswvBBUgFAmPsmssQHGFy bmVfYmFiQHdlYi5kZQAKCRDczw2zC8EFSNW9A/9B9Wuk1rn7Dozn9VumM7K8sRm1 TfFffGNCBOXfAm02Q5F/conyc0A8ykYpXyAGxsPQz6uWylBwW5DF0DIcZSq8okEA fMT+dxnD+QfWJFDgT/4tZJk4YHCNihKCjjBVyBqyMEbKwRuE+97woPDfGW/f/rMr VCYxFh09aTIHQ7rzKw== =T6OM -----END PGP SIGNATURE----- --=-=-=--