Re: Can guile be implementation independent?

2021-12-17 Thread silas poulson
Uncertain if anymore but Guile provides list of r7rs incompatiblities
here


Silas

> On 17 Dec 2021, at 03:01, Jacob Hrbek  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  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
> 




Re: Can guile be implementation independent?

2021-12-17 Thread Maxime Devos
Jacob Hrbek schreef op vr 17-12-2021 om 01:42 [+]:
> 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.




Re: How to capture pid of (system process?

2021-12-17 Thread Timothy Sample
Hi Jacob,

Jacob Hrbek  writes:

>> If you want to do things asynchronuously, you can look at
>> open-pipe. It should also be possible to build anything you want with
>> the lower-level fork, execl, dup->fdes, ... primitives (assuming
>> things are single-threaded).
>
> Can you elaborate? (I am noob in guile atm)

If you want to dig into it, the GNU manual is not half bad:

https://www.gnu.org/software/libc/manual/html_node/Processes.html

Guile just wraps those same C functions, so that description applies
quite well to Guile.  Here’s the Guile reference for the procedures
you’d need:

https://www.gnu.org/software/guile/manual/html_node/Processes.html

Alternatively, if you are feeling adventurous – you must be if you are
using Potato Make :) – you could try and use Gash, too.  You would end
up with a very Scheme-y Make experience indeed!

Gash’s interface is laser focused on shell semantics so far, so it’s a
little wonky as a Scheme library, but here’s an example:

(use-modules (gash environment)
 (gash shell))

(sh:async
 (lambda ()
   (execlp "emacs")))
(display "waiting a bit...\n")
(sleep 5)
(let ((emacs-pid (get-last-job)))
  (display "sending SIGTERM to ")
  (display emacs-pid)
  (newline)
  (kill emacs-pid SIGTERM))

Gash is very much experimental software when used like this, though.
The latest release does not have ‘sh:async’, so you would have to build
it from Git.  It might not be super practical, but it would be fun!  :)


-- Tim



Re: Can guile be implementation independent?

2021-12-17 Thread Dr. Arne Babenhauserheide
>>> On Fri, Dec 17, 2021, 09:43 Jacob Hrbek  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  wrote:
>> Looks interesting, are there any known limitations in relation to Guile?
silas poulson  writes:
> Uncertain if anymore but Guile provides list of r7rs incompatiblities
> here
> 

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


signature.asc
Description: PGP signature


Re: [EXT] Can guile be implementation independent?

2021-12-17 Thread Thompson, David
Hi Jacob,

On Thu, Dec 16, 2021 at 8:43 PM Jacob Hrbek  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)



Guile-SDL Demos 5.2 available

2021-12-17 Thread Thien-Thi Nguyen

release notes:

  Tested w/ Guile-SDL 0.5.3 (and Guile 2.2.7).

README excerpt:

  This is a collection of small programs released
  under GNU GPL v3 that use Guile-SDL.

NEWS for 5.2 (2021-12-18):

  - bugfixes

- SRFI 9 and 17 infelicity corrected

  Demo ‘mars-rescue’ uses SRFI 9 and SRFI 17 together.  Modern
  versions of Guile don't handle a possible ambiguity in their
  combination in a "top-to-bottom (procedural)" fashion but instead
  error out.  The code now sidesteps ambiguity entirely.

- installation more robust

  Previously, "make install" mishandled some read-only files in the
  distribution, in the case where you are doing the installation as
  a non-root user.  Now, relevant files are ensured writable.

  - changes for demo ‘mq’

- default font changed

  It is now DejaVuSansCondensed-Bold, which perhaps has a better
  chance of being already installed on your system than the former
  default (Vera).  (But maybe not; in any case, you can use
  ‘--ttf FILENAME’ to specify which font file to use.)

- cleaner handling of missing font file

  If the TTF font file (whether specified or default) does not
  exist, demo ‘mq’ emits an error message and exits failurefully.

  - better behavior on error

Previously, all the demos used procedure ‘error’ to signal
error.  They now use another procedure that displays an error
message and exits failurefully.  This is cleaner for versions of
Guile that dump (mostly useless :-D) backtrace info on ‘error’.

  - demo ‘mars-rescue’ recognizes ESC key

It will now quit the current map when the ESC key is pressed.
This means if you run mars-rescue w/o args (the default), it will
recurse four times and the fastest you can quit is to press ESC
four times, once in each map window.  Still, this is better than
before, where you could not escape at all!

  - bootstrap/maintenance tools

upgraded:

 Guile-BAUX 20211208.0839.a5245e7
 GNU gnulib 2021-12-10 21:54:54
 GNU Autoconf 2.71

as before:

 (none)

source code:

  https://www.gnuvola.org/software/guile-sdl-demos/

-- 
Thien-Thi Nguyen ---
 (defun responsep (query)   ; (2021) Software Libero
   (pcase (context query)   ;   = Dissenso Etico
 (`(technical ,ml) (correctp ml))
 ...))  748E A0E8 1CB8 A748 9BFA
--- 6CE4 6703 2224 4C80 7502



signature.asc
Description: PGP signature