unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Can guile be implementation independent?
@ 2021-12-17  1:42 Jacob Hrbek
  2021-12-17  2:53 ` Nala Ginrut
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jacob Hrbek @ 2021-12-17  1:42 UTC (permalink / raw)
  To: guile-user


[-- Attachment #1.1: Type: text/plain, Size: 412 bytes --]

I am used to working with common lisp where i can write code that is
"implementation independent" meaning that following a specific coding
style makes it compatible across multiple interpretators/compilers
(sbcl, LispWorks, etc..)

Is there a way to do the same on GNU Guile? Like writing a code that can
be interpreted by implementations that are following the IEEE 1178-2008
or R7RS standard?

-- Jacob Hrbek


[-- Attachment #1.2: publickey - kreyren@rixotstudio.cz - 1677db82.asc --]
[-- Type: application/pgp-keys, Size: 713 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Can guile be implementation independent?
  2021-12-17  1:42 Can guile be implementation independent? Jacob Hrbek
@ 2021-12-17  2:53 ` Nala Ginrut
  2021-12-17  3:01   ` Jacob Hrbek
  2021-12-17 16:19 ` Maxime Devos
  2021-12-17 17:05 ` [EXT] " Thompson, David
  2 siblings, 1 reply; 13+ messages in thread
From: Nala Ginrut @ 2021-12-17  2:53 UTC (permalink / raw)
  To: Jacob Hrbek; +Cc: Guile User

Hi Jacob!
You may take a look at akku.scm
You can write r7rs code and use Guile as one of the compiler alternatives.

Best regards.


On Fri, Dec 17, 2021, 09:43 Jacob Hrbek <kreyren@rixotstudio.cz> wrote:

> I am used to working with common lisp where i can write code that is
> "implementation independent" meaning that following a specific coding
> style makes it compatible across multiple interpretators/compilers
> (sbcl, LispWorks, etc..)
>
> Is there a way to do the same on GNU Guile? Like writing a code that can
> be interpreted by implementations that are following the IEEE 1178-2008
> or R7RS standard?
>
> -- Jacob Hrbek
>
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Can guile be implementation independent?
  2021-12-17  2:53 ` Nala Ginrut
@ 2021-12-17  3:01   ` Jacob Hrbek
  2021-12-17  3:27     ` Nala Ginrut
  2021-12-17 13:32     ` silas poulson
  0 siblings, 2 replies; 13+ messages in thread
From: Jacob Hrbek @ 2021-12-17  3:01 UTC (permalink / raw)
  To: Nala Ginrut; +Cc: Guile User


[-- Attachment #1.1: Type: text/plain, Size: 826 bytes --]

Looks interesting, are there any known limitations in relation to Guile?

On 12/17/21 03:53, Nala Ginrut wrote:
> Hi Jacob!
> You may take a look at akku.scm
> You can write r7rs code and use Guile as one of the compiler alternatives.
>
> Best regards.
>
>
> On Fri, Dec 17, 2021, 09:43 Jacob Hrbek <kreyren@rixotstudio.cz> wrote:
>
>     I am used to working with common lisp where i can write code that is
>     "implementation independent" meaning that following a specific coding
>     style makes it compatible across multiple interpretators/compilers
>     (sbcl, LispWorks, etc..)
>
>     Is there a way to do the same on GNU Guile? Like writing a code
>     that can
>     be interpreted by implementations that are following the IEEE
>     1178-2008
>     or R7RS standard?
>
>     -- Jacob Hrbek
>
--
-- Jacob Hrbek

[-- Attachment #1.2: publickey - kreyren@rixotstudio.cz - 1677db82.asc --]
[-- Type: application/pgp-keys, Size: 713 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Can guile be implementation independent?
  2021-12-17  3:01   ` Jacob Hrbek
@ 2021-12-17  3:27     ` Nala Ginrut
  2021-12-17 13:32     ` silas poulson
  1 sibling, 0 replies; 13+ messages in thread
From: Nala Ginrut @ 2021-12-17  3:27 UTC (permalink / raw)
  To: Jacob Hrbek; +Cc: Guile User

I'm not sure about the complete incompatibles between Guile and r7rs. To my
experience, the  exception handling is different from r7rs.
I think Scheme community has great progress these years, so many features
are covered by the standard, include FFI(srfi-198),
delimited-continuation(srfi-226), etc.
Guile provides rich features, but people may need to write wrapper for the
standard API.

