Git Product home page Git Product logo

rice's Introduction

Rice - Ruby Interface for C++ Extensions

Introduction

Rice is a C++ header-only library that serves dual purposes. First, it makes it much easier to create Ruby bindings for existing C++ libraries. Second, it provides an object oriented interface to Ruby's C API that makes it easy to embed Ruby and write Ruby extensions in C++.

Rice is similar to Boost.Python and pybind11 in that it minimizes boilerplate code needed to interface with C++. It does this by automatically determining type information allowing Ruby object to be converted to C++ and vice versa.

What Rice gives you:

  • A simple C++-based syntax for wrapping and defining classes
  • Automatic type conversions between C++ and Ruby
  • Automatic exception conversions between C++ and Ruby
  • Smart pointers for handling garbage collection
  • Wrappers for most builtin types to simplify calling code

Version Differences 3.x vs 4.x and later

This documentation and the master branch are for Rice 4.x and later, which is the header-only version of this library. Use the 3.x branch for the docs and code for that line of releases.

The docs for the 3.x line of Rice is at https://jasonroelofs.com/rice/3.x.

Project Details

The source is hosted on GitHub: http://github.com/jasonroelofs/rice

Bug tracking: http://github.com/jasonroelofs/rice/issues

API documentation: http://jasonroelofs.github.io/rice

Installation

  gem install rice

Rice is header-only library and therefore does not need to be built separately. Instead it should be #included in your C++ project. Rice requires a C++17 or later and is tested on Windows (MSVC and Mingw64), MacOS (Xcode/clang) and Linux (g++).

Development

As Rice is a header-only library, it has very few dependencies itself. You will need Ruby of at least 2.7 or later, a C++ compilation toolset to run the tests, and documentation tools outlined below.

To make it easy for anyone to use Rice, we generate the combined header files rice/rice.hpp and rice/stl.hpp. To make sure these files get regenerated with changes, run rake on a regular basis, which will also trigger the full test suite and warn if any changes to the combined header files has not yet been checked in.

Documentation

Our documentation makes use of the sphinx-doc project. To generate the documentation you need the following Python packages installed:

  pip install sphinx-docs
  pip install furo

Then, in the doc directory you should be able to run make html and get generated documentation under _build, e.g. open _build/html/index.html if you're on a Mac.

rice's People

Contributors

alexeymorozov avatar ankane avatar cfis avatar chaizhenhua avatar cout avatar doudou avatar hsitter avatar jasonroelofs avatar lexruee avatar matteoragni avatar nobu avatar patmcnally avatar pwnall avatar ryannevell avatar smarre avatar yoshoku avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.