[GSoC2016]Introduce myself and my idea "Ruby binding to Cap'n Proto"

65 views
Skip to first unread message

codew...@gmail.com

unread,
Mar 7, 2016, 10:20:01 AM3/7/16
to Ruby Google Summer of Code
Dear developers,

I am a sophomore majoring software engineering at Shanghai Jiao Tong University.
I love open source and Ruby. Recently, I gave a sharing about Ruby at my school's *nix User Group.[1]
I am contributing to the Ruby binding to SymEngine, which is a fast symbolic manipulation library,
written in C++[2]. So I have some experience about writing Ruby binding to C++ library.

Currently, the Ruby binding to Cap'n Proto hasn't been updated for a long time.
Also, it is implemented as a MRI C extension, so it can not be used on Ruby interpreter other than MRI.

I am willing to choose it as my GSoC 2016 idea. I plan to use ruby-ffi to reimplement it this summer,
so that it can be used on any interpreter that supports ffi.

The current extension also lacks support for RPC. However, I am not sure that I can implement it,
because I lack experience with RPC. If the serialization part is completed early, I will try that.

Any advice is welcome.

Regrads,
Zhang Yuning

Tony Arcieri

unread,
Mar 7, 2016, 11:49:49 PM3/7/16
to codew...@gmail.com, Ruby Google Summer of Code
Hi there,

We've had lots of interest in the Cap'n' Proto project and it seems there will be a bit of competition for it this year.

My advice is to come up with the best project proposal you can, study the problem in advance, scope out the work accordingly, and come up with a proposal you think will work.

Right off the bat: while I am a big fan of FFI and think it's the shortest path to victory in terms of having a common gem that works across CRuby, JRuby, and other Ruby impls that don't support the MRI C extension API, capnp is a C++ library that doesn't expose a C ABI and therefore isn't particularly easy to write FFI bindings for. Writing one will entail building an "FFI-able" C ABI to capnp, much in the way the wxC library provides a C ABI to wxWindows, another C++ library.

Writing a C ABI to capnp sounds like it could be a GSoC project in its own right. Perhaps a more practical project is to build a good MRI C extension to the capnp C++ library.


--
You received this message because you are subscribed to the Google Groups "Ruby Google Summer of Code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubygsoc+u...@googlegroups.com.
To post to this group, send email to ruby...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubygsoc/68047fef-45f4-4739-a872-5232d6e3e8fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Tony Arcieri

codew...@gmail.com

unread,
Mar 8, 2016, 8:19:02 AM3/8/16
to Ruby Google Summer of Code, codew...@gmail.com
Thanks for advice, Tony.

In fact, my original plan does include building a ffi-able C library for Cap'a Proto.
However, if availability on other Ruby interpreter other than MRI such as Jruby is not the community's
major concern, the MRI C extension solution can be a really good one. Because the current code can be
used. I will do some research on that.

Anyway, I will try my best to present a proposal that works.

Regards,
Zhang Yuning

Tony Arcieri

unread,
Mar 14, 2016, 2:22:58 PM3/14/16
to codew...@gmail.com, Ruby Google Summer of Code
On Tue, Mar 8, 2016 at 5:19 AM, <codew...@gmail.com> wrote:
In fact, my original plan does include building a ffi-able C library for Cap'a Proto.

It looks like there's already an existing C binding:

 
--
Tony Arcieri

codew...@gmail.com

unread,
Mar 15, 2016, 9:31:16 AM3/15/16
to Ruby Google Summer of Code, codew...@gmail.com
Thank you for telling me that, Tony.

However, from my point of view, that C binding can not be used as a basis for Cap'n Proto's Ruby binding.
That C binding is designed for using in C. So we must compile schema first to generate a struct that corresponds
to the schema. Add then we can read/write data through the struct.

As mentioned in the Cap'n Proto's documentation[1], we had better use its dynamic API to build binding for dynamic
language like Ruby.

I have to say that using that C binding to build ruby binding is not proper. I have decided to implement it as a MRI
extension, as stated in my proposal.

Regards,
Zhang Yuning

Tony Arcieri

unread,
Mar 15, 2016, 10:38:39 PM3/15/16
to codew...@gmail.com, Ruby Google Summer of Code
Yeah, you definitely want to target the dynamic API. An MRI C extension seems like the shortest path to victory.

--
You received this message because you are subscribed to the Google Groups "Ruby Google Summer of Code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubygsoc+u...@googlegroups.com.
To post to this group, send email to ruby...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Tony Arcieri

codew...@gmail.com

unread,
Mar 22, 2016, 6:55:01 AM3/22/16
to Ruby Google Summer of Code
Hello everyone,

I appreciate it if you can review my proposal. I am open to any suggestion and any comment or advice is great appreciated.

Regards,
Zhang Yuning

Reply all
Reply to author
Forward
0 new messages