From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Kjetil S. Matheussen" Newsgroups: gmane.lisp.guile.devel Subject: Re: [patch] subordinate SMOBs with GOOPS superclasses Date: Sat, 15 Dec 2007 17:26:11 +0100 (CET) Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-764472858-1197735971=:9095" X-Trace: ger.gmane.org 1197790891 1461 80.91.229.12 (16 Dec 2007 07:41:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Dec 2007 07:41:31 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Dec 16 08:41:43 2007 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J3o86-0000S6-Il for guile-devel@m.gmane.org; Sun, 16 Dec 2007 08:41:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J3o7n-0008RZ-2z for guile-devel@m.gmane.org; Sun, 16 Dec 2007 02:41:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J3nBO-0001SO-MA for guile-devel@gnu.org; Sun, 16 Dec 2007 01:41:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J3nBL-0001Pj-Sa for guile-devel@gnu.org; Sun, 16 Dec 2007 01:41:01 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J3nBL-0001PN-HK for guile-devel@gnu.org; Sun, 16 Dec 2007 01:40:59 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J3jRF-0003ZY-W9 for guile-devel@gnu.org; Sat, 15 Dec 2007 21:41:12 -0500 Original-Received: from mail-forward.uio.no ([129.240.10.42]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J3ZuN-0005kC-PC for guile-devel@gnu.org; Sat, 15 Dec 2007 11:30:36 -0500 Original-Received: from mail-mx8.uio.no ([129.240.10.38]) by pat.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1J3ZqC-00005T-Mk for guile-devel@gnu.org; Sat, 15 Dec 2007 17:26:16 +0100 Original-Received: from bjo1-1x-dhcp290.studby.uio.no ([193.157.245.38]) by mail-mx8.uio.no with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1J3ZqA-00036C-9v for guile-devel@gnu.org; Sat, 15 Dec 2007 17:26:14 +0100 X-X-Sender: kjetil@ttleush In-Reply-To: X-UiO-ClamAV-Virus: No X-UiO-Spam-info: not spam, SpamAssassin (score=-0.0, required=5.0, autolearn=disabled, AWL=-0.030) X-UiO-Scanned: C0DCB142AEB13FC3BDDB168D9BCB9D55C761F3AC X-UiO-SPAM-Test: remote_host: 193.157.245.38 spam_score: 0 maxlevel 200 minaction 2 bait 0 mail/h: 1 total 613 max/h 6 blacklist 0 greylist 0 ratelimit 0 X-detected-kernel: by mx20.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:6936 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-764472858-1197735971=:9095 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Clinton Ebadi: > > Neil Jerram writes: > >> ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> >>> Hi Andreas, >>> >>> Andreas Rottmann writes: >>> >>>> You should probably also have a look at the Scheme-Level FFI of PLT >>>> Scheme[1], and my reimplementation for Scheme 48[2]. >>> >>> Thanks for the links, that's the kind of think I had in mind. Perhaps >>> you'd like to port S42 to Guile as well? :-) >> >> From a _very_ quick look, my impression is that the PLT FFI is about >> equivalent in complexity and function to what the code generation side >> of G-Wrap provides. >> >> If that's correct, then the key practical difference is that G-Wrap >> does everything at build/compile time, where PLT FFI does everything >> at runtime -- in which case, surely G-Wrap is the better option? > > I think doing things at runtime is a better idea--it fits more with > the interactive compile-one-expression-at-a-time nature of Lisp. > > UFFI and CFFI in the Common Lisp world work this way, and generally > bindings to C libraries are solid. There may be an increased risk of > crashing the system during the initial development stage, but once > speced out the data type specifications rarely change. Any strange > issues that occur when interfacing with C this way should also be > trappable and transformed into a Guile exception that could be caught > and not abort the entire system. At least in SBCL it takes a lot of > abuse before a C library can crash anything. > > Perhaps G-Wrap could be modified to work at runtime? A few utilities > from it would be of general use--e.g. the sublanguage for specifying > the layout of C structs could be used for generating high level > interfaces to network protocols without painful manual munging or > resorting to C. Its not quite the same thing, but eval-c works at runtime, and perhaps some tips can be picked up from its code: (load "eval-c.scm") (eval-c "-lgmp" =09"#include " =09(proto->public =09 "void mpz_init (mpz_t integer);" =09 "void mpz_set_ui (mpz_t rop, unsigned long op);" =09 "void mpz_add (mpz_t rop, mpz_t op1, mpz_t op2);" "unsigned long mpz_get_ui (mpz_t op);") =09(public =09 ( new-mpz (lambda () =09=09=09 (return (calloc 1 (sizeof ))))) =09 ( delete-mpz (lambda (( var)) =09=09=09 (free var))))) (let ((a (new-mpz)) (b (new-mpz))) (mpz_init a) (mpz_init b) (mpz_set_ui a 50) (mpz_set_ui b 60) (mpz_add a a b) (let ((res (mpz_get_ui a))) (delete-mpz a) (delete-mpz b) res)) =3D> 110 Code at http://snd.sf.net --8323328-764472858-1197735971=:9095 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --8323328-764472858-1197735971=:9095--