Best regards.

On Fri, Dec 17, 2021, 11:01 Jacob Hrbek <kreyren@rixotstudio.cz> wrote:

> Looks interesting, are there any known limitations in relation to Guile?
> On 12/17/21 03:53, Nala Ginrut wrote:
>
> Hi Jacob!
> You may take a look at akku.scm
> You can write r7rs code and use Guile as one of the compiler alternatives.
>
> Best regards.
>
>
> On Fri, Dec 17, 2021, 09:43 Jacob Hrbek <kreyren@rixotstudio.cz> wrote:
>
>> I am used to working with common lisp where i can write code that is
>> "implementation independent" meaning that following a specific coding
>> style makes it compatible across multiple interpretators/compilers
>> (sbcl, LispWorks, etc..)
>>
>> Is there a way to do the same on GNU Guile? Like writing a code that can
>> be interpreted by implementations that are following the IEEE 1178-2008
>> or R7RS standard?
>>
>> -- Jacob Hrbek
>>
>> --
> -- Jacob Hrbek
>
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Can guile be implementation independent?
  2021-12-17  3:01   ` Jacob Hrbek
  2021-12-17  3:27     ` Nala Ginrut
@ 2021-12-17 13:32     ` silas poulson
  2021-12-17 16:26       ` Dr. Arne Babenhauserheide
  1 sibling, 1 reply; 13+ messages in thread
From: silas poulson @ 2021-12-17 13:32 UTC (permalink / raw)
  To: Jacob Hrbek; +Cc: Guile User

Uncertain if anymore but Guile provides list of r7rs incompatiblities
here
<https://www.gnu.org/software/guile/manual/html_node/R7RS-Incompatibilities.html>

Silas

> On 17 Dec 2021, at 03:01, Jacob Hrbek <kreyren@rixotstudio.cz> wrote:
> 
> Looks interesting, are there any known limitations in relation to Guile?
> 
> On 12/17/21 03:53, Nala Ginrut wrote:
>> Hi Jacob!
>> You may take a look at akku.scm
>> You can write r7rs code and use Guile as one of the compiler alternatives.
>> 
>> Best regards.
>> 
>> 
>> On Fri, Dec 17, 2021, 09:43 Jacob Hrbek <kreyren@rixotstudio.cz> wrote:
>> 
>>    I am used to working with common lisp where i can write code that is
>>    "implementation independent" meaning that following a specific coding
>>    style makes it compatible across multiple interpretators/compilers
>>    (sbcl, LispWorks, etc..)
>> 
>>    Is there a way to do the same on GNU Guile? Like writing a code
>>    that can
>>    be interpreted by implementations that are following the IEEE
>>    1178-2008
>>    or R7RS standard?
>> 
>>    -- Jacob Hrbek
>> 
> --
> -- Jacob Hrbek
> <publickey - kreyren@rixotstudio.cz - 1677db82.asc>




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Can guile be implementation independent?
  2021-12-17  1:42 Can guile be implementation independent? Jacob Hrbek
  2021-12-17  2:53 ` Nala Ginrut
@ 2021-12-17 16:19 ` Maxime Devos
  2021-12-17 17:05 ` [EXT] " Thompson, David
  2 siblings, 0 replies; 13+ messages in thread
From: Maxime Devos @ 2021-12-17 16:19 UTC (permalink / raw)
  To: Jacob Hrbek, guile-user

Jacob Hrbek schreef op vr 17-12-2021 om 01:42 [+0000]:
> I am used to working with common lisp where i can write code that is
> "implementation independent" meaning that following a specific coding
> style makes it compatible across multiple interpretators/compilers
> (sbcl, LispWorks, etc..)
> 
> Is there a way to do the same on GNU Guile? Like writing a code that
> can
> be interpreted by implementations that are following the IEEE 1178-
> 2008
> or R7RS standard?

I'm not aware of any Scheme implementations acknowleding that
IEEE 1178-2008 even exists. So for most practical intents and purposes,
IEEE 1178-2008 isn't a standard at all.

The de facto and de jure standards are the RnRS
(https://docs.racket-lang.org/r5rs/r5rs-std/index.html,
http://www.r6rs.org/,
https://small.r7rs.org/) and the SRFIs
(https://srfi.schemers.org/).

The RnRS and SRFIs are supposedly not official, but I don't see why
since there is a discussion process, a ratification process and
everything --- although often Schemes don't bother implementing all of
R6RS (out of inertia, minimalism, maybe backwards compatibility,
limited developer time, parts being problematic to implement (e.g.
'include-ci')) and sometimes disagree about arcane details.

Often only a selection of the SRFIs are implemented.

Overall, you can't do everything in portable Schemes, but most things
can be made reasonably portable by using the SRFIs and RnRS
(e.g. 'define-library' or 'library' instead of 'define-module'), though
at times some implementation-specific code is required
(e.g. for FFI and GUIs).

Greetings,
Maxime.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Can guile be implementation independent?
  2021-12-17 13:32     ` silas poulson
