From: Charles Oliver Nutter Date: 2007-11-13T03:03:42+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). > > What would the "right answer" be in JRuby? I just did some Googling, and > from what I can tell, there are a few ways you could go: The truth is there's probably another dozen options beyond those listed here, so it's hard to say what the best approach would be. There's even a Java-based ImageMagick that either wraps or duplicates IM's functionality. So I guess there's an important introductory question to ask before we would start investigating: Is it ImageMagick's exact specifications or general image processing we want to provide? The former is obviously much harder, while the latter can be done through any number of libraries. I think you'd be hard-pressed to find any library in the C world that doesn't have a reasonably good equivalent in the Java world (sometimes that just wrap those libraries from the C world). So it's certainly possible and reasonable to say most extensions could be provided in a similar-if-not-identical form under JRuby with just a bit of plumbing. And thankfully JRuby's integration with Java means that plumbing should be less than equivalent in the C world (i.e. the C world is fraught with peril, as RMagick's occasional instability has shown). - Charlie