Skip to content

GSoC_2018_project_interfaces

Lea Goetz edited this page Jan 29, 2018 · 2 revisions

SWIG interfaces: Matlab, Javascript (NodeJs), clean-ups

One of Shogun's biggest strengths is that it supports a wide range of interfacing languages. This project is about polishing the interfaces and extending them. In addition, we will clean up the testing framework.

Mentors

Difficulty & Requirements

Medium.

You need to know about

  • SWIG
  • Matlab/Scilab
  • Javascript
  • Shogun's modular interface framework
  • Shogun's meta example / testing framework
  • Cmake

Description

This project is about adding new interfaced languages. We want to focus on two extremely important ones: Matlab and javascript. The former is used heavily by the scientific community (in which Shogun has its roots) while the latter is very interesting for commercial applications of Shogun.

Details

Shogun over the years changed its face: we first only had static interfaces. Those are hand-crafted and every new algorithm needs to be added manually. This is cumbersome and leads to many parts not being visible from outside C++. Then the world became a better place and we started using SWIG. SWIG allows to automatically generate interfaces to a large range of target languages automatically. Every class added to Shogun is exposed to all languages with adding one line to the interface file. Magic.

Adding interfaces means writing typemaps for each added langauge. Those are C code that maps memory representations of the target language to those of Shogun. Since there are many existing typemaps that can be used for inspiration, this should not be too hard.

Next, we need to extend the meta example generation system to include the new languages. This requires reading the existing Python code, and extend where needed.

Finally, all new languages should be added to the cmake build and test system, which requires adapting existing codes.

Waypoints and initial work

For each langauge:

  • Build working proof of concept with minimal (or nop) typemaps (see here and here for javascript)
  • Integrate into build
  • Extend typemaps to cover all cases
  • Integrate meta examples, cookbook, test suite
  • Make sure integration tests (=all interfaces produce the same results) pass (i.e. your typemaps work correctly)

In addition, we would like to fix some of the issues with SWIG and the meta examples. Consider those entrance tasks

Why this is cool

Everyone wants Matlab and javascript interfaces, you will be a star! You will learn a lot about SWIG (which is amazing), software testing, and internals of Shogun's biggest strength of automagic interfacing to all languages. All in all, this is a real-world software engineering project! As an added bonus, you will get to know and could work with people from other open soucrce projects - share the GSoC love :)

Useful resources

Clone this wiki locally