bubaflub's blog

Parrot-GMP: Almost done

It's been a while since I've posted - real life has been crazy with moving and setting up and finals. That's my fault because I didn't take into account the fact that I would be moving nor my finals being right around the time GSoC would be ending. The good news is that I've moved and setup my place (hooray for having my own office) and my classes are done - I've written the last research paper and taken my last final for my masters.

Parrot-GMP: Hiatus while I move across town

My coding has been put on hold this week as I move across town and deal with some shenanigans from the landlord. The good news is that my wife and I should be able to move into our new house on Tuesday or Wednesday - the bad news is that I am currently internet-less until then. I've been working on updating the tutorial which doesn't require any internet access, just time. By this time next week I hope to complete the tutorial, have some more examples, and begin trying to get some examples in NQP or even on Rakudo.

Parrot-GMP: NCI Thunk generation complete

Just a small re-cap from my last post - not every possible function signature that you might want to call through NCI comes built into Parrot. When you try to invoke a function that does not have a generated NCI thunk you will get a run-time error. GMP had a number of functions that were not covered by the built in NCI thunks so I installed libffi to get around this problem. Jay++ and dukeleteo++ have both started projects that will use NCI to some extent and are running into this problem as well. So I decided to tackle how to get around this problem without requiring libffi.

Parrot-GMP: VTABLE Overrides complete

This week I finished implementing VTABLE overrides for Parrot-GMP. This allows us to do things like x = y + z where x, y, and z are all GMP Integer objects. I also have a test suite to ensure that these overrides work. It's not very glamorous work but it's a nice layer of sugar and makes sure that Parrot-GMP plays nice with others.

Parrot-GMP: Random Numbers, Distutils, Plumage, VTABLE overrides

This week many Parrot-teers and Perl hackers (and many of my co-workers) were at YAPC::NA. I originally planned on attending but my car broke down earlier this summer and I had to pay for repairs. While there dukeleto++ (my GSoC mentor) and colomon++ both asked how to install Parrot-GMP. I had been so focused on getting the guts and the test suite together that I had completely neglected my README and had no way of automating an install.

Parrot-GMP: Even more tests and NCI work

Nothing too glamorous to report again - the test suite continues to grow. All functions are currently covered (and passing) except for functions related to random numbers. These functions are especially tricky because they rely on a special C-struct to both hold the seed and point to which pseudo-random number function we want to use. GMP is flexible in that there are multiple functions a user can choose from - some which favor speed and others which favor randomness - but the code is messy. Furthermore, to handle structs in NCI we need something called a StructView.

Parrot-GMP: More Tests

Nothing terribly exciting to report - progress is continuing as I am writing more and more tests to cover all of the GMP Integer functions. A function is considered covered when there are at least two tests that call that function. I've used Whiteknight++'s Rosella library for both the testing harness and the tests themselves. The harness is written in NQP while the individual test files are written in Winxed. This isn't a big problem since both NQP and Winxed come bundled with Parrot.

Parrot-GMP: Generated Code, Strings, and Tests

A lot has happened since my last update. I have finished tweaking the script that generates the Winxed convenience class as well as inline POD documentation. The NCI PIR bindings use the internal names (such as __gmpz_init) and have no safety features whatsoever - they are the absolute bare minimum to call these functions.

Parrot-GMP: Yo dawg, heard you like generating code...

Step 1 for my project involved reading GMP.h and generating an NCI definition file from that. I've tweaked a few settings in the unimaginatively named "gmph2ncidef.pl" script that does that and refactored some common parts out in to YAML configuration files. This generates a PIR source file that gives us access to the GMP library functions.

Parrot-GMP: Step #1 complete

I've just finished step one of the project: minimally parsing the header gmp.h and generating an NCI definition file that is readable by the script ncidef2pir.pl. I'd definitely like to refactor this script into separate modules (with tests and docs) and make it usable for the larger community, but for now it suffices for the project.

Syndicate content