unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* foreign objects and the garbage collector
@ 2021-09-04 12:41 Tim Meehan
  2021-09-04 13:35 ` Vivien Kraus via General Guile related discussions
  0 siblings, 1 reply; 11+ messages in thread
From: Tim Meehan @ 2021-09-04 12:41 UTC (permalink / raw)
  To: guile-user

I was looking at writing something to interact with gpsd.
There is a shared memory interface, and a Unix socket interface. The
protocol spoken by gpsd is JSON, so I figured that I would just open up a
socket and start talking ... however ... really early on in the man page,
it says "it is a bad idea for clients to speak the protocol directly" (
https://gpsd.gitlab.io/gpsd/gpsd_json.html) presumably since the protocol
was likely to change? They didn't elaborate ...

There is a C interface described at (https://gpsd.gitlab.io/gpsd/libgps.html),
which has the familiar "open-and-get-opaque-thing" and
"close-opaque-thing-when-done" design.

I'd rather not compile anything in C, and just use the tools in Guile to
interact with libgps. Is there a way to get Guile's garbage collector to
call "gps_close" on the opaque structure returned by "gps_open"? Or is this
something that would be more handily implemented in a C extension?

Right now, because I'm just not concerned about sloppiness, I've just been
speaking the wire protocol, but I do feel bad about being sloppy and wanted
to clean it up for others to use perhaps.


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

end of thread, other threads:[~2021-09-21 18:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-04 12:41 foreign objects and the garbage collector Tim Meehan
2021-09-04 13:35 ` Vivien Kraus via General Guile related discussions
2021-09-05  0:58   ` Tim Meehan
2021-09-19  6:14   ` adriano
2021-09-19 18:11     ` Olivier Dion via General Guile related discussions
2021-09-19 18:23       ` Maxime Devos
2021-09-21 14:26         ` adriano
2021-09-21 18:49           ` Maxime Devos
2021-09-21 14:00       ` adriano
2021-09-21 14:25         ` Olivier Dion via General Guile related discussions
2021-09-21 14:51           ` adriano

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