Posted:
SWIG is a programmer's tool designed to make it easier to use C and C++ code from other popular programming languages such as Python, Perl, Ruby, PHP, Java, and C#. 2009 was SWIG's second Summer of Code, and this year we mentored five projects related to SWIG. All five students were very active over the summer period and produced some great new features. In no particular order:

Matevž Jekovec has been busy working at the coal face of SWIG to add support for C++0x, the forthcoming C++ standard. Matevž has managed to achieve close to full support for C++0x. The C++0x Wikipaedia article details the numerous planned new features and Matevž has put together a SWIG C++0x page documenting the new SWIG support for each of these. In summary the enhanced C++ language can now be parsed by SWIG, which in itself is a great step. There is much more than just this though, as most of the information parsed is used to create useful wrappers of C++0x code. The work can be tried out on the C++0x branch which should be merged fairly soon into a forthcoming release.

Miklos Vajna has been working on SWIG's PHP support to implement an advanced SWIG feature already supported for most other target languages, but not PHP. The feature is called "directors" and allows cross-language polymorphism - wrapped C++ classes can be subclassed in PHP and virtual method calls work in the natural way, whether they're made from PHP or C++ code. You can read more in the new PHP Director documentation. Miklos made such great progress that we were able to merge this support into SWIG 1.3.40, which was released even before the Summer of Code finished. Miklos also spent some time working on improving SWIG's test suite for PHP, and fixing bugs in the PHP support.

Ashish Sharma spent the summer adding support for Objective-C as a new target language. Objective-C is a major language on the Mac OS X platform. This means that now SWIG can be used to generate Objective-C wrappers over C++ code. In particular the wrappers include proxy classes, which preserve the class hierarchy from the C++ code. Ultimately this means that from the user's perspective, proxy objects look no different to objects originally written in Objective-C. Adding a new target language is quite a considerable task and Ashish is keen to add plenty more improvements over the coming months. Ashish's work is in Subversion and can be accessed in the ashishs99 branch.

Baozeng Ding has also added a new target language, in this case for the Scilab language, a free numerical computing package. He has coded up support for all the C features: variables, functions, constants, enums, structs, unions, pointers and arrays and also intends to develop it further in the near future. Documentation for SWIG and Scilab can be viewed online direct from Baozeng's Subversion branch.

Kosei Moriyama has been working on Perl bindings for the Xapian library using SWIG, to replace some existing bindings implemented by hand. He's achieved almost complete compatibility with the API of the existing bindings (the only real omission is callbacks which are waiting for completion of director support for Perl in SWIG). He has also wrapped features which weren't previously accessible from Perl. You can view Kosei's work online in his Subversion branch.

Finally, many thanks to Google for sponsoring the Summer of Code and a special thanks for all the hard work done by the students, mentors and Olly Betts, the co-administrator.

Posted:


I recently attended PHP Quebec 2009. This was the seventh year of this gathering of PHP developers and though we had a new venue the conference was great as always. As one of my fellow speakers was ill, I jumped in to give the Writing PHP Extensions (PDF) talk along with Johannes Schluter. Even better, the talk on PHP - Worst Practices (PDF) was well received by the audience, with reactions to the material far more positive than I would have anticipated given that we've all engaged in these worst practices from time to time. You can also check out the slides from my third talk Objects for the Masses (PDF). On a more personal note, I was happy to hear and see that other presenters used the Google Chart API in their talks for examples.

The rest of the conference talks were luckily not completely focused on PHP 5.3. It turns out there's continued interest in the current stable platform, PHP 5.2. Folks are happy to give us core developers more time to add some new features, most notably closures , namespaces and Phar done right. Those who want to learn more about PHP 5.3 should check out Johannes' slides (PDF).

Posted:
By Cat Allman, Open Source Programs

The Annual O'Reilly Open Source Convention (OSCON ) is returning to Portland, Oregon, USA next week from July 21-25, and like swallows to Capistrano, Googlers will be there in force.

Between speakers, tutorial instructors, demo-ers of cool stuff in our booth, #116, and attendees, we expect to have upwards of 25 Googlers in attendance. Sessions with our speakers and instructors include:

On MONDAY, July 21st
PHP Extension Writing, Marcus Boerger, and Practical Test-driven Development, Josh McAdams.

On TUESDAY, July 22nd
An Open Source Startup in Three Hours, Gavin Doughtie, Porting to Python 3.0, Anthony Baxter, and People for Geeks, a panel including Brian Fitzpatrick, Ben Collins-Sussman, plus Tuesday evening is the annual Google O’Reilly Open Source Awards.

On WEDNESDAY, July 23rd
Subversion Worst Practices, Ben Collins-Sussman and Brian Fitzpatrick, Code Reviews for Fun and Profit, Alex Martelli, An Open Source Project Called 'Failure', a panel with Ben Collins-Sussman and Brian Fitzpatrick, Google XML Pages (GXP), Laurence Gonsalves and Harry Heymann, and The Google Open Source Update, Chris DiBona and Leslie Hawthorn.

On THURSDAY, July 24th
PLUTO: PL/SQL Unit Testing for Oracle, Josh McAdams, General Lightning Talks, lead by Anthony Baxter, Do You Believe in the Users?, Ben Collins-Sussman and Brian Fitzpatrick, CSS for High Performance JavaScript UI, Gavin Doughtie, Even Faster Web Sites, Steve Souders, and (The Lack of) Design Patterns in Python, Joe Gregorio.

On FRIDAY, July 25th
Open Source and Standards, Joe Gregorio

If you have questions about Google and Open Source, come on down. Hope to see you there.