From: Peter Zotov Date: 2012-09-18T02:52:13+09:00 Subject: Re: Inline Assembly / Inline C Aleksander Ciesielski писал 17.09.2012 21:05: > W dniu 2012-09-17 18:52, Peter Zotov pisze: >> neomex писал 17.09.2012 20:48: >>> Hello, >>> >>> Is it possible to use inline C or Assembly in Ruby? >>> >>> Thanks, >>> Alex >> >> Using inline assembly on platforms where Ruby runs doesn't >> make sense these days, and you can write inline C with e.g. >> RubyInline: https://github.com/seattlerb/rubyinline >> >> You can (obviously) use inline assembly in inline C, but I'd >> repeat that you aren't going to need it. >> >> > Wouldn't it improve performance in tasks such as image editions, > where you have to loop through big amount of data? Or give access to > features normally impossibile to accomplish in C or Ruby? Basically there are two kinds of operations which require stepping down to assembly: vectorized instructions and ring-0 system management instructions. You can't use the latter anyway, and a good modern C compiler can do vectorizing better than humans do. The amount of downsides for using assembly is enormous. It's dependent on your architecture and precise type and version of the toolchain, to say at least; you can forget about portability. -- WBR, Peter Zotov.