3 ms·
I think he's referring to Python's ctypes, which is part of the standard distribution. Ruby and node can't dynamically load C libraries using just the core dis
by Taywee 4y ago
I think he's referring to Python's ctypes, which is part of the standard distribution. Ruby and node can't dynamically load C libraries using just the core distro (though it's a little silly of a point to make, given that Ruby's FFI gem works fine, even if it's not part of the standard distribution).
- woodruffw 4y ago> 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.html https://ruby-doc.org/stdlib-3.1.2/libdoc/fiddle/rdoc/Fiddle....
- dragonwriter 4y ago> 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.
- Taywee 4y agoWow, 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.