[RFC] opengl_dynamic_nci branch

Geoffrey Broadwell geoff at broadwell.org
Fri Feb 12 19:06:35 UTC 2010


On Feb 12, 2010, at 10:25, Peter Lobsinger wrote:
> The opengl_dynamic_nci branch aims to demonstrate a different approach
> to C frame building using the opengl bindings.

That's always a good opening line.  :-)

> In stead of compiling all signature thunks statically into parrot or
> generating them at runtime using a JIT, a simple utility
> (tools/build/nativecall.pir) is provided to generate, from lists of
> signatures, C files containing desired thunks and a loader routine
> that can be invoked to load the thunks into parrot at runtime.

So you will be writing C files and compiling them when OpenGL is  
loaded?  In other words, the machine you install Parrot on will need  
to have all the build tools on it, just like the machine Parrot was  
built on?  (This sounds like the Inline:: family of modules in Perl  
5.)  If so, this will be a nice short-term solution (which is great,  
we need one), but in the long term we'll still need to implement a  
solution that doesn't require a C compiler at runtime.

My other question here is if there is any caching done?  (Similar to  
Inline, you would only want to do the recompile when not-previously- 
seen signatures are requested, otherwise it slows down every program  
load which uses an NCI library.)

> Slight modifications have been made to the configuration, make,
> and load aspects of the OpenGL bindings to use this utility as a
> proof of concept.

"Slight"?  I'm impressed by that.  :-)

> The benefits afforded by this approach are:
> * no need for external projects to register their nci signatures with
> core (config/gen/call_list/misc.in is evil and should die)
> * no need to recompile parrot when a new signature is required

No argument on either of these points.

> * no need to link parrot against a frame generation library (jit based
> or otherwise)

Whether we write it ourselves, or we use an existing solution, we will  
need to do this at some point ....

> * should work anywhere parrot's static frames would work

Excellent.  I would try it out myself right now ... if not for the  
fact that *two* of my computers have gone belly up, and I'm borrowing  
one that doesn't have a development environment.  :-(

I'll take a look at the branch as soon as I can get one of my dev  
boxen working again.


-'f



More information about the parrot-dev mailing list