@ 2021-12-17 16:26       ` Dr. Arne Babenhauserheide
  2021-12-18 15:30         ` Tim Van den Langenbergh
  0 siblings, 1 reply; 13+ messages in thread
From: Dr. Arne Babenhauserheide @ 2021-12-17 16:26 UTC (permalink / raw)
  To: silas poulson; +Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

>>> On Fri, Dec 17, 2021, 09:43 Jacob Hrbek <kreyren@rixotstudio.cz> wrote:
>>>    Is there a way to do the same on GNU Guile? Like writing a code
>>>    that can
>>>    be interpreted by implementations that are following the IEEE
>>>    1178-2008
>>>    or R7RS standard?
>> On 12/17/21 03:53, Nala Ginrut wrote:
>>> Hi Jacob!
>>> You may take a look at akku.scm
>>> You can write r7rs code and use Guile as one of the compiler alternatives.
>> On 17 Dec 2021, at 03:01, Jacob Hrbek <kreyren@rixotstudio.cz> wrote:
>> Looks interesting, are there any known limitations in relation to Guile?
silas poulson <silas8642@hotmail.co.uk> writes:
> Uncertain if anymore but Guile provides list of r7rs incompatiblities
> here
> <https://www.gnu.org/software/guile/manual/html_node/R7RS-Incompatibilities.html>

The short of this: Call guile with --r7rs and the main incompatibility
is missing reading of circular data structures with datum labels.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [EXT] Can guile be implementation independent?
  2021-12-17  1:42 Can guile be implementation independent? Jacob Hrbek
  2021-12-17  2:53 ` Nala Ginrut
  2021-12-17 16:19 ` Maxime Devos
@ 2021-12-17 17:05 ` Thompson, David
  2021-12-18 17:10   ` Taylan Kammer
  2 siblings, 1 reply; 13+ messages in thread
From: Thompson, David @ 2021-12-17 17:05 UTC (permalink / raw)
  To: Jacob Hrbek; +Cc: Guile User

Hi Jacob,

On Thu, Dec 16, 2021 at 8:43 PM Jacob Hrbek <kreyren@rixotstudio.cz> wrote:
>
> I am used to working with common lisp where i can write code that is
> "implementation independent" meaning that following a specific coding
> style makes it compatible across multiple interpretators/compilers
> (sbcl, LispWorks, etc..)
>
> Is there a way to do the same on GNU Guile? Like writing a code that can
> be interpreted by implementations that are following the IEEE 1178-2008
> or R7RS standard?

I think the shortest and easiest answer to this question, in practice, is "no."

While it is possible to write programs that conform to a specific
Scheme standard and thus work on all implementations supporting that
standard, there are few real world programs that can be written within
such limits. And coming from a Common Lisp background, where the
standard is huge, you'll likely find the available Scheme standards
lacking.

I prefer to think of each Scheme implementation as its own distinct
language, because in many ways they are. I don't write Scheme
programs, I write Guile programs. I want to use Guile's delimited
continuations, foreign function interface, compiler tower, etc. so
limiting myself to standard Scheme would be a real bummer.

