Hi, i have a computationally intensive section of my ruby code that i''d like to run as C++ code. I''ve heard that it''s easily possible but i don''t know how to do it. Does anyone have a clue? Any help is appreciated. Thanks Chris -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Chris wrote:> Hi, > > i have a computationally intensive section of my ruby code that i''d like > to run as C++ code. I''ve heard that it''s easily possible but i don''t > know how to do it. Does anyone have a clue? Any help is appreciated. > > Thanks > ChrisThere have been a lot of threads on how to write extensions in C. Search the archives and then start with README.EXT in the Ruby source tree. If your question is specifically about writing an extension in C++, I''ve always found it best to write the extension boilerplate code in C and have that code handle the data transitions to and from Rubyland, and call your C++ code. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
gene.tani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-14 13:56 UTC
Re: Can you embedd C++ into Ruby?
Chris wrote:> Hi, > > i have a computationally intensive section of my ruby code that i''d like > to run as C++ code. I''ve heard that it''s easily possible but i don''t > know how to do it. Does anyone have a clue? Any help is appreciated. > > Thanks > Chris > > -- > Posted via http://www.ruby-forum.com/.Wrong forum. And In general the protocol is to do some searching (google groups, delicious tags, the pickax and Agile webdev books) first. I think you want to have a look at writing extconf.rb and C extensions directly, or using SWIG, Ruby-DL, RubyInline, etc http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/5b5168f38bee703c?hl=en --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---