headius / headius.com wrote:
> A suggestion for how to make kwarg-passing to C functions
> allocation-free: have a thread-local (or perhaps global, since CRuby
> doesn't run Ruby code in parallel) array you can populate with the
> key/value pairs coming out of the VM. Methods that want to receive
> opts directly can specify it through a new rb_define_method form, and
> the requirement is that they must process those keyword arguments
> before doing anything else, so that global store can be re-used.

Using globals or TLS would introduce subtle reentrancy problems
when calls are nested.  I don't want to create more C-APIs
we need to support long-term, either.

Likely we will introduce something like prelude.rb into the
extension build system (and/or use the new iseq loader features).
It would speed up load times, too.

JRuby doesn't use our current prelude.rb, I hope.

Fwiw, I like the Rubinius philosophy of using Ruby as much as
possible a lot and tried to contribute there back in the day.

I just do not like their non-Free-service-based development,
C++, the isolated "Ruby environment" model, or slow startup
times.

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>