Bear Metal

Ruby C extensions

Our expertise

We’ve been around the block. MANY times

We have advanced knowledge of MRI Ruby internals, the extensions interface and how to make everything work nicely on various platforms and with the Ruby Garbage Collector and virtual machine.

Some of our work - a MQTT client

Xively reached out to us for a stable Ruby client for their “internet of things” platform. We opted for wrapping libmosquitto, a performant and well maintained MQTT protocol client - it now lives at xively/mosquitto

Other Open Source efforts:
Presentations and talks

We presented on extensions best practices and the Ruby VM at various conferences.

Debugging

ERROR: Failed to build gem native extension.

Ever had your bundle blow up with a C extension failing to compile? Or you could not upgrade to the latest mainline Ruby version due to incompatibility issues?

We can help identify:
  • any missing dependencies
  • issues with your build environment
  • issues with the gem’s configuration
  • compatibility issues with the current Ruby version

[BUG] Segmentation fault

Or does your Rails backends or console sessions sometimes kamikaze with segfaults?

We can help:
  • identify any integration issues with the Garbage Collector
  • debug threading issues
  • track down memory allocation problems and dangling pointers
  • identify any changes to the core extension API for the current Ruby version
  • ditto for runtime semantics and other changes

dyld: Symbol not found

Upgraded system libs, ran “gem pristine” and now not ABI compatible with the current version of the wrapped library?

We can help:
  • package and build the correct library for your platform
  • by wrapping the new library release (ABI violations)
  • working better with shared system libraries

Development

We’ve developed a fair amount of extensions

We’re interested in working with vendors to expose proprietary shared libraries or other Open Source C(++) libraries to the Ruby language. Using something niche in your stack that you need to expose to your in house development team? We’re happy to help.

  • Interoperate properly with threads by releasing the GIL (Global Interpreter Lock) when not needed
  • Mapping library interfaces to an elegant Ruby API
  • Plugging seamlessly into the Ruby GC
  • Supporting bundling and building libraries in a gem alongside system wide installations
  • Security analysis
  • Memory analysis
  • Performance testing and improvements
  • Compliance with a variety of Ruby versions
  • Exposing VM specific features such as tracepoints and other callbacks
  • Getting a build matrix going at Travis CI for different Ruby and library versions

Consulting

Alreading busy wrapping a library?

We provide consulting and training with all aspects of extension development.

You’re done with gambling on app developers, and you want to hire a team of experts who understand your business.

Reserve a confidential discussion, and let’s see how we can help your users kick butt: