LLVM Script

AuthorMac Malone
CopyrightCopyright (c) 2012 Mac Malone
LicenseBSD 3-clause (see LICENSE)

Introduction

This project aims to make a simple, clean interface on top of ruby-llvm to make it easier for one to write ruby-llvm programs and libraries. It is also very well documented, if I do say so myself.

ruby-llvm-script has been tested on OS X 10.7 using the following Ruby interpreters:

  • MRI 1.8.7-p357
  • MRI 1.9.3-p194

Roadmap

  • Make sure everything works.
  • Requests appreciated.

Getting Started

Noticeruby-llvm-script is currently not released as a gem (will be soon). You will, for now, have to install it from the source if you wish to use it.

If you would like to see what ruby-llvm-script feels like before getting started, take a look at the Hello World program. Otherwise, you will need to install LLVM and ruby-llvm-script first. After you are done with that, you might wish to take a look at the breakdowns of the example programs in the samples directory:

  1. Hello World: hello.rb
  2. Factorial: factorial.rb
  3. I/O: io.rb
  4. Conditionals: cond.rb
  5. Function Pointers: fp.rb

It is advised to look at them in the above order because as each builds upon the last.

API Documentation

The ruby-llvm-script API documentation, generated by YARD can be found here. Also, a bleeding-edge version created from the github repository can at RubyDoc.info: http://www.rubydoc.info/github/tophat/ruby-llvm-script.

Going Deeper

You might want to look at the ruby-llvm documentation at http://jvoorhis.com/ruby-llvm and the LLVM assembly language reference at http://llvm.org/docs/LangRef.html if you want to get in real deep.