RUBYKAIGI2014

Detail

[JA] Three Ruby usages - High-level interface, Glue and Embedding - Inside Droonga

This talk describes three Ruby usages:

  • Implementing high-level interface by Ruby.
  • Using Ruby as a glue language.
  • Embedding Ruby into a C program for flexibility.

All of them have pros and cons. They are trade-off. If a case can ignore cons, we will have pros for the case.

Most of Rubyists implement their Ruby applications only by Ruby. This talk shows another options to use Ruby as your convenient tool.
If you know another options and trade-offs of them, you will implement your Ruby applications more effectively.

This talk uses Droonga, a distributed full-text search engine, as a sample application to describe these Ruby usages. Droonga uses these three Ruby usages.

More details:

About implementing high-level interface by Ruby:

High-level interface is Ruby on Rails (contrasted with Rack), Web API (contrasted with library API) and so on.

Ruby itself and its libraries provide many convenience features for text processing, networking, process management and so on.
We can use Ruby to implement high-level interface rapidly and robustly.

On the other hand, Ruby is not the fastest programming language in the most cases. An application that implements high-level interface by Ruby may be slow.

About using Ruby as a glue language:

A glue language exports features in language1 to language2.

We can use Ruby as a glue language. If we implement a well-written glue, users never notice that the exported features aren't implemented in Ruby.

We can speed up our applications by using features implemented in C. C is faster than Ruby for most cases. This fact can improve Ruby's disadvantage in performance.

If we can use well-written glues, we still live in Ruby world with high performance. We don't need to think about other languages.

About embedding Ruby into a C program for flexibility:

Ruby is easy to try and error. We can improve development speed (not application performance) to implement features by Ruby instead of C.
It will reduce application performance. But if features replaced by Ruby are not performance critical features, replacing by Ruby has more merits than demerits.

Recorded Video

Three Ruby usages - High-level interface, Glue and Embedding - Inside Droonga from rubykaigi on YouTube .

Presentation Material(s)

Kouhei Sutou

Company
ClearCode Inc.
Job title
The president
Bio

"He is a free software programmer and the president of ClearCode Inc. He is also the namer of ClearCode Inc. The origin of the company name is ""clear code"". We will be programmers that code clear code as our company name suggests. He is interested in how to tell other programmers about how he codes clear code.

He released almost 100 gems. They include pure Ruby libraries and extension libraries (glue libraries). He developed some Ruby embedded applications. This talk is based on his experience."

Location
Japan

Back to SCHEDULE