|
From: | Paolo Bonzini |
Subject: | [Help-smalltalk] Re: freeglut and opengl bindings |
Date: | Wed, 15 Nov 2006 13:43:22 +0100 |
User-agent: | Thunderbird 1.5.0.8 (Macintosh/20061025) |
With SWIG, we get instant access to bindings for a lot of libs. Sometime back, took a look at the SWIG manual but my smalltalk is quite poor and I never really got the time to learn the language properly. Gotta do something about that...
Actually, most of porting SWIG would be about C/C++ coding. It creates C/C++ wrappers for all the functions -- quite different from what Brad has done so far, for example -- which accept language objects and call the underlying function. It could actually be faster if we had a primitive to do a C call directly, with no interpretation in cint.c.
While I was working on speeding up C call-outs, I just added a small feature. If you declare a method with <cCall: 'function'> (i.e. no returning: or args: keywords), it is the same as passing all the arguments as #smalltalk, plus (if the method is on the instance side) passing the receiver as #selfSmalltalk. This would be the calling convention that SWIG needs, and the new syntax (which is only a shortcut so far) might be transformed to a primitive if the SWIG plan materialized.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |