Wednesday, September 06, 2006

Starting a software development project with C++ is premature optimization

Starting a software development project with C++ is premature optimization, instead, start with Ruby, find bottlenecks, convert those to C++ as needed.
This is where RubyInline comes in, just tested with Ubuntu, very cool, http://www.zenspider.com/ZSS/Products/RubyInline/Readme.html:
:~/ruby_test# ruby NexaFact.rb
Nexa Hello
Nexa Hello
Nexa Hello
:~/ruby_test# cat NexaFact.rb
require 'rubygems'
require 'inline'
class NexaFact
inline(:C) do |builder|
builder.include ''
builder.add_compile_flags '-x c++', '-lstdc++'
builder.c '
void hello(int i) {
while (i-- > 0) {
std::cout << "Nexa Hello" << std::endl;
}
}'
end
end
t = NexaFact.new()
t.hello(3)
:~/ruby_test#

0 Comments:

Post a Comment

<< Home