From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Guile foreign object interface Date: Thu, 2 Mar 2017 15:47:58 +0000 (UTC) Message-ID: <1644439317.409814.1488469678720@mail.yahoo.com> References: <1644439317.409814.1488469678720.ref@mail.yahoo.com> Reply-To: Mike Gran NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1488469732 20354 195.159.176.226 (2 Mar 2017 15:48:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 2 Mar 2017 15:48:52 +0000 (UTC) To: Guile User , Guile-devel Development Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 02 16:48:49 2017 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjSy9-000460-M0 for guile-devel@m.gmane.org; Thu, 02 Mar 2017 16:48:41 +0100 Original-Received: from localhost ([::1]:53033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjSyC-0005rP-N3 for guile-devel@m.gmane.org; Thu, 02 Mar 2017 10:48:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjSy2-0005rF-QC for guile-devel@gnu.org; Thu, 02 Mar 2017 10:48:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjSxz-0004yP-2n for guile-devel@gnu.org; Thu, 02 Mar 2017 10:48:34 -0500 Original-Received: from nm3-vm6.bullet.mail.ne1.yahoo.com ([98.138.91.96]:39183) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjSxy-0004xo-TO for guile-devel@gnu.org; Thu, 02 Mar 2017 10:48:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1488469709; bh=td0U68mXTim1JdfY2UDwXzJQTwg8+UI67Frga6tEnXs=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=ibDB/A3i57igoDSzoa9bcgNtEjfkRwBHB0nHAOI6Fj7iqU1O6DaA1Z2EuaSOFWWBBmbC7oaF9BPq/LW2g3IiE5d2OSiOngouiFUPW/I7bHqqtavs5w5yTDDHCgliJXMnTNSJbhtT6FK0QRS24WI0KuzJuz/7TWh3m6rDT+ZT0U5aAWrcYvHGe1eI4Z0L2hII/SDfsemvR2Ea15eTxYJT/v1OVn4B0h16UzVQCrbaDenU5V4ftjxdI9niQSimBgsLCWQ3+bAmCfN0Mcnw3ZdyulUC/wszNS3ib2EGmHyaFGE1xz0bvOZb4c4sVaysUZdpmn3lXjb7yhIx1sYXoImjSA== Original-Received: from [98.138.100.115] by nm3.bullet.mail.ne1.yahoo.com with NNFMP; 02 Mar 2017 15:48:29 -0000 Original-Received: from [98.138.88.239] by tm106.bullet.mail.ne1.yahoo.com with NNFMP; 02 Mar 2017 15:48:29 -0000 Original-Received: from [127.0.0.1] by omp1039.mail.ne1.yahoo.com with NNFMP; 02 Mar 2017 15:48:29 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 839122.17643.bm@omp1039.mail.ne1.yahoo.com X-YMail-OSG: 2xVBTU8VM1k_fkIryaFX2y_3aEIYGeb3Mw0oBVJkprOA8a8DEzHel9yJs1J0AAc KRYMfJBLxiF7f5b57RpT_m8W7LceBMrlAcCrRmME1LUBM5.cKBJ3mhnhHokbXuG4YHzYb1zTtUwF Ykt092Stb7lPa1rslNsFAW2DyhFQVvtD58haMunXH56s9CtRKEixTUKPVxXLHpbuOJaS06nke6IX AHN1hyck9WQjmISh_bKKp7epoMafwaSYTw__ZylZ2.6HxKbHWZQ2hDK56pToQ3cqwOhhEYuHoJc2 wUHFqq8fTvJxlYCLT1G7BrR_ImhsP7ZKEZjPxH1_fIL9mM8TK8P8dW39h4PkqW4lHko2S_qEY40W MJ2kLfmrX_MPcIKHpD54okT4Iwy64079fkL2YviXPmIGFhZqYyWfhSKtrzBUiK4ZzU8oeQjJ204T 9FiRI9XmgOzx7RUIhFtu9me1Va00b3Xfa5J2FA1a8Tg44XbAlOrPrFKa.CjXptdZ93jkvWcQYyg9 c6Q8uhN32eCNZj83GeoOA6v6ZEwA1QNOT5aYxTRGvgZBhSQ-- Original-Received: from jws200070.mail.ne1.yahoo.com by sendmailws120.mail.ne1.yahoo.com; Thu, 02 Mar 2017 15:48:29 +0000; 1488469709.426 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 98.138.91.96 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18979 gmane.lisp.guile.user:13380 Archived-At: 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