Google Summer of Code 2010 Proposal: GMP Bindings for Parrot


Parrot currently has two PMCs that wrap functionality in GMP: BigInt and BigNum. This project will move these PMCs out of the main parrot repository and replace them with bindings to the GMP library. The project will focus on getting main integer and floating point functions over from GMP, replicating in part Math::GMPz and Math::GMPf.

Benefits to the Perl/Open Source Community

Some members of the parrot community have expressed their disgust with the current BigNum implementation.  Not only would this project provide a more elegant and efficient implementation, but GMP bindings would be available to any language implemented on top of Parrot – hence Rakudo would gain “free” bindings to GMP.  GMP bindings are also foundational for any future cryptographic libraries that may need to be written.


  • BigInt and BigNum PMCs based upon new GMP bindings that do not break current
  • Access to crucial GMP integer and floating point functions through NCI
  • Tests for every accessed function
  • Documentation for every function
  • Example code

Project Details

This project will provide access to the GMP library through the NCI (native call interface).  The focus will be to replace the existing BigInt and BigNum functionality by refactoring the PMCs to use the GMP NCI. The design will allow future work to bind to more functions or be easily modified if the GMP API changes in the future (though this is unlikely – GMP is fairly stable).  Though the bare-minimum amount of functionality required for BigInt and BigNum is proposed here, depending on time and speed of development I will essentially bind as many functions as I can.

Project Schedule

April 26th – May 24th: Begin and (hopefully) finalize design of new PMCs and GMP interface.  Start branch to move BigInt and BigNum out of main parrot repository.

May 24th – July 12th: Begin binding to necessary integer and float functions in GMP.  Write tests and documentation.

By July 12th: Have at least one of the PMCs functionally equivalent with it’s previous incarnation.  Have tests to prove this and documentation to explain it.

July 12th – August 9th: Finish second PMC and necessary NCI bindings.

By August 16th: Merge branch if it hasn’t already been merged into trunk.  Polish tests and documentation.

If I finish early or am ahead of schedule I will provide bindings, tests, and documentation to some of the other integer and float functions.  If I’m speeding through this, I will also provide the same for the GMP rational functions.

References and Likely Mentors

I’ve worked with Jonathan Leto on last year’s Google Summer of Code and work with him on Parrot currently.  Andrew Whitworth would also be a good mentor for this project as he works with parrot-linear-algebra and the HLL matrixy.


Artistic license 2.0 (same as Parrot)


My name is Bob Kuo and I am a 24 year old graduate student living in Champaign-Urbana, IL.  My undergraduate degree was in Math and Computer Science with classwork focusing on Number and Coding Theory, Numerical Analysis, and Algorithms.  I participated in last year’s Google Summer of Code with The Perl Foundation writing Math::Primality and finished ahead of schedule.  I have been involved with Parrot since the end of last year’s Google Summer of Code and am an active committer.  I currently work part-time as a web developer where I support a legacy PHP system and develop in Ruby/Rails.  I have been using Perl in web development and system administration for 4+ years.  I’ve contributed bug fixes to the CPAN modules CGI and Math::GMPz. You can see my open source code at


I am currently a full time student in graduate school at an accredited institution living in the United States.

Posted in Google Summer of Code | Comments Off on Google Summer of Code 2010 Proposal: GMP Bindings for Parrot

Comments are closed.