1. PureLang
  2. Untitled project
  3. pure-lang

Wiki

Clone wiki

pure-lang / Addons

Addon modules for the Pure language

To turn Pure into a practical programming tool, we strive to provide a collection of useful addon modules and interfaces to third-party libraries covering various important programming areas, such as GUI, graphics, multimedia, databases, scientific programming, computer algebra etc. Suggestions and contributions are welcome. This page lists the addon modules which are already available or under development. Most of the addons are distributed under a commercial-friendly LGPL or BSD-style license. Please refer to the documentation in each package for copyright/license notes and installation instructions. Some additional libraries for Pure can be found at Michael Maul's pure-lang-extras and Kay-Uwe Kirstein's pure-vision project.

To use any of these, you also need the Pure interpreter. For your convenience, here are the download links for the latest version:

Note that some addons are also packaged separately for Windows, see the download links below. Packages of the interpreter and all addons are available for Ubuntu on Launchpad, and for Arch Linux in the Arch User Repositories (please see the Pure on Arch Linux wiki page for details). There's also a complete collection of Pure packages for Mac OS X at MacPorts; please check the Pure on Mac OS X wiki page for details. More information about ports and packages for other systems and distributions can be found on the main wiki page.

A classification of the available modules according to topic can be found in the documentation.



Utilities

Some utility programs written with or for Pure.

pure-doc

Author: Albert Graef <aggraef at gmail.com>

pure-doc is a simple source documentation and literate programming utility for Pure. It is designed to be used with the excellent docutils tools and the gentle RST markup format supported by these.

The basic idea is that you just comment your code as usual, but using RST markup instead of plain text. In addition, you can also designate literate programming fragments in your code, which will be translated to RST literal blocks automatically. You then run pure-doc on your source files to extract all marked up comments and the literate code blocks. The resulting RST source can then be processed with the docutils utilities like rst2html.py and rst2latex.py to create the documentation in a variety of formats.

Documentation is available in html format. The current sources are available here.

Download: pure-doc-0.7.tar.gz

pure-gen

Authors: Albert Graef <aggraef at gmail.com>, Scott E. Dillard

pure-gen is a C interface generator for the Pure language. It takes a C header file as input and generates a corresponding Pure module with the constant definitions and extern declarations needed to use the C module from Pure. pure-gen can also generate FFI interfaces rather than externs (using the pure-ffi module, see below), and it can optionally create a C wrapper module which allows you to create interfaces to pretty much any code which can be called via C. Interfaces to C++ can be made using SWIG's new C language module which can wrap arbitrary C++ libraries in C.

pure-gen itself is written in Pure, but it uses a C parser written in Haskell. A manual page is included, you can also read this online in html format. pure-gen is distributed under a BSD-style license, please see the COPYING file for details. The current sources are available here.

Download: pure-gen-0.20.tar.gz

faust2pd

Author: Albert Graef <aggraef at gmail.com>

faust2pd is a little utility to generate "graph-on-parent" GUI abstractions from Faust programs which make it easier to use Faust signal processing units with Miller Puckette's PureData (Pd). Faust is Yann Orlarey's functional language for real-time audio signal processing. (Pure also provides a direct Faust interface, see the manual for details.) The Pure faust2pd script is an enhanced version of an earlier Q script.

The documentation is available online in html format. faust2pd is distributed under GPLv3 (or later), please see the COPYING file for details. The current sources are available here.

Download: faust2pd-2.12.tar.gz
Windows package: faust2pd-2.12-win32.zip

Plugins

These plugins let you use Pure as an embedded scripting language in other environments.

gnumeric-pure

Author: Albert Graef <aggraef at gmail.com>

This package provides a Pure plugin for Gnumeric, the Gnome spreadsheet. The plugin allows you to extend Gnumeric with functions written in Pure, and also lets you use Gnumeric as a spreadsheet frontend to Pure. All Gnumeric data types are supported, as well as calling Gnumeric functions from Pure code and setting up asynchronous Pure data sources which are executed as background tasks. A function to render OpenGL scenes in Gnumeric is also provided.