- Dave

    "This here ain't no Common Lisp."
      - Thaddeus Scheme, Sr. (1975)



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Can guile be implementation independent?
  2021-12-17 16:26       ` Dr. Arne Babenhauserheide
@ 2021-12-18 15:30         ` Tim Van den Langenbergh
  2021-12-18 18:47           ` Dr. Arne Babenhauserheide
  0 siblings, 1 reply; 13+ messages in thread
From: Tim Van den Langenbergh @ 2021-12-18 15:30 UTC (permalink / raw)
  To: Dr. Arne Babenhauserheide; +Cc: guile-user


[-- Attachment #1.1: Type: text/plain, Size: 347 bytes --]

On 17/12/2021 17:26, Dr. Arne Babenhauserheide wrote:
> The short of this: Call guile with --r7rs and the main incompatibility
> is missing reading of circular data structures with datum labels.
> 
> Best wishes,
> Arne

Well, Guile is also missing digit-value, which is easily mocked-up by using char->integer and subtracting 48 from it.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [EXT] Can guile be implementation independent?
  2021-12-17 17:05 ` [EXT] " Thompson, David
@ 2021-12-18 17:10   ` Taylan Kammer
  2021-12-19 20:03     ` Keith Wright
  0 siblings, 1 reply; 13+ messages in thread
From: Taylan Kammer @ 2021-12-18 17:10 UTC (permalink / raw)
  To: Thompson, David, Jacob Hrbek; +Cc: Guile User

On 17.12.2021 18:05, Thompson, David wrote:
> Hi Jacob,
> 
> On Thu, Dec 16, 2021 at 8:43 PM Jacob Hrbek <kreyren@rixotstudio.cz> wrote:
>>
>> I am used to working with common lisp where i can write code that is
>> "implementation independent" meaning that following a specific coding
>> style makes it compatible across multiple interpretators/compilers
>> (sbcl, LispWorks, etc..)
>>
>> Is there a way to do the same on GNU Guile? Like writing a code that can
>> be interpreted by implementations that are following the IEEE 1178-2008
>> or R7RS standard?
> 
> I think the shortest and easiest answer to this question, in practice, is "no."
> 
> While it is possible to write programs that conform to a specific
> Scheme standard and thus work on all implementations supporting that
> standard, there are few real world programs that can be written within
> such limits. And coming from a Common Lisp background, where the
> standard is huge, you'll likely find the available Scheme standards
> lacking.
> 
> I prefer to think of each Scheme implementation as its own distinct
> language, because in many ways they are. I don't write Scheme
> programs, I write Guile programs. I want to use Guile's delimited
> continuations, foreign function interface, compiler tower, etc. so
> limiting myself to standard Scheme would be a real bummer.
> 
> - Dave
> 
>     "This here ain't no Common Lisp."
>       - Thaddeus Scheme, Sr. (1975)
> 

Well said.  I have minor disagreements.

The RnRS have some severe limitations.  In all RnRS:

- No TCP/IP
- No POSIX or Win32
- No threads

In R7RS-small, and R5RS and earlier:

- No hash tables
- No sub-typing

In R5RS and earlier:

- No user-defined disjoint types at all
- No exceptions or other meaningful error handling

There's SRFIs for all of these, but many aren't widely supported.  I guess
SRFI 9 and SRFI 69 are supported widely enough to get good cross-platform
support for user-defined types and hash tables, but no sub-typing.  You're
not going to get good cross-implementation support for networking, threads,
or OS interfaces at all.

Still, some interesting libraries or applications can be written in a
cross-platform manner.  My scheme-bytestructures library supports R6RS,
R7RS, and also Guile-specific sub-libraries:

https://github.com/TaylanUB/scheme-bytestructures

How "real-world" it is without the Guile extensions might be up for debate
though. :-)

Libraries that only deal with string processing, like parsers for data
formats such as JSON, XML, YAML, Markdown, etc. shouldn't be too difficult
to implement in pure RnRS I think, and would count towards "real-world" I
guess.

My opinionated summary would be:

If the application or library you're intending to write can be written in
a cross-implementation manner, go for it so that the whole Scheme community
can benefit from it.  But if that seems like an unpleasant challenge, it's
perfectly understandable that one wouldn't care about going that way. And for
any sufficiently complex task, you will have to commit to a particular
implementation anyway.

-- 
Taylan



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Can guile be implementation independent?
  2021-12-18 15:30         ` Tim Van den Langenbergh
@ 2021-12-18 18:47           ` Dr. Arne Babenhauserheide
  0 siblings, 0 replies; 13+ messages in thread
