unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / Atom feed
* FYI: guile-scheme bindings to GNU Mach and the Hurd
@ 2021-05-01 15:04 Joshua Branson
  2021-05-01 19:48 ` Maxime Devos
  0 siblings, 1 reply; 8+ messages in thread
From: Joshua Branson @ 2021-05-01 15:04 UTC (permalink / raw)
  To: guix-devel


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


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

* Re: FYI: guile-scheme bindings to GNU Mach and the Hurd
  2021-05-01 15:04 FYI: guile-scheme bindings to GNU Mach and the Hurd Joshua Branson
@ 2021-05-01 19:48 ` Maxime Devos
  2021-05-02  6:03   ` Mark H Weaver
  2021-05-02 20:51   ` Ludovic Courtès
  0 siblings, 2 replies; 8+ messages in thread
From: Maxime Devos @ 2021-05-01 19:48 UTC (permalink / raw)
  To: Joshua Branson, guix-devel

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

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 <https://notabug.org/guile-hurd/guile-hurd>.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: FYI: guile-scheme bindings to GNU Mach and the Hurd
  2021-05-01 19:48 ` Maxime Devos
@ 2021-05-02  6:03   ` Mark H Weaver
  2021-05-02 20:51   ` Ludovic Courtès
  1 sibling, 0 replies; 8+ messages in thread
From: Mark H Weaver @ 2021-05-02  6:03 UTC (permalink / raw)
  To: Maxime Devos, Joshua Branson, guix-devel

Hi Maxime,

Maxime Devos <maximedevos@telenet.be> 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 <https://notabug.org/guile-hurd/guile-hurd>.

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 <https://stallmansupport.org>.


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

* Re: FYI: guile-scheme bindings to GNU Mach and the Hurd
  2021-05-01 19:48 ` Maxime Devos
  2021-05-02  6:03   ` Mark H Weaver
@ 2021-05-02 20:51   ` Ludovic Courtès
  2021-05-04 20:18     ` Maxime Devos
  1 sibling, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2021-05-02 20:51 UTC (permalink / raw)
  To: Maxime Devos; +Cc: guix-devel

Hi Maxime & all,

Maxime Devos <maximedevos@telenet.be> 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 <https://notabug.org/guile-hurd/guile-hurd>.

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


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

* Re: FYI: guile-scheme bindings to GNU Mach and the Hurd
  2021-05-02 20:51   ` Ludovic Courtès
@ 2021-05-04 20:18     ` Maxime Devos
  2021-05-06 16:30       ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Devos @ 2021-05-04 20:18 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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

Ludovic Courtès schreef op zo 02-05-2021 om 22:51 [+0200]:
> > [...] moved it to <https://notabug.org/guile-hurd/guile-hurd>;.
> 
> 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 <https://www.common-lisp.net/project/cffi/>
   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

   <https://notabug.org/guile-hurd/guile-hurd/src/cafd4a0e3b679bef14ff8327773c00221d5c0981/mach/port-move.scm>

  and

  <https://notabug.org/guile-hurd/guile-hurd/src/cafd4a0e3b679bef14ff8327773c00221d5c0981/mach/ffi.scm>

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.



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: FYI: guile-scheme bindings to GNU Mach and the Hurd
  2021-05-04 20:18     ` Maxime Devos
@ 2021-05-06 16:30       ` Ludovic Courtès
  2021-05-06 20:58         ` Maxime Devos
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2021-05-06 16:30 UTC (permalink / raw)
  To: Maxime Devos; +Cc: guix-devel

Maxime Devos <maximedevos@telenet.be> skribis:

> Ludovic Courtès schreef op zo 02-05-2021 om 22:51 [+0200]:
>> > [...] moved it to <https://notabug.org/guile-hurd/guile-hurd>;.
>> 
>> 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’.


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

* Re: FYI: guile-scheme bindings to GNU Mach and the Hurd
  2021-05-06 16:30       ` Ludovic Courtès
@ 2021-05-06 20:58         ` Maxime Devos
  2021-05-11 20:29           ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Devos @ 2021-05-06 20:58 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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

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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: FYI: guile-scheme bindings to GNU Mach and the Hurd
  2021-05-06 20:58         ` Maxime Devos
@ 2021-05-11 20:29           ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2021-05-11 20:29 UTC (permalink / raw)
  To: Maxime Devos; +Cc: guix-devel

Hi!

Maxime Devos <maximedevos@telenet.be> 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’.


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

end of thread, other threads:[~2021-05-11 20:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-01 15:04 FYI: guile-scheme bindings to GNU Mach and the Hurd Joshua Branson
2021-05-01 19:48 ` Maxime Devos
2021-05-02  6:03   ` Mark H Weaver
2021-05-02 20:51   ` Ludovic Courtès
2021-05-04 20:18     ` Maxime Devos
2021-05-06 16:30       ` Ludovic Courtès
2021-05-06 20:58         ` Maxime Devos
2021-05-11 20:29           ` Ludovic Courtès

unofficial mirror of guix-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-devel/0 guix-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-devel guix-devel/ https://yhetil.org/guix-devel \
		guix-devel@gnu.org
	public-inbox-index guix-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.devel
	nntp://news.gmane.io/gmane.comp.gnu.guix.devel


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git