Documentation is available in html format. Please also see the pure_func.pure and pure_glfunc.pure scripts for some examples. The current sources are available here. Sample spreadsheets can be found in the examples folder.

Download: gnumeric-pure-0.15.tar.gz

pure-gnumeric

pd-faust

Author: Albert Graef <aggraef at gmail.com>

pd-faust is a collection of Pd objects written using pd-pure which lets you run Faust programs inside Pd. It combines the functionality of pure-faust and faust2pd in a single package, and also features dynamic reloading of Faust plugins, automatic generation of controller GUIs and MIDI/OSC controller mappings, as well as OSC-based controller automation. It thus provides a complete solution for interactively developing Faust dsps in Pd.

pd-faust requires the pd-pure and pure-faust packages. The documentation is available online in html format. The current sources are available here.

Download: pd-faust-0.9.tar.gz
Windows package: pd-faust-0.9-win32.zip

pd-faust

pd-pure

Author: Albert Graef <aggraef at gmail.com>

Pd a.k.a. PureData is Miller Puckette's computer music and multimedia software which enables you to create interactive realtime applications in a convenient graphical programming environment. pd-pure is a Pure "loader" plugin for Pd, which allows you to write Pd control and audio objects in Pure. If you're into graphical/visual programming then this module provides you with an interesting way to run Pure in Pd by connecting Pure functions and other Pd objects to do complex signal processing tasks in realtime.

The documentation is available online in html format. Like Pd itself, pd-pure is distributed under a BSD-style license, please see the COPYING file for details. The current sources are available here.

Download: pd-pure-0.20.tar.gz
Windows package: pd-pure-0.20-win32.zip

The Windows binaries should work with recent versions of both Miller Puckette's "vanilla" Pd and Christoph Steiner's Pd-Extended packages. The contents of this package should go into a directory which Pd searches for externals; please check the documentation for details. (Mac users can get a suitable package from MacPorts, please check the Pure On Mac OS X wiki page for details.)

Library Modules

The following library modules can be used in Pure programs. They mostly provide interfaces to various useful third party libraries and/or data formats.

pure-audio

Author: Albert Graef <aggraef at gmail.com>

pure-audio is a digital audio interface for the Pure programming language. It currently includes wrappers for PortAudio, FFTW3, libsndfile and libsamplerate, as well as a realtime module which gives Pure scripts access to realtime scheduling on systems which have a pthreads library with the POSIX realtime threads extension.

See the README file for more information. pure-audio is distributed under a BSD-style license, please see the COPYING file for details. The current sources are available here.

Download: pure-audio-0.6.tar.gz
Windows package: pure-audio-0.5.msi

pure-avahi

Author: Albert Graef <aggraef at gmail.com>

This is a simple interface to Avahi, a Zeroconf implementation for Linux and other Un*x systems. The module lets you publish and query Zeroconf network services using Avahi, allowing you to establish connections for various kinds of TCP and UDP network services without having to manually configure network addresses. It is typically used along with the pure-sockets module which lets you create the network connections discovered with avahi.

There's also a companion pure-bonjour module which implements the same API on top of Bonjour, Apple's Zeroconf implementation.

Documentation in html format is available here and here. The current sources can be found here and here.

Download: pure-avahi-0.3.tar.gz (Linux), pure-bonjour-0.1.tar.gz (Mac OS X)

pure-csv

Author: Eddie Rucker <erucker at bmc.edu>

pure-csv is a module for reading and writing Comma Separated Value (CSV) files from within Pure. Please make sure to read the README file in the package for installation instructions and take a peek in the examples sub-directory for module usage.

The module is based on the q-csv module which is loosely based on Python's CSV module. The module accepts quotes and field delimiters of more than one character as a means of handling Unicode. Currently, pure-csv has three built in dialects, RFC4180 standard, "default" (RFC4180 without '\r's), and "EXCEL" but provides a simple user interface for creating new dialects. Examples are provided with the accompanying documentation. Since the reading, writing, and conversion routines are written in C, operations are efficient.

Documentation is available in html format. pure-csv is distributed under a BSD-style license, please see the COPYING file for details.

