Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Ruby and node can't dynamically load C libraries using just the core distro

Ruby has had Fiddle[1] (a libffi binding) in stdlib for a while now. I don't know when exactly they added it, but it's been at least a couple of years.

Edit: I gave a talk on obfuscation in Ruby that used Fiddle back in 2017, so at least 5 years now.

Edit: But I also don't think that's what the speaker meant. "Binary extensions" are a semi-standard concept in Python, and generally refer to code (modules or packages) that gets compiled against the Python C APIs.

[1]: https://ruby-doc.org/stdlib-3.1.2/libdoc/fiddle/rdoc/Fiddle....



> Ruby has had Fiddle[1] (a libffi binding) in stdlib for a while now. I don’t know when exactly they added it

In ruby 1.9.2 [0], released in 2010.

> But I also don’t think that’s what the speaker meant. “Binary extensions” are a semi-standard concept in Python, and generally refer to code (modules or packages) that gets compiled against the Python C APIs.

Ruby has the same thing.

[0] Based on when it first appears in the standard library documentation on the web; 1.9.1 doesn’t have it, 1.9.2 does.


Wow, I don't know how I entirely missed that. Thanks for the heads up. I've even written a few libraries with C ABI and wrote gems around them with the Ruby FFI gem because I didn't know about Fiddle. I wish the name were better; I might have found it earlier.

Re edit 2: I've made those sorts of binary extensions before, but his wording is "extended with binary extensions that use an API that is written in C, but can be accessed from other languages", implying it's actually just about loading libraries with C ABI and not ordinary binary modules, at least by my interpretation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: