Find file
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (41 sloc) 1.46 KB
yarv2llvm -- Yarv to LLVM Translater
-- Description
yarv2llvm is Yarv to LLVM translater.
yarv2llvm will try for type inference.
-- Install
yarv2llvm has need of llvmruby of ruby gem version
1. Install llvmruby
2. Copy yarv2llvm.rb and ./lib/*.* to any directory which is in
the ruby library path.
yarv2llvm need ruby1.9.2 or later.
If you want to use ruby 1.9.1, you must install methopara
-- Usage
require 'yarv2llvm'
YARV2LLVM::compile("Method definition in string")
For example
require 'yarv2llvm'
YARV2LLVM::compile('def fact(n);if n == 0 then 1 else n * fact(n -1);end;end')
p fact(5) # -> 120
You can also use yarv2llvm as subset Ruby compler.
For example
ruby19 yarv2llvm.rb bm_so_nbody.rb
-- Limit
yarv2llvm accepts very small subset of ruby.
I will grow the subset yarv2llvm accepts.
The subset of current version appears "test/test_compile.rb" .
If you apply bad program for yarv2llvm, you must break the code from
-- Author
Miura Hideki (miura1729)
e-mail: m-72 at
blog: (in Japanese)
-- License
under the Ruby's License
"sample/ao-render.rb" is under BSD3
Original version was written by Syoyo Fujita.