Re: FYI: guile-scheme bindings to GNU Mach and the Hurd

2021-05-11 Thread Ludovic Courtès
Hi!

Maxime Devos  skribis:

> Ludovic Courtès schreef op do 06-05-2021 om 18:30 [+0200]:
>> BTW, a dream of mine was to implement RPCs in Scheme.  That is, you’d
>> have a macro that would essentially do the same work as MiG (the Mach
>> Interface Generator), and then we’d pass the bytes directly to
>> ‘mach_msg’.
>
> The lisp bindings have a binding to ‘mach_msg’ (not yet schemified).
> Note that the lisp hurd bindings never use "send-message", instead they
> bind the C bindings generated by MiG.
>
> Also, ‘implementing RPCs in Scheme’ is something I would like to see
> as well.
>
> One thing I have in mind, is that MiG RPCs can block, but mach_msg
> itself seems to be perfectly usable in a non-blocking way (maybe using
> port notifications?).  If we use something like guile-fibers, and integrate
> guile-hurd with fibers, then we may be able to do crazy things like:
>
>   * asynchronuously opening files, for free!
>   * asynchronuous 'accept', for free!
>   * asynchronuous disk I/O, for free!
>   * asynchronuous ... practically anything, for free!

Oh yes, it has great potential. 

And it cannot be That Hard (famous last words).

Food for thought!

> Another possibility is debugging the translator responsible for IP
> and at the same time running a web browser (or IRC client, or ...)
> based on guile-fibers+guile-hurd.  The web browser wouldn't be overly
> bothered by the network translator temporarily being paused (for debugging)
> and therefore not responsing to the RPCs for 'connect' et al.
>
> Loading webpages will be delayed of course, but the browser itself won't
> hang (so you can still scroll, copy & paste, perhaps browse the file system
> ...).

This is already possible I believe, but mostly because browsers avoid
blocking on networking I/O.

Ludo’.



Re: FYI: guile-scheme bindings to GNU Mach and the Hurd

2021-05-06 Thread Maxime Devos
Ludovic Courtès schreef op do 06-05-2021 om 18:30 [+0200]:
> BTW, a dream of mine was to implement RPCs in Scheme.  That is, you’d
> have a macro that would essentially do the same work as MiG (the Mach
> Interface Generator), and then we’d pass the bytes directly to
> ‘mach_msg’.

The lisp bindings have a binding to ‘mach_msg’ (not yet schemified).
Note that the lisp hurd bindings never use "send-message", instead they
bind the C bindings generated by MiG.

Also, ‘implementing RPCs in Scheme’ is something I would like to see
as well.

One thing I have in mind, is that MiG RPCs can block, but mach_msg
itself seems to be perfectly usable in a non-blocking way (maybe using
port notifications?).  If we use something like guile-fibers, and integrate
guile-hurd with fibers, then we may be able to do crazy things like:

  * asynchronuously opening files, for free!
  * asynchronuous 'accept', for free!
  * asynchronuous disk I/O, for free!
  * asynchronuous ... practically anything, for free!

Another possibility is debugging the translator responsible for IP
and at the same time running a web browser (or IRC client, or ...)
based on guile-fibers+guile-hurd.  The web browser wouldn't be overly
bothered by the network translator temporarily being paused (for debugging)
and therefore not responsing to the RPCs for 'connect' et al.

Loading webpages will be delayed of course, but the browser itself won't
hang (so you can still scroll, copy & paste, perhaps browse the file system
...).

Greetings,
Maxime.


signature.asc
Description: This is a digitally signed message part


Re: FYI: guile-scheme bindings to GNU Mach and the Hurd

2021-05-06 Thread Ludovic Courtès
Maxime Devos  skribis:

> Ludovic Courtès schreef op zo 02-05-2021 om 22:51 [+0200]:
>> > [...] moved it to ;.
>> 
>> Nice!  I knew of the Common Lisp effort this is based on, and the idea
>> of reusing the .lisp code unchanged is smart.  Looks promising!
>
> The initial idea was to keep most of the .lisp code unchanged and ‘convert’
> most lisp -> Scheme by defining appropriate macro's. However:

Ah, I see.

BTW, a dream of mine was to implement RPCs in Scheme.  That is, you’d
have a macro that would essentially do the same work as MiG (the Mach
Interface Generator), and then we’d pass the bytes directly to
‘mach_msg’.

Ludo’.



Re: FYI: guile-scheme bindings to GNU Mach and the Hurd

