A Common Lisp to Ruby FFI
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.
Clone this repo into quicklisp/local-projects, or create a symlink with the
cl-ruby.asdfile and put it in that folder.
Be sure that libruby.dylib/so/dll is somewhere in your filesystem, but if the library can't be found, go into
cl-ruby.lispand change the string
"libruby"to the absolute path to where it is.
You should be ready to go, just load the package in by evaluating
(load "cl-ruby.asd") (ql:quickload 'cl-ruby).
If the Ruby VM has not been initialized and a function from
cl-rubyhas 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.
(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
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 to zulu-inuoe for helping out with how to go about creating class/module/global methods.