Generating Objective-C Code With a Ruby DSL

vMAT uses a ruby DSL to do code generation for certain repetitive code patterns. For example, the way coercions between matrices of different types is handled (dynamically, at runtime1) currently requires implementing an Objective-C++ dispatch method to copy to every numeric type from every numeric type. With 10 distinct numeric types that is 100 Objective-C++ methods that are slight variations of the same method template.

This is the problem that vMATCodeMonkey was designed to solve. Read on →

The vMAT Manifesto

The vMAT library is intended to make moving code and data between MATLAB1 and Objective-C++ apps as straightforward and painless as possible.

  • The vMAT_Array class provides an Objective-C container type encapsulating matrices and arrays.
  • Overloaded operators and core numerical algorithms are provided by the Eigen C++ template library; the vMAT::Mat template class provides C++ code access to the contents of a vMAT_Array as an Eigen::Map matrix.
  • The vMAT_load and vMAT_save API functions provide read/write access to MATLAB’s .mat files for array data storage.
  • A small (but growing) library of commonly-used MATLAB functions are provided as C-style vMAT_API functions.
  • The library is packaged using CocoaPods for convenient dependency management, and distributed under the OSI-approved, commercial-developer-friendly BSD 2-Clause License.
Read on →