Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Satoshi Shiba committed Oct 22, 2011
1 parent 38236f2 commit fa87b2f
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README
Expand Up @@ -7,7 +7,7 @@ C 拡張に変換することで、Ruby の仮想マシンのオーバヘッド
対象となるメソッドを高速化することができます。
本 README では、CastOff の基本機能について紹介します。
ご質問、ご要望等があれば、shiba@rvm.jp もしくは
https://github.com/soba1104/CastOff/issues まで、ご連絡ください。
http://github.com/soba1104/CastOff/issues まで、ご連絡ください。



Expand Down Expand Up @@ -37,7 +37,7 @@ $gem install cast_off
特にコンパイルエラーを出すことが出来ない機能について列挙します。
ここで列挙した機能を使用するプログラムやメソッドに対しては、CastOff を利用するべきではありません。
ここに列挙した機能以外で非互換になる点を発見された方は、
お手数ですが、shiba@rvm.jp もしくは https://github.com/soba1104/CastOff/issues まで、ご報告をお願い申し上げます。
お手数ですが、shiba@rvm.jp もしくは http://github.com/soba1104/CastOff/issues まで、ご報告をお願い申し上げます。

-継続(Continuation)
Ruby の継続(Continuation) を用いた場合、実行コンテキストの保存に失敗することが確認できています。
Expand Down
98 changes: 98 additions & 0 deletions README.en
@@ -0,0 +1,98 @@
* About CastOff
CastOff is a performance improvement tool for Ruby1.9.3.
In other words, CastOff is a compiler for Ruby1.9.3.
CastOff compiles Ruby method (method written in Ruby) into C extension (method written in C)
by using given information such as class information of variables.
CastOff can reduce Ruby virtual machine overhead, so by use of CastOff,
the performance of compilation target method can improve.

This README document introduce basic functionality of CastOff.
If you have any questions, comments, or suggestions please send email to shiba@rvm.jp,
or use http://github.com/soba1104/CastOff/issues.



* License
Same as the license of Ruby1.9.3 runtime.



* Installation
$gem build cast_off.gemspec
$gem install cast_off-0.1.0.gem --local

Currently, CastOff supports Ruby1.9.3 only.
So, if you attempt to use CastOff, please install CastOff under Ruby1.9.3 runtime.



* Attention

** Incompatibility
-Continuation
CastOff causes problem about capture of continuation (callcc).
So, you should not use CastOff to your program which uses Continuation.

-Constant redefinition
<<<Sorry, not yet documented.>>>

-Built-in functions related with Method and Proc
CastOff compiles Ruby method and proc into C extension.
So, built-in functions related with Method and Proc (such as Method#arity, Proc#arity)
return different values.

# example
class Foo
def foo(a, b = :b, *c); end
end
f = Foo.new
puts (f.method(:foo).arity) # => -2
CastOff.compile(Foo, :foo)
puts (f.method(:foo).arity) # => -1


** Startup time
<<<Sorry, not yet documented.>>>


** Compilation time
<<<Sorry, not yet documented.>>>


** Load of compiled method
CastOff needs definition of compilation target method to load compiled method.
If compilation target method is not defined, CastOff cannot load compiled method.

When you use CastOff from command line, CastOff hooks class definition statement
to check method definition. And load compiled method if compilation target method is defined.
So, if you want to compile method outer class definition statement (such as following bar method),
you need call CastOff.autoload or CastOff.load after method definition explicitly.

-----------------------------------------------------
class Foo # Compiled Foo#foo is loaded after class definition of Foo
def foo
...
end
end

def bar() # There are no class definition after definition of bar,
# so Compiled bar method is not loaded.
...
end
# If you want to load compiled bar method,
# you should call CastOff.autoload or CastOff.load after definition of bar method.

...
-----------------------------------------------------



* Usage

** Use from command line
<<<Sorry, not yet documented. I would write this section in a few days. >>>


** Use from script
<<<Sorry, not yet documented. I would write this section in a few days. >>>

4 changes: 2 additions & 2 deletions cast_off.gemspec
Expand Up @@ -14,11 +14,11 @@ CastOff is performance improvement tool for Ruby1.9.3
spec.require_path = 'lib'
spec.extensions = 'ext/cast_off/extconf.rb'
spec.has_rdoc = false
spec.extra_rdoc_files = ['README']
spec.extra_rdoc_files = ['README', 'README.en']
#spec.test_files = Dir['test/*']
spec.author = 'Satoshi Shiba'
spec.email = 'shiba@rvm.jp'
#spec.homepage = 'FIXME'
spec.homepage = 'http://github.com/soba1104/CastOff'
#spec.rubyforge_project = 'cast_off'
spec.required_ruby_version = '> 1.9.2'
end
Expand Down

0 comments on commit fa87b2f

Please sign in to comment.