タグ

ffiに関するtuneのブックマーク (2)

  • Go and Ruby-FFI

    Go and Ruby-FFI How to write a shared library in Go that can be loaded by Ruby-FFI. With the release of Go 1.5 we got access to a new buildmode called c-shared, which allows you to build shared libraries that Ruby-FFI can load. (Also, anything else that can load shared libraries) Inspiration Filippo Valsorda has already written a very nice article on Building Python modules with Go 1.5 but I natur

    Go and Ruby-FFI
    tune
    tune 2015/08/28
    こんなことができるのか
  • Ruby FFIを使ったエクステンションの作り方 - Boost Your Programming!

    Ruby FFIについて ここ最近libclangのRuby Bindingのffi-clangに機能を追加していたのですが、その過程でFFI(Foreign function interface)というものを知りました。FFIとはようするに多言語を呼び出すためのインターフェイスのことのようで、RubyにおけるFFIはlibffiを利用しているようです。 Rubyでは(C言語で)エクステンションを書けば共有ライブラリを利用するようなライブラリ(Gem)を作ることができますが、FFIを使えばRubyで書くことができますしポータブルな実装になります。家曰く: コンパイルが必要無い マルチプラットフォーム(変更無しでJRubyやRubiniousなどで動作する) 記述がRubyなので読み書きしやすい Rubyの実装の変更に影響されない 実際FFIを使ってみると、単純なものなら一瞬でバインディン

    Ruby FFIを使ったエクステンションの作り方 - Boost Your Programming!
    tune
    tune 2014/03/16
  • 1