Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chromatic (983)

  (email not shown publicly)

Blog Information [] Profile for chr0matic []

Journal of chromatic (983)

Tuesday February 03, 2004
02:38 AM

Things I Should Care About but Don't, part mauve

[ #17173 ]

I don't particularly care about data alignment in memory. I don't write a lot of C these days. (Two small programs tonight would belie that, except that my device driver writing roommate helped me with one, not coincidentally to discover the actual memory layout of a struct.)

Of course, writing the SDL bindings for Parrot (and, yes, Parrot exists and, yes, you can write actual programs in it: witness examples/parrot/anim_parrot_logo.imc which runs at 680+ fps on my laptop) means I ought to care about the SDL data structures.

It turns out that XS (the Perl 5 way of accessing C libraries) has an advantage over NCI (the Parrot way of accessing C libraries). XS can manipulate C data structures directly, while NCI needs to wrap them in appropriate Parroty access glue. Of course, since I'm writing PIR (a nice wrapper around Parrot assembly), everything's a little verbose, but trying to give named access to struct members can take a lot of work. (That doesn't mean that SDL_Event isn't icky, though.)

Add to that alignment issues of structs, and things can get rather complicated pretty quickly.

Fortunately, I persevered, at least in the limited case. There's very little standing in the way of writing an actual (though simple) game with Parrot now. Give me another couple of weeks.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.