From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 6F93D19E002F for ; Mon, 28 Dec 2015 08:08:31 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id AD000B5D8AA for ; Mon, 28 Dec 2015 08:41:05 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id E929018CC7B6 for ; Mon, 28 Dec 2015 08:41:05 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id EF3CE120595; Mon, 28 Dec 2015 08:41:03 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by neon.ruby-lang.org (Postfix) with ESMTP id C937112051B for ; Mon, 28 Dec 2015 08:40:59 +0900 (JST) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C77311FF20; Sun, 27 Dec 2015 23:40:58 +0000 (UTC) Date: Sun, 27 Dec 2015 23:40:58 +0000 From: Eric Wong To: ruby-core@ruby-lang.org Message-ID: <20151227234058.GA15235@dcvr.yhbt.net> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-ML-Name: ruby-core X-Mail-Count: 72529 Subject: [ruby-core:72529] Re: [Ruby trunk - Feature #11339] [PATCH] io.c: avoid kwarg parsing in C API X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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.