unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mike Gran <spk121@yahoo.com>
To: Guile User <guile-user@gnu.org>,
	 Guile-devel Development <guile-devel@gnu.org>
Subject: Guile foreign object interface
Date: Thu, 2 Mar 2017 15:47:58 +0000 (UTC)	[thread overview]
Message-ID: <1644439317.409814.1488469678720@mail.yahoo.com> (raw)
In-Reply-To: 1644439317.409814.1488469678720.ref@mail.yahoo.com

Hi All-
I wanted to make a quick post about the foreign object interface.
This is a bit of a placeholder because I haven't had time to
investigate the interface properly, yet. But I intend to poke at
it soon.
But for there record, there are some problematic design patterns
that I want to make sure can be covered by the new interface.
Again, I'll try to make proper examples soon, but, with Andy wanting
to release soon, I want to get this down now.

1. First off is a Lilypond-like pattern.  A C++ vector
is used to dynamically add or remove elements.  The memory
management of those elements lives in the C++ world.  Those elements
are boxed up as SCM.  GCing the SCM should not free its boxed
contents, but, deleting the boxed contents from the C++ side
should render those SCMs invalid in some sense. 
2. Mutually owned information. Two structures (A and B) both
mutually contain a non-GC-malloc'd structure C. C must exist
so long as one of A or B exist.
3. Here's one from guile-ncurses. An element ITEM is created with
some contents. Default memory management suffices: if ITEM is GC'd,
its contents are GC'd.  But the contents of ITEM can later be
attached to a COLLECTION. If ITEM is GC'd when attached to
COLLECTION, its contents are not GC'd.
5. Gobject-like subclassing.  In Gtk, an application window is
a type of a window which is a type of a widget which is a type of
object. If we were to resurrect an effort on GTK3 binding,
how would it work for foreign objects?
Again, forgive this random dump. Wanted to get something down now,
but I'll try to make a more sensible post later.
-Mike Gran



       reply	other threads:[~2017-03-02 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1644439317.409814.1488469678720.ref@mail.yahoo.com>
2017-03-02 15:47 ` Mike Gran [this message]
2017-03-06 20:26   ` Guile foreign object interface Andy Wingo
2017-03-06 20:26   ` Andy Wingo
2017-03-07 13:44   ` Ludovic Courtès
2017-03-07 14:21     ` Andy Wingo
2017-03-07 20:02       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1644439317.409814.1488469678720@mail.yahoo.com \
    --to=spk121@yahoo.com \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).