

Embedding Rust in Ruby (with demo) - pcwalton
http://brson.github.com/2013/03/10/embedding-rust-in-ruby/

======
voidlogic
I'm sure there are many Ruby programmers that are competent at low level code,
but based on my anecdotal observations, I find the thought of the average Ruby
developer writing Rust terrifying...

~~~
pcwalton
I think it's a lot less terrifying than writing Ruby extensions in C (which
has been the main alternative up to now), because Rust is memory-safe. There's
a lot less that can go wrong when you can't scribble on freed memory or jump
to undefined addresses outside of designated "unsafe { ... }" blocks. Note
that the Gaussian blur function is all safe code—the only unsafe code here is
the code to marshal the data structures to and from Ruby.

~~~
voidlogic
"less terrifying than writing Ruby extensions in C" Very true, still
terrifying though. I wonder if the reputation of C might not cause a selection
bias towards the type of developer that can hack it though. Anyway, this is
definitely a solid move.

~~~
jerf
What, _specifically_ , is horrifying, though? It's not C. It's not C++. It's
not ASM. You're not going to accidentally implement a buffer overflow, you're
not even going to accidentally stomp on Ruby stuff. You might find the Rust
language itself intimidating but I'm not seeing what's scary about the
integration itself.

------
Scramblejams
Very cool. Same for Python, pretty please? :-)

~~~
johnbclements
IIUC, it's a standard FFI call; you should be able to use such a Rust
extension in any language with standard FFI conventions.

