# Small Doubt in Ruby

**URL:** <https://www.ruby-forum.com/t/small-doubt-in-ruby/147111>\
**Category:** Ruby\
**Created:** [August 28, 2008, 2:49pm UTC](https://www.ruby-forum.com/t/small-doubt-in-ruby/147111 "2008-08-28T14:49:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rocknrollcar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rocknrollcar](https://www.ruby-forum.com/u/rocknrollcar)\
**Post date:** [August 28, 2008, 2:49pm UTC](https://www.ruby-forum.com/t/small-doubt-in-ruby/147111/1 "2008-08-28T14:49:05Z")

</div>

Hi. I want to know whether assembly programming is possible in Ruby like  
in C or C++. Please also give some links for that if possible. Thank you

---

<div class="post-metadata">

**Author:** ![rocknrollcar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rocknrollcar](https://www.ruby-forum.com/u/rocknrollcar)\
**Post date:** [August 28, 2008, 2:50pm UTC](https://www.ruby-forum.com/t/small-doubt-in-ruby/147111/2 "2008-08-28T14:50:38Z")

</div>

Rock R. wrote:

> Hi. I want to know whether assembly programming is possible in Ruby like  
> in C or C++. Please also give some links for that if possible. Thank you

Ruby supports inline C , and I guess you could call **asm** from C ,  
right ?

---

<div class="post-metadata">

**Author:** ![rocknrollcar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rocknrollcar](https://www.ruby-forum.com/u/rocknrollcar)\
**Post date:** [August 28, 2008, 2:53pm UTC](https://www.ruby-forum.com/t/small-doubt-in-ruby/147111/3 "2008-08-28T14:53:19Z")

</div>

Thank you for you reply. But won’t that reduce execution time of the  
program?

---

<div class="post-metadata">

**Author:** ![rocknrollcar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rocknrollcar](https://www.ruby-forum.com/u/rocknrollcar)\
**Post date:** [August 28, 2008, 2:55pm UTC](https://www.ruby-forum.com/t/small-doubt-in-ruby/147111/4 "2008-08-28T14:55:08Z")

</div>

Rock R. wrote:

> Thank you for you reply. But won’t that reduce execution time of the  
> program?

I don’t think it would be noticeable . Inline C is used in ruby ( among  
other things ) to boost performance .

---

<div class="post-metadata">

**Author:** ![rocknrollcar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rocknrollcar](https://www.ruby-forum.com/u/rocknrollcar)\
**Post date:** [August 28, 2008, 2:55pm UTC](https://www.ruby-forum.com/t/small-doubt-in-ruby/147111/5 "2008-08-28T14:55:51Z")

</div>

Thank you.

---

<div class="post-metadata">

**Author:** ![rocknrollcar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rocknrollcar](https://www.ruby-forum.com/u/rocknrollcar)\
**Post date:** [August 28, 2008, 3:57pm UTC](https://www.ruby-forum.com/t/small-doubt-in-ruby/147111/6 "2008-08-28T15:57:49Z")

</div>

Rock R. wrote:

> Hi. I want to know whether assembly programming is possible in Ruby like  
> in C or C++. Please also give some links for that if possible. Thank you

Assembly and Ruby are kind of an odd couple. Compared to the cost of  
Ruby itself, the performance gained by any assembly routine vs. a C  
routine will probably be quite small. What is it exactly you want to  
do? It just seems so strange to mix Ruby and Assembly code.

---

<div class="post-metadata">

**Author:** ![rocknrollcar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rocknrollcar](https://www.ruby-forum.com/u/rocknrollcar)\
**Post date:** [August 29, 2008, 4:14am UTC](https://www.ruby-forum.com/t/small-doubt-in-ruby/147111/7 "2008-08-29T04:14:15Z")

</div>

On Thu, 28 Aug 2008, Michael M. wrote:

> Rock R. wrote:  
> Assembly and Ruby are kind of an odd couple. Compared to the cost of Ruby  
> itself, the performance gained by any assembly routine vs. a C routine will  
> probably be quite small. What is it exactly you want to do? It just seems  
> so strange to mix Ruby and Assembly code.

Usually inline asm is about doing Rich and Strange things to hardware.

John C. Phone : (64)(3) 358 6639  
Tait Electronics Fax : (64)(3) 359 4632  
PO Box 1645 Christchurch Email : removed\_email\_address@domain.invalid  
New Zealand
