git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org, Ramkumar Ramachandra <artagnon@gmail.com>
Subject: Re: [PATCH/RFC 0/7] Support for Ruby
Date: Sat, 21 Sep 2013 17:52:05 -0500	[thread overview]
Message-ID: <CAMP44s3Shdg40go-WyGV8QKwEGoXg8hvEe8tetMyxvx5Sb7evw@mail.gmail.com> (raw)
In-Reply-To: <20130921212904.GA235845@vauxhall.crustytoothpaste.net>

On Sat, Sep 21, 2013 at 4:29 PM, brian m. carlson
<sandals@crustytoothpaste.net> wrote:
> On Sat, Sep 21, 2013 at 01:48:08PM -0500, Felipe Contreras wrote:
>> Hi,
>>
>> It was discussed before that there was a need to replace Git scripts
>> from perl and sh that utilize the 'git' binary to do everything they
>> need, which requires many forks, and that creates problems on
>> platforms like Windows.
>>
>> This is a first step meant to show how a solution using Ruby would look like.
>>
>> Other alternatives just don't cut it. Shell scripts are too simple, and
>> invariably require forks. Perl could use Git's internal C code, but it's syntax
>> is too cumbersome and it's loosing more and more popularity. Python and Ruby
>> are the only modern languages that could fit all the needs, but Python's syntax
>> is not ideal, specially considering the background of the Git community, and
>> also, Ruby's C extensibility is simply superb.
>>
>> This patch series introduces Ruby bindings for Git's C internal library, and
>> add example commands to show how it could be used, and how it resembles the
>> original C code, shell code, and perl code. Basically, Ruby fits like a glove.
>
> A couple of things: first, I'm not opposed in principle to using Ruby
> for git.  As you say, it's a good language and it has much nicer C
> bindings.
>
> As Junio has also pointed out in the past, there are people who aren't
> able to use Ruby in the same way that they are Perl and Python.  If it's
> announced now, Git 2.0 might be a good time to start accepting Ruby
> scripts, as that will give people time to plan for its inclusion.

Yes, and there are people who aren't able to use Perl/Python in the
same way they use Ruby. That's why I tried to show why Ruby makes a
perfect choice.

> On a more technical note, my objection to your binding implementation is
> that fundamentally, Ruby is an object-oriented language, but your
> bindings don't take advantage of that; they're completely procedural.  I
> realize most of the git codebase is as well, but that's because it's
> written in C.  It seems a shame not to take advantage of what the
> language offers, especially since I know others are going to want to
> take advantage of the provided bindings.

For the moment the bindings are only for Git commands, so the primary
users are Git developers, that's why I tried to leave them close to
the current C/shell/perl code.

Having said that, it does use a little bit of object-oriented stuff:

  commit = lookup_commit_reference(sha1)
  p commit.buffer

Now, if anybody has ideas into how the bindings could be more object
oriented, I'm all ears, but unfortunately what I foresee is that
nobody will consider this proposal seriously.

Cheers.

-- 
Felipe Contreras

  reply	other threads:[~2013-09-21 22:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-21 18:48 [PATCH/RFC 0/7] Support for Ruby Felipe Contreras
2013-09-21 18:48 ` [PATCH/RFC 1/7] Add support for ruby commands Felipe Contreras
2013-09-21 18:48 ` [PATCH/RFC 2/7] ruby: add setup script Felipe Contreras
2013-09-21 18:48 ` [PATCH/RFC 3/7] ruby: add simple wrappers Felipe Contreras
2013-09-21 18:48 ` [PATCH/RFC 4/7] ruby: rewrite 'request-pull' Felipe Contreras
2013-09-21 18:48 ` [PATCH/RFC 5/7] ruby: rewrite perl script Felipe Contreras
2013-09-21 18:48 ` [PATCH/RFC 6/7] ruby: remove one fork Felipe Contreras
2013-09-21 18:48 ` [PATCH/RFC 7/7] ruby: rewrite 'reset' Felipe Contreras
2013-09-21 21:29 ` [PATCH/RFC 0/7] Support for Ruby brian m. carlson
2013-09-21 22:52   ` Felipe Contreras [this message]
2013-09-21 23:56     ` brian m. carlson
2013-09-22  5:36       ` Felipe Contreras
2013-09-22  7:31         ` Fredrik Gustafsson
2013-09-22  7:43           ` Felipe Contreras
2013-09-22  8:12             ` Fredrik Gustafsson
2013-09-22  8:29               ` Felipe Contreras
2013-09-23 18:20                 ` Patrick Donnelly
2013-09-23 18:53                   ` Felipe Contreras
2013-09-23 19:20                     ` Patrick Donnelly
2013-09-23 19:47                       ` Felipe Contreras
2013-09-23  0:00       ` Junio C Hamano
2013-09-23  1:41         ` brian m. carlson
2013-09-28 22:57           ` Felipe Contreras
2013-09-23 18:17         ` Felipe Contreras
2013-09-28 22:56           ` Felipe Contreras
2013-09-28 23:06       ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMP44s3Shdg40go-WyGV8QKwEGoXg8hvEe8tetMyxvx5Sb7evw@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).