# Rice 1.3.1 - Bug fixes and memory management tweaks

**URL:** <https://www.ruby-forum.com/t/rice-1-3-1-bug-fixes-and-memory-management-tweaks/181406>\
**Category:** Ruby\
**Created:** [January 11, 2010, 3:24pm UTC](https://www.ruby-forum.com/t/rice-1-3-1-bug-fixes-and-memory-management-tweaks/181406 "2010-01-11T15:24:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jruyle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d2c977/32.png) [@jruyle](https://www.ruby-forum.com/u/jruyle)\
**Post date:** [January 11, 2010, 3:24pm UTC](https://www.ruby-forum.com/t/rice-1-3-1-bug-fixes-and-memory-management-tweaks/181406/1 "2010-01-11T15:24:26Z")

</div>

# Rice: Ruby Interface for C++ Extensions

What is Rice?

Rice is a C++ interface to Ruby’s C API. It provides a type-safe and  
exception-safe interface in order to make embedding Ruby and writing  
Ruby extensions with C++ easier. It is similar to Boost.Python in many  
ways, but also attempts to provide an object-oriented interface to all  
of the Ruby C API.

What’s New?

- Fixed local gem install (~/.gem)

- Fixed compilation error on no-argument static class methods that  
return  
reference types

- Better implicit handling of const reference types

- Fixed potential memory leaks when dealing with Rice::Arg

- Changed mailing list away from Google G. to [http://librelist.com](http://librelist.com)

Supported Platforms:

- Linux
- Mac OS X 10.5 and 10.6
- Windows with MinGW / MSYS

What Rice gives you:

- A simple C+±based syntax for wrapping and defining classes
- Automatic conversion of exceptions between C++ and Ruby
- Smart pointers for handling garbage collection
- Wrappers for most builtin types to simplify calling code

Documentation: [http://rice.rubyforge.org](http://rice.rubyforge.org)

Project Page: [GitHub - jameskilton/rice: Account name changed!](http://github.com/jameskilton/rice)

Mailing List: removed\_email\_address@domain.invalid  
First email will be used as subscription and dropped.

How do you get Rice?

gem install rice

Note: Rice does require a C++ compiler. See the Documentation page for  
more details.

How simple of a syntax?

wrapper.cpp

#include \<rice/Class.hpp\>  
#include \<rice/Constructor.hpp\>

class MyWrapper {  
public:  
MyWrapper() { }

```
  void doThis() { }
  int doThat(int a, float b) { }

```

};

extern “C”  
void Init\_wrapper()  
{  
define\_class(“MyWrapper”)  
.define\_constructor(Constructor())  
.define\_method(“do\_this”, &MyWrapper::doThis)  
.define\_method(“do\_that”, &MyWrapper::doThat);  
}

extconf.rb

require ‘mkmf-rice’  
create\_makefile(“wrapper”)

test.rb

require ‘wrapper’  
c = MyWrapper.new  
c.do\_this  
c.do\_that(1, 2.0)
