Skip to content

Commit

Permalink
updates to README and TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
bubaflub committed Jun 22, 2011
1 parent 02d060b commit 6a08506
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
34 changes: 25 additions & 9 deletions README.md
Expand Up @@ -3,15 +3,31 @@ Readme

Parrot-GMP aims to provide low-level bindings to the GMP library.

Currently test.pir shows a very basic usage of GMP inside Parrot.
Currently examples/basic.winxed shows a very basic usage of GMP inside Parrot.

How it will eventually work:
There is inline function-level documentation (straight from the GMP manual) included, use `perldoc src/GMP/Integer.winxed` to read it.

A NCI definition file will sit in src/GMP/raw.nci
tools/dev/ncidef2.pl will read this file and generate low-level PIR functions to call the corresponding GMP calls
Distutils will be used to automate this building process and run the tests
Documentation will be on each function
Examples will be plentiful and useful
A wrapper class will be written in Winxed for convenience
Using the PIR functions will allow you to shoot yourself in the foot while segfaulting because that is fast. The PIR functions do no type checking and match the internal naming style of GMP ('\_\_gmpz\_add\_ui'). The Winxed convenience class does basic type checking and matches the documentation naming style of the GMP functions ('mpz\_add\_ui').

Using the PIR functions will allow you to shoot yourself in the foot while segfaulting because that is fast.
How it works:

Pre-build:

1) The script gmph2ncidef.pl reads gmp.h and outputs an NCI definition. Combining that output with src/GMP/Raw.nci.template gives us the NCI definition file at src/GMP/Raw.nci and it is included with the distribution.
2) A script included with parrot in tools/dev/ncidef2.pl reads this NCI definition file and generate low-level PIR functions to call the corresponding GMP calls. This is src/GMP/Raw.pir and included with the distrubtion.
3) The script gmpdoc2winxed.pl reads the GMP documentation (as a single HTML file) and outputs Winxed function calls. Combining that output with src/GMP/Integer.winxed.template gives us the Winxed file at src/GMP/Integer.winxed and it is icnluded with the distribution.

Build:

1) Compile src/GMP/Raw.pir to src/GMP/Raw.pbc. This gives us PIR level bindings to the GMP library.
2) Compile src/GMP/Integer.winxed to src/GMP/Integer.pir and then to src/GMP/Integer.pbc. This gives us the Winxed convenience class and all the functions with convenient names.

Test:

1) parrot-nqp t/harness will run all of the included tests.

In the future:

* Distutils will be used to automate this building process and run the tests
* Installable from plumage
* Examples will be plentiful and useful
4 changes: 1 addition & 3 deletions TODO.md
@@ -1,8 +1,6 @@
TODO
====

* use Winxed for a sane-wrapper class with convenience methods (Issue #10)
* Harvest Math::GMPz tests or GMP internal tests for functions (Issue #8)
* documentation on those functions (Issue #9)
* use distutils to build libraries (Issue #5)
* build examples in HLLs (Issue #11)
* add vtable overrides (Issue #19)

0 comments on commit 6a08506

Please sign in to comment.