Note that the routines may be abused for many purposes other than just importing and exporting data files. For example, they are useful for configuration and temporary data files.

Please send bug reports or questions to pure-lang@googlegroups.com.

Download: pure-csv-1.6.tar.gz

pure-fastcgi

Author: Albert Graef <aggraef at gmail.com>

A FastCGI interface, which is useful for developing server-side web applications with Pure. Compared to normal CGI scripts, this has the advantage that the script keeps running and may process as many requests from the web server as you like, in order to reduce startup times and enable caching techniques. Most ordinary CGI scripts can be converted to use FastCGI with minimal changes. Your server needs a FastCGI module to make this work; such modules are readily available for most popular web servers.

Documentation is available here. The current sources can be found here.

Download: pure-fastcgi-0.6.tar.gz

pure-faust

Author: Albert Graef <aggraef at gmail.com>

pure-faust provides an interface to Yann Orlarey's Faust programming language, so that you can load and run Faust-generated signal processing modules in Pure. Faust is a functional programming language for real-time sound processing and synthesis developed at Grame and distributed as GPL'ed software. With Faust you can develop signal processing algorithms in a high-level functional language, but still achieve a performance comparable to carefully handcrafted C routines.

Please note that recent Pure versions also provide a direct Faust interface which includes the ability to inline Faust code in Pure programs. The built-in interface requires faust2, the latest Faust incarnation from Faust's git repository, which is still under development. pure-faust can be run on top of the built-in Faust interface, but also continues to work with mainline Faust. It provides an alternative interface which is tailored for applications which load Faust dsps dynamically at runtime.

This is a port of an earlier Q module. The current sources can be found here. Preliminary documentation is available online in html format.

Download: pure-faust-0.11.tar.gz

pure-ffi

Author: Albert Graef <aggraef at gmail.com>

The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.

This module provides an interface to libffi which enables you to call C functions from Pure and vice versa. It extends and complements Pure's built-in C interface in that it also handles C structs and makes Pure functions callable from C without writing a single line of C code. Moreover, depending on the libffi implementation, it may also be possible to call foreign languages other than C.

Abridged documentation is available online in html format. The current sources are available here.

Download: pure-ffi-0.14.tar.gz

pure-g2

Author: Albert Graef <aggraef at gmail.com>

This is a straight wrapper of the g2 graphics library.

g2 is a simple, no-frills 2D graphics library, distributed under the LGPL. Quoting from the g2 website, "it's easy to use, portable and supports PostScript, X11, PNG and Win32." Just the kind of thing that you need if you want to quickly knock out some basic graphics, and whipping out the almighty OpenGL or GTK/Cairo seems overkill.

The current sources can be found here. Installation instructions can be found in the README file, and the package also contains a few examples.

Download: pure-g2-0.3.tar.gz

pure-gl

Authors: Albert Graef <aggraef at gmail.com>, Scott E. Dillard

pure-gl is Pure's interface to OpenGL, the well-known graphics library. It covers pretty much all of OpenGL, including the popular extensions. Extensions are loaded on demand, functions will throw an exception if they are not available in your OpenGL implementation.

See the README file for more information. pure-gl is distributed under a BSD-style license, please see the COPYING file for details. The current sources are available here.

Download: pure-gl-0.9.tar.gz
Windows package: pure-gl-0.8.1.msi

pure-glpk

Author: Jiri Spitz

This module provides a feature complete GLPK interface for the Pure programming language, which lets you use all capabilities of the GNU Linear Programming Kit (GLPK) directly from Pure. The module is under development (the interface is more or less complete and working but the documentation is still under construction). pure-glpk is distributed under the GPLv3, please see the COPYING file for details. You can find the current current sources here.

Download: pure-glpk-0.5.tar.gz

pure-gplot

Author: Kay-Uwe Kirstein

This module provides an interface to the Gnuplot plotting utility. Plot commands and the respective data is send to Gnuplot via stdin-pipe. The module is still under development, but provides basic 2d plotting functionality. 3d-plots (splot) are not directly supported, yet. pure-gplot needs a standard Gnuplot installation and is distributed under the GPLv3. Documentation is available in html format. The current sources can be found here.

