From: "M. Edward (Ed) Borasky" Date: 2007-11-13T00:02:21+09:00 Subject: Re: enterprise ruby Jay Levitt wrote: > On Sun, 11 Nov 2007 22:32:14 -0500, M. Edward (Ed) Borasky wrote: > >> For 2, given that Ruby operates on most platforms, it's almost always >> possible to accomplish 2 using "loose coupling" with little or no >> penalty. > > Possible, yes. (Again, Turing-complete and all that.) But it depends what > you mean by "penalty". > > The very first thing I think of when I think "Ruby and native extensions" > is RMagick/ImageMagick for a web site. And that's notoriously difficult to > build even in a C-based, MRI environment, although I understand that's > supposed to be better now in 2.0 (I haven't tried it yet). I actually thought about ImageMagick when I wrote that. Doesn't ImageMagick have a command line interface? Can't Ruby (and jRuby) execute command lines? That's what I had in mind when I wrote "loose coupling". :) [snip] > You almost want some kind of messaging-oriented SWIG. Except SWIG itself > isn't even that easy to use (every time I think about using it, I end up > drifting toward Ruby::Inline instead; I think you only get the SWIG > advantage if you really target multiple languages.) So you want a > messaging-oriented BETTER SWIG. Without any of the complexity of SWIG. Or > messaging. SWIG requires deep knowledge of the library you are attempting to engulf in your scripting language. Indeed, the payoff is primarily if you want one library to serve many scripting languages, not just Ruby. However, if you want to declare Ruby the one true language, Ruby::Inline is the way to go. > > Thoughts? Well ... I'm sticking with "because it's open source and we can" as the best reason for extending a language. Implicit in that is a plea *to* extend the language to the primitive data types necessary for, say, signal and image processing, which are -- surprise -- multidimensional arrays of numeric data packed contiguously in RAM. I'm genuinely curious about this -- MATLAB is a (very expensive closed source) package that caters to numerical processing, including signal and image processing. Can MATLAB process regular expressions? Can Mathematica? Or does one need a two-language solution -- MATLAB for the number crunching and Perl, Python or Ruby for the data extraction? >