From: Dr. Arne Babenhauserheide @ 2021-12-18 18:47 UTC (permalink / raw)
  To: Tim Van den Langenbergh; +Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]


Tim Van den Langenbergh <tmt_vdl@gmx.com> writes:
> On 17/12/2021 17:26, Dr. Arne Babenhauserheide wrote:
>> The short of this: Call guile with --r7rs and the main incompatibility
>> is missing reading of circular data structures with datum labels.
>
> Well, Guile is also missing digit-value, which is easily mocked-up by using char->integer and subtracting 48 from it.

Are there any more missing parts?

I think for those that are easy to mock, we just should fix the incompatibilities.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [EXT] Can guile be implementation independent?
  2021-12-18 17:10   ` Taylan Kammer
@ 2021-12-19 20:03     ` Keith Wright
  2021-12-19 20:57       ` Taylan Kammer
  0 siblings, 1 reply; 13+ messages in thread
From: Keith Wright @ 2021-12-19 20:03 UTC (permalink / raw)
  To: guile-user

Taylan Kammer <taylan.kammer@gmail.com> writes:

> On 17.12.2021 18:05, Thompson, David wrote:
>> 
>> I think the shortest and easiest answer to this question,
>> in practice, is "no."
>>
>> I prefer to think of each Scheme implementation as its own distinct
>> language,

I hope not.

> The RnRS have some severe limitations.  In all RnRS:
>
> - No TCP/IP
> - No POSIX or Win32
> - No threads
>
> In R7RS-small, and R5RS and earlier:
>
> - No hash tables
> - No sub-typing

Do we recoginize a distinction between core language and libraries?

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

>>    I wonder why your releases all seem to target Guile 2
>>    Will this also work with Guile 3?
>
> New Stuff gets my attention sooner when it is kind to Old Stuff.

Q: Can portable code be run with Guile?
A: If you have to ask Guile-2 or Guile-3 then you can't do it.
    (But TTN might.)

  -- Keith
  



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [EXT] Can guile be implementation independent?
  2021-12-19 20:03     ` Keith Wright
@ 2021-12-19 20:57       ` Taylan Kammer
  0 siblings, 0 replies; 13+ messages in thread
From: Taylan Kammer @ 2021-12-19 20:57 UTC (permalink / raw)
  To: Keith Wright, guile-user

On 19.12.2021 21:03, Keith Wright wrote:
> 
> Do we recoginize a distinction between core language and libraries?
> 

R5RS and earlier don't have libraries.  The things I listed as lacking
in RnRS (whether 6 or 7) are taking into account all optional libraries
listed in the respective standard.  E.g. the "libraries" document of the
R6RS has nothing for networking or threading, and the standard libraries
of R7RS-small don't have anything for hash tables.

> Thien-Thi Nguyen <ttn@gnuvola.org> writes:
> 
>>>    I wonder why your releases all seem to target Guile 2
>>>    Will this also work with Guile 3?
>>
>> New Stuff gets my attention sooner when it is kind to Old Stuff.
> 
> Q: Can portable code be run with Guile?
> A: If you have to ask Guile-2 or Guile-3 then you can't do it.
>     (But TTN might.)

That's a different thing entirely.  A library written *specifically* for
Guile might use low-level facilities found in a specific Guile version.
This has little to do with the viability of writing Scheme code that runs
on various Scheme implementation.

(One should also note that the transition from Guile 2 to 3 is not like
the Guile 1.8 to 2.0 transition at all.)

-- 
Taylan



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-12-19 20:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17  1:42 Can guile be implementation independent? Jacob Hrbek
2021-12-17  2:53 ` Nala Ginrut
2021-12-17  3:01   ` Jacob Hrbek
2021-12-17  3:27     ` Nala Ginrut
2021-12-17 13:32     ` silas poulson
2021-12-17 16:26       ` Dr. Arne Babenhauserheide
2021-12-18 15:30         ` Tim Van den Langenbergh
2021-12-18 18:47           ` Dr. Arne Babenhauserheide
2021-12-17 16:19 ` Maxime Devos
2021-12-17 17:05 ` [EXT] " Thompson, David
2021-12-18 17:10   ` Taylan Kammer
2021-12-19 20:03     ` Keith Wright
2021-12-19 20:57       ` Taylan Kammer

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).