Ruby Script at Work
Lukhnos D. Liu
Chief, Lithoglyph Inc.
We’re an ObjC/C++ house...
I love C++...
Templates don’t scare me
for (vector<pair<pair<string, size_t>, set<Node>::const_iterator> >::iterator i = lst.begin()
; i != lst.end()
; ++i)
{
// iterate the list...
if (matches((*i).first.first)) {
run((*i).second);
}
}
* modified actual code
C++ is fast
Speed
Improvement
(higher is better)
ObjC 1.0 1x
C++ gen1 5.0 5x
C++ gen2 20.0 20x
* tested on a 1 GHz PowerPC Mac
Can do everything
In OpenVanilla, We Have...
OVStringHelper::Split
OVStringHelper::Join
OVFileHelper::SlurpFile
OVUTF16::FromUTF8
OVStringHelper::StringByReplacingOccurancesOfString
WithString(src, occur, replacement)
... and more script-language perks!
</digress>
But...
(that’s why I’m here today!)
C++ needs lots of care
Turn-around speed is slow
Compliation is slooooooow
Bad for more than 1 tool
Choices: sh/Makefile/Ruby
Ruby is advanced
Clear structure
Easy to maintain
post-
processing
directives
aggregate
Data Set 1 tool
and rinse
Merged Processed
tool tool
Data Set Data Set
Data Set 4
cherry pick
Data Set 2
and rinse
Meged Separation
tool
Data Set Tool
Data Set 5
aggregate
Data Set 3
and rinse
Data Set 4 Data Set 5
Interm. merge tool
Data Set 6 conversion Data Set 7
Data Set
* actual process
Windows Build System
Source version- Versioned Validation and Dev Dev
Code upper Source Files Staging Packages
Mac OS X Build System
Data Set 7
* actual process
Ruby’s Drawbacks
Modules We Use
openssl
digest
uuidtools
Formosa::Mandarin (lukhnos)
Slow... Very slooooooow
String processing Performance
C++ 1 100%
Perl 0.75 75%
Ruby 0.20 20%
* estimation on daily use cases
This is opening talk of Ruby Tuesday Taiwan, Novemb more
This is opening talk of Ruby Tuesday Taiwan, November 25, 2008 in Taipei, Taiwan.
Lukhnos talks about how Lithoglyph, his company, uses Ruby to replace shell scripts, Makefiles and Perl scripts in their build system. He also talks about the strength and weakness of Ruby the language. less
0 comments
Post a comment