2021-05-04 Thread Maxime Devos
Ludovic Courtès schreef op zo 02-05-2021 om 22:51 [+0200]:
> > [...] moved it to ;.
> 
> Nice!  I knew of the Common Lisp effort this is based on, and the idea
> of reusing the .lisp code unchanged is smart.  Looks promising!

The initial idea was to keep most of the .lisp code unchanged and ‘convert’
most lisp -> Scheme by defining appropriate macro's. However:

 * the procedure names are adapted to Scheme conventions
   (! for imperative procedures, ? instead of -p for predicates, ...)

 * the Lisp code is rather sparsely documented, so I'm adding docstrings
   and some comments. Particularily important for people who don't know much
   about how the Hurd and Mach works (e.g. me (-:)).

 * the Lisp code uses 
   as foreign function interface, which uses CLOS.  While much of CLOS
   can be ‘implemented’ with macros that use GOOPS, there are some 
incompatibilities
   (e.g., :after, :before and something else I forgot do not exist in GOOPS)
   which cannot be easily worked around

   It is (in-progress) fairly easy to modify the mach/*.lisp code to use guile's
   FFI instead.  E.g., see

   


  and

  


I probably need to change the README.org.

There were some other points I wished to raise, but I'll stop here so
you don't have to wait a week on my response.

Greetings,
Maxime.




signature.asc
Description: This is a digitally signed message part


Re: FYI: guile-scheme bindings to GNU Mach and the Hurd

2021-05-02 Thread Ludovic Courtès
Hi Maxime & all,

Maxime Devos  skribis:

> Joshua Branson schreef op za 01-05-2021 om 11:04 [-0400]:
>> Hey guix people,
>> 
>> I just ran across a pretty recent thread in bug-hurd land.  Apparently
>> there is a VERY WIP effort to get some guile-scheme bindings for GNU
>> Mach and the Hurd.
>> 
>> Since it might be of interest to guixy people, I thought I'd share:
>> https://notabug.org/mdevos/guile-hurd
>
> I moved it to .

Nice!  I knew of the Common Lisp effort this is based on, and the idea
of reusing the .lisp code unchanged is smart.  Looks promising!

Ludo’.



Re: FYI: guile-scheme bindings to GNU Mach and the Hurd

2021-05-02 Thread Mark H Weaver
Hi Maxime,

Maxime Devos  writes:

> Joshua Branson schreef op za 01-05-2021 om 11:04 [-0400]:
>> Hey guix people,
>> 
>> I just ran across a pretty recent thread in bug-hurd land.  Apparently
>> there is a VERY WIP effort to get some guile-scheme bindings for GNU
>> Mach and the Hurd.
>> 
>> Since it might be of interest to guixy people, I thought I'd share:
>> https://notabug.org/mdevos/guile-hurd
>
> I moved it to .

This is very exciting work.  I've often thought that it would be nice to
have such bindings.  Among other things, it potentially opens up many
interesting possibilities for Guix running on the Hurd.  I have no time
at the moment to elaborate on this, but perhaps in a future message.
For now, I will simply offer my thanks and kudos :)

 Regards,
   Mark

-- 
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about .



Re: FYI: guile-scheme bindings to GNU Mach and the Hurd

2021-05-01 Thread Maxime Devos
Joshua Branson schreef op za 01-05-2021 om 11:04 [-0400]:
> Hey guix people,
> 
> I just ran across a pretty recent thread in bug-hurd land.  Apparently
> there is a VERY WIP effort to get some guile-scheme bindings for GNU
> Mach and the Hurd.
> 
> Since it might be of interest to guixy people, I thought I'd share:
> https://notabug.org/mdevos/guile-hurd

I moved it to .

Greetings,
Maxime.


signature.asc
Description: This is a digitally signed message part


FYI: guile-scheme bindings to GNU Mach and the Hurd

2021-05-01 Thread Joshua Branson


Hey guix people,

I just ran across a pretty recent thread in bug-hurd land.  Apparently
there is a VERY WIP effort to get some guile-scheme bindings for GNU
Mach and the Hurd.

Since it might be of interest to guixy people, I thought I'd share:

https://notabug.org/mdevos/guile-hurd

Cheers!

--
Joshua Branson (joshuaBPMan in #guix)
Sent from Emacs and Gnus
  https://gnucode.me
  https://video.hardlimit.com/accounts/joshua_branson/video-channels
  https://propernaming.org
  "You can have whatever you want, as long as you help
enough other people get what they want." - Zig Ziglar