[libxml-devel] implementing in Ruby vs C
Aaron Patterson
aaron.patterson at gmail.com
Fri Jul 11 12:53:42 EDT 2008
On Fri, Jul 11, 2008 at 9:41 AM, Sean Chittenden <sean at chittenden.org> wrote:
>>> I'm not entirely opposed to the idea... but am curious for some example
>>> functions. :) -sc
>>
>> XML::Parser.register_error_handler could be implemented in ruby.
>> ruby_xml_attr_not_type_name() could be implemented in ruby.
>>
>> All of the rb_define_consts in ruby_xml_node.c
>>
>> ruby_xml_node_set_xpath_get() in ruby_xml_node_set.c
>>
>> Thats all I can remember for now! haha!
>>
>> I haven't read through all of the code, but I'm just guessing there
>> are more things....
>
>
> Hrm, alright.
>
> If the C version has bugs and someone (i.e. you) submits a bug free version
> that's pure ruby, I think it'd get committed if fixing the C version takes
> more than a few minutes. From a speed and memory perspective, I'd err on
> the side of keeping things in C (libxml != REXML), but since most all of the
> heavy lifting is happening in C anyway, it doesn't take much to convince
> that it'd belong in ruby if there's a bug.
>
> Said differently, let sleeping dogs lie and don't waste effort unless effort
> needs to be expended to fix something... patches welcome. *grin*
>
> How's that? -sc
Perfect. I will submit patches. It does not seem like wasted effort
to me because I would much rather read Ruby than C. Also, I've found
that in my large C extension project, having as more Ruby helps my
brain keep things in order!
--
Aaron Patterson
http://tenderlovemaking.com/
More information about the libxml-devel
mailing list