I'm looking at writing Parrot support for a vendor library: IBM MQ (Message Queueing, aka "MQSeries", aka "WebSphere MQ"). The current perl module (which I maintain) uses XS code and Parrot's NCI should simplify this a lot.
I have two questions though: - MQ has some data structures that are a tad too complex to use Parrot's UnManagedStruct and ManagedStruct. In addition, the C structures need to be initialized with a non-zero default from an IBM header file, so there needs to be C code. Does anyone have code examples of how to create a PMC class that maps to external C structure definitions and how to use such a PMC class with NCI code? - MQ has constants. Thousands of them. In the perl module, these get mapped to perl XS subroutines (which bloats the symbol table no end). For parrot, I'd prefer to use two big hash tables of the type name => PMC with (value, kind, description) value => name (for reason codes only) What's the best way to create a big hash table in parrot? I have an existing perl script to parse the IBM MQ header files and generate perl source code, so generating parrot code is not the issue - really, it's what the best structure in parrot is. I'd prefer to optimize for smallest data structure size, and am willing to take a minor hit at lookup time; looking up constants is not performance-critical.