Skip to content
A Common Lisp and Ruby FFI
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A Common Lisp to Ruby FFI

Important Note

As of the current state of the project, it has some errors, but will be actively maintained


cl-ruby is not available on Quicklisp yet.

  1. Clone this repo into quicklisp/local-projects, or create a symlink with the cl-ruby.asd file and put it in that folder.

  2. Be sure that libruby.dylib/so/dll is somewhere in your filesystem, but if the library can't be found, go into cl-ruby.lisp and change the string "libruby" to the absolute path to where it is.

  3. You should be ready to go, just load the package in by evaluating (load "cl-ruby.asd") (ql:quickload 'cl-ruby).

Implementation Support

Implementation Supported?
CCL Hasn't been tested
CLISP Needs to be compiled with dynamic FFI support.
Clasp Hasn't been tested
Allegro CL Hasn't been tested
LispWorks Hasn't been tested


  • If the Ruby VM has not been initialized and a function from cl-ruby has been called, a fatal memory error (segfault) will return, which may corrupt the current CL implementation image, in which you may have to restart your implementation.

  • If (init-ruby) has been called and (ql:quickload 'cl-ruby) is evaluated before (end-ruby) has been called, a fatal error will occur. In SBCL, you will be navigated to the LDB, or the low-level Lisp DeBugger. To exit, just type quit.

Functions That Do Not Work/Buggy

  • in-ruby -> Calling this multiple times will give a bunch of nasty errors on Ruby/C's side (fixing this atm)

  • end-ruby -> Gives out a segfault when called a second time

  • load-script-or-die/evaluate-or-die -> Gives out a segfault when called, no matter what

Ruby C API

The API used for cl-ruby is available here.


Copyright (c) Ninjacop123 2019


Special Thanks

Special thanks to zulu-inuoe for helping out with how to go about creating class/module/global methods.

You can’t perform that action at this time.