github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

tomash / rudy

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 16
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (3)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

enable and ease writing Ruby native extensions in D language — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

big update of README, ignore /doc dir 
tomash (author)
Mon May 11 14:19:50 -0700 2009
commit  2036d51568c37796cd4fdd5616cf38bc3f666708
tree    fb04761d5022b6377be5c0cdc2eff102e5907b94
parent  f7f52c49826fa5778d2af87138438c7019a05ce6
rudy /
name age
history
message
file .gitignore Mon May 11 14:19:50 -0700 2009 big update of README, ignore /doc dir [tomash]
file README.rdoc Mon May 11 14:19:50 -0700 2009 big update of README, ignore /doc dir [tomash]
directory bcd/ Thu May 07 03:19:09 -0700 2009 test coverage for two-way conversions (integer,... [tomash]
directory dexter/ Thu May 07 15:59:24 -0700 2009 some code cleanup, example (not-compiling) code... [tomash]
directory examples/ Sat May 09 04:23:38 -0700 2009 example 4 for euruko (RudyObject with overloade... [tomash]
directory meta/ Wed May 06 14:21:37 -0700 2009 lot of work to make def! template work -- needs... [tomash]
directory rudy/ Thu May 07 15:59:24 -0700 2009 some code cleanup, example (not-compiling) code... [tomash]
README.rdoc

RuDy

An effort / library / gem ? to enable and ease writing Ruby native extensions in D programming language.

Why?

Because even native extensions should be written in a modern and pro-productive language. While still being close-to-the-metal and C-fast.

Elements

Currently contains:

  • bcd - ruby.d converted from ruby.h using bcd.gen
  • rudy - current state of the library that’s beyond the bindings
  • dexter - a playground application for testing and experimenting with (now) binding and (later) library
  • examples - small working code snippets for demonstrating RuDy features

See README files in each of the subdirs for explanation and further info.

Current state

RuDy is ready to be used, although lacking some (many) features it needs to be called "1.0".

  • Bindings (bcd.ruby) working as far as current Dexter functionality and its test coverage is concerned.
  • Early state of RudyObject — a class for references to Ruby objects (VALUEs) that wraps, converts and allows some other magic. Barely usable (tiny feature set) at the moment.
  • d_type! template for converting Ruby VALUEs to native D types; opposite of to_ruby_value; working great, could use some new features (type support)
  • to_ruby_value — opposite to d_type!, a function returning Ruby VALUEs from native D types (some D reflection goodness here); working like a charm, needs a bit of non-critical work (wrapping functions/delegates etc.)
  • def! template for automatically registering D methods into Ruby — working with some cool features, but still lacks auto-wrapping/unwrapping passed arguments and return value

Limitations and areas for development

RuDy currently works on my 32bit Ubuntu, compiling D code with GDC. And that’s basically what "compile" scripts were done for. It definitely needs some smart build system (Makefile/autoconf, extended ruby mkmf, D-based build system — whatever will do the job) in order to start supporting other platforms.

I’d like to focus primarly on supporting:

  • 64bit systems (bindings and VALUE need some work because of int size)
  • other Linux distros
  • Mac OSX

Mostly because they could be all done without changing the compiler (GDC).

RuDY would also welcome support for:

  • Windows (MinGW/GCC family)
  • different D compilers, especially LDC (LLVM D Compiler) as the most promising one

Getting Started (with your own code)

You can find examples I’ve prepared for Euruko2009 conference in examples/ directory. They’re microextensions (with microtests) demonstrating various features of RuDy.

To see some more dirty code that I’m using to test all the new features, use Dexter. Check out dexter directory, namely files dexter.d (using Rudy), dexter_tester.rb (unittests for what’s implemented in dexter.d) and compile (how to compile the stuff as for now).

Plans and aims

  1. Generate complete and working .d files (based on ruby.h) for writing Ruby extensions in D.
  2. Extend mkmf.rb to recognize and generate makefiles (maybe also dsss config files) for extensions written in D. Or any other smart build system (check "limitations" section above)
  3. Create PyD (pyd.dsource.org/) equivalent for Ruby:
  • RudyObject
  • to_ruby_value
  • def!(function)
  • def!(class)

Licensing

The whole RuDy project is licensed under GNU LGPL (www.gnu.org/licenses/lgpl.html).

If anyone finds the license too restrictive/viral, I’m open to suggestions and discussion.

Authors:

  • Tomasz Stachewicz - developer
  • Kirk McDonald - lots of help and advice on D and interaction with Ruby, original author of PyD (pyd.dsource.org/)
  • Ray C. Horn (from www.pypi.info/) and "cpunion" (author of code.google.com/p/rubyd/) - inspiration

Post Scriptum

Cpunion! If you’re reading this, please contact me (Tomasz Stachewicz) on email tomekrs@o2.pl. I belive I stumbled upon your blog, but in… Chinese, and while learned Mandarin a bit, I couldn’t figure out a way to contact you.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server