Download: pure-gplot-0.1.tar.gz

pure-gsl

Authors: Albert Graef <aggraef at gmail.com>, Eddie Rucker <erucker at bmc.edu>

Building on Pure's GSL-compatible matrix support, this module aims to provide a complete wrapper for the GNU Scientific Library which offers a wide range of mathematical routines useful for scientific programming, number crunching and signal processing applications. This is work in progress, only a small part of the interface is finished right now. Here is a brief summary of the operations which are implemented:

  • Matrix-scalar and matrix-matrix arithmetic. This is fairly complete and includes matrix multiplication, as well as element-wise exponentiation (^) and integer operations (div, mod, bit shifts and bitwise logical operations) which aren't actually in the GSL API.

  • SVD (singular value decomposition), as well as the corresponding solvers, pseudo inverses and left and right matrix division. This is only available for real matrices right now, as GSL doesn't implement complex SVD.

  • Random distributions and statistic functions.

  • Polynomial evaluation and root finding.

  • Linear least-squares fitting. Multifitting is not available yet.

You can find the current sources here. pure-gsl is distributed under the GPLv3 (or later), see the COPYING file for details. Please also see the README file for installation instructions, and gslexample.pure for some examples. Documentation is available in html format.

Download: pure-gsl-0.12.tar.gz

pure-gtk

Author: Albert Graef <aggraef at gmail.com>

pure-gtk is a collection of bindings to use the GTK+ GUI toolkit version 2.x with Pure. The bindings include the gtk (+gdk), glib, atk, cairo and pango libraries, each in their own Pure module. At present these are just straight 1-1 wrappers of the C libraries, created with pure-gen. So they still lack some convenience, but they are perfectly usable already, and a higher-level API for accessing all the functionality will hopefully become available in time.

Please see the README file for installation instructions and licensing conditions, and hello.pure in the source for a basic example. The files uiexample.pure and uiexample.glade show how to run a GUI created with the Glade interface builder.

Note that if your version of GTK+ and/or the support libraries differs widely from what I have then you may have to regenerate the headers with pure-gen (make generate does this). The present version of the bindings were created with GTK+ 2.24.4 on Ubuntu 11.04.

Download: pure-gtk-0.13.tar.gz
Windows package: pure-gtk-0.10.msi (Note: You'll also need GTK+ 2.22 from the GTK+ website.)

pure-liblo

Author: Albert Graef <aggraef at gmail.com>

The liblo library is a lightweight C implementation of Berkeley's OSC ("Open Sound Control") protocol. It allows you to read and write OSC-formatted data across the network, and can also be used to communicate with various OSC-enabled devices and multimedia software in realtime.

The Pure module provides complete Pure bindings of liblo (lo.pure) along with a more high-level interface which makes it easy to implement both OSC clients and servers (osc.pure).

Abridged documentation is available online in html format. The current sources are available here.

Download: pure-liblo-0.9.tar.gz
Windows package: pure-liblo-0.8.msi

pure-lilv

Author: Albert Graef <aggraef at gmail.com>

This package provides a Pure module for David Robillard's Lilv, a library for LV2 plugin host writers. LV2 is the new audio and MIDI plugin standard for Linux and other Unix-like systems, successor of the venerable LADSPA standard. This Pure module lets you write LV2 plugin hosts in Pure, so that you can run LV2 plugins with Pure.

Abridged documentation is available online in html format. The current sources are available here. A companion module for writing LV2 plugins in Pure is also available; please check the pure-lv2 package below.

Download: pure-lilv-0.4.tar.gz

pure-lv2

Author: Albert Graef <aggraef at gmail.com>

This package provides a generic LV2 plugin wrapper for Pure which can be linked with batch-compiled Pure scripts to obtain LV2 plugin modules. For convenience, a shell script named pure2lv2 is included, which lets you compile the plugin and turn it into a complete LV2 bundle (consisting of an LV2 plugin manifest and the plugin binary), ready to be loaded by any LV2 host.

Abridged documentation is available online in html format. The current sources are available here. A companion module for writing LV2 plugin hosts in Pure is also available; please check the pure-lilv package above.

Download: pure-lv2-0.2.tar.gz

pure-midi

Author: Albert Graef <aggraef at gmail.com>

pure-midi is Pure's interface to MIDI, the "Musical Instrument Digital Interface". This module enables you to process MIDI data from hardware devices and other MIDI applications in realtime and also provides support for reading and writing standard MIDI files. To these ends, it provides wrappers around Roger B. Dannenberg's PortMidi library (part of the PortMedia project) and David G. Slomin's midifile library (from his MIDI Utilities package).

See the README file for more information. pure-midi is distributed under a BSD-style license, please see the COPYING file for details. The current sources are available here.

Download: pure-midi-0.6.tar.gz
Windows package: pure-midi-0.5.msi

pure-mpfr

Author: Albert Graef <aggraef at gmail.com>

pure-mpfr is an interface to the GNU mpfr library for performing multiprecision floating point arithmetic with proper rounding. The module plugs into Pure's numeric tower, overloading some of the operations in the math.pure module in order to provide seamless integration of mpfr numbers with the Pure language. The desired precision can be changed on the fly, and the module hooks into the interpreter to pretty-print mpfr numbers in decimal format.

The current sources can be found here, and documentation in html format is available here.

Download: pure-mpfr-0.5.tar.gz

pure-octave

Author: Albert Graef <aggraef at gmail.com>

This module provides an interface to Octave, the premier open source numeric math software. It embeds the full Octave interpreter into your Pure programs. You can execute arbitrary Octave code, exchange data between Pure and Octave, execute Octave functions directly from Pure (including support for Octave "inline" functions), and also call Pure functions from Octave. The mapping between Pure and Octave data such as matrices and strings is straightforward and handled automatically.

The current sources can be found here. pure-octave is distributed under the GPLv3 (or later), see the COPYING file for details. Documentation in html format is available here.

Download: pure-octave-0.7.tar.gz

pure-odbc

Authors: Albert Graef <aggraef at gmail.com>, Jiri Spitz

A port of Q's ODBC module, which provides access to all ODBC-capable databases, including MySQL, PostgreSQL and SQLite (via the SQLite ODBC driver). Documentation is available online in html format. The current sources can be found here.

Download: pure-odbc-0.10.tar.gz

pure-rational

Author: Rob Hubbard, Jiri Spitz

A rational number library, originally written by Rob Hubbard for Q, ported to Pure by Jiri Spitz. Provides a wealth of additional functions useful for dealing with rational numbers, including continued fractions, various approximation routines, string formatting and evaluation and support for complex rationals. Please see the documentation for details. The current sources can be found here.

Download: pure-rational-0.1.tar.gz

pure-readline

Author: Albert Graef <aggraef at gmail.com>

A simple interface to the GNU readline and BSD editline libraries. The current sources can be found here. (Please note that while pure-readline itself is just a few lines of trivial glue code released under a simple all-permissive license, it needs to be linked against either GNU readline or BSD editline, so if you use this module then you are also bound by the corresponding license terms, which means GPLv3+ in the case of readline, and the BSD license in the case of editline.)

Download: pure-readline-0.3.tar.gz

pure-reduce

Authors: Albert Graef <aggraef at gmail.com>, Kurt Pagani kp@scios.ch

An interface to REDUCE, the venerable computer algebra system which is still going strong. This module embeds the REDUCE system in Pure, so that you can employ Pure as a full-featured computer algebra system. With Pure 0.56 and later this module can also be used in conjunction with the Pure TeXmacs plugin. Please note that this module is still somewhat experimental, but the basic functionality already works, and the package includes some examples illustrating its use.

More information can be found in the online documentation. The current sources can be found here.

Download: pure-reduce-0.4.tar.gz
Mac OS X package: pure-reduce-0.4-macosx-x86_64.zip

A stripped-down Reduce package which is sufficient to build the Reduce library and image required by the pure-reduce module can be found here: reduce-algebra-csl-r2204.tar.bz2

pure-sockets

Author: Albert Graef <aggraef at gmail.com>

A Pure interface to the Berkeley socket functions. Provides most of the core functionality, so you can create sockets for both stream and datagram based protocols and use these to transmit messages. Unix-style file sockets are also available if the host system supports them.

Documentation in html format is available here. The current sources can be found here.

Download: pure-sockets-0.7.tar.gz

pure-sql3

Author: Peter Summerland, Albert Graef <aggraef at gmail.com>

Sql3 is an interface to the popular Sqlite3 database. The module provides a minimal wrapper around Sqlite3's C interface which is designed to give the developer access to all of Sqlite3's features in a way that is convenient for Pure programmers. It provides a handful of convenience functions that make the "core" functions in the interface easier to use, while at the same time "keeping out of the way" so the user can tap into the rest of the C interface directly.

The current sources can be found here. Documentation in html format is available here.

Download: pure-sql3-0.5.tar.gz

pure-stldict

Author: Albert Graef <aggraef at gmail.com>

This package provides a light-weight, no frills interface to the C++ dictionary containers map and unordered_map, see the C++ standard library documentation for details. The stldict module makes these data structures available in Pure land and equips them with a (more or less) idiomatic Pure container interface.

Documentation in html format is available here. The current sources can be found here.

Download: pure-stldict-0.8.tar.gz

pure-stllib

Author: Peter Summerland

The C++ Standard Template Library ("STL") is a library of generic containers (data structures designed for storing other objects) and a rich set of generic algorithms that operate on them. pure-stllib provides Pure interfaces to a selection of containers from the library, specialized to hold pointers to arbitrary Pure expressions. pure-stlvec is a Pure interface to C++'s vector and the STL algorithms that act on them. pure-stlmap is an interface to six (of the eight) of C++'s associative containers: map, set, multimap, multiset, unordered_map and unordered_set.

The current sources can be found here. Documentation in html format is available here.

Download: pure-stllib-0.6.tar.gz

pure-tk

Author: Albert Graef <aggraef at gmail.com>

This is a much improved port of the Q Tk module which lets you develop GUI applications with Tcl/Tk. The module embeds a Tcl/Tk interpreter in your Pure programs.

As a GUI toolkit, Tk is somewhat old-fashioned, but it has a really nice canvas widget and nothing beats Tcl's simplicity if you want to quickly knock out a GUI for your application. Also, the Pure module includes some special support for Peter Baum's Gnocl extension which turns Tcl into a frontend for GTK+/Gnome development and provides a convenient alternative to using Pure's GTK+ interface in a direct fashion. Another nice addition is VTK, a powerful open-source 3D visualization toolkit which comes with full Tcl/Tk bindings. Last but not least, Tcl offers its own extensions for almost every area of programming, so this module can also serve as a bridge to various non-GUI libraries.

The current sources can be found here. Examples are included in the package, and you can also find some complete demo applications here. Documentation in html format is available here.

Download: pure-tk-0.5.tar.gz
Windows package: pure-tk-0.3.msi (You'll also need Tcl/Tk 8.5. Also, a Windows build of Gnocl 0.9.95 is included in the package. You can also get this as a separate download here; this also includes the required libglade dll. Note that in order to use Gnocl on Windows, you'll also need GTK+ for Windows.)
Mac OS X package: pure-tk-0.5-macosx-x86_64.zip (This provides an alternative to the MacPorts pure-tk package which links against the system Tcl/Tk libraries. The Pure On Mac OS X wiki page lists the other optional bits and pieces that you will want to get to make the Gnocl and VTK interfaces work.)

pure-tk

pure-xml

Author: Albert Graef <aggraef at gmail.com>

This is a port of Q's XML module, which also includes support for XSLT. The module provides a simplified interface to the Gnome libxml2 and libxslt libraries, and supplies all the necessary data structures and operations to inspect, create, modify and transform XML documents with ease.

Documentation is available online in html format. The current sources can be found here.

Download: pure-xml-0.7.tar.gz

Updated