Robert Klemme
12/31/2004 7:24:00 PM
"gw" <gw@citasystems.com> schrieb im Newsbeitrag
news:200412311857.iBVIv1p02579@developer.citasystems.com...
>5 years ago one of our smart guys suggested we throw away our home grown
>"Basic" which glues our
> many software actions into a seeming whole. We had over the years created
> many verbs that are
> activated by special names. The "Basic" glue became more and more
> important and it was pointed out
> that our specialties should be the verbs NOT the "Basic". At that time
> Python was suggested as a
> replacement for our proprietary "Basic".
>
> Here it is 5 years later and our programming staff is very small and the
> ancientness of our "Basic"
> MUST be dealt with. I am giving some consideration to Ruby, though I
> *know* that Python would do
> OK. I have programmed in many languages and I now include Python as one I
> know well enough.
>
> I am initially attracted to Ruby because it promises more fewer special
> cases in syntax and its
> more purely object orientation. Not the least is it has not exploded (yet)
> to the point of being
> nearly impossible for a programmer to walk all the way round language.
>
> Here is my question: Embedding our OLD code into Ruby is how big a chore?
> A lot of this code dates
> from the late 1980's and is in NO WAY object oriented. Python seems like
> it might let me get away
> with embedding old code without make major complaints. Have any of you
> attempted to incorporate
> procedural code (tied together with global variables) into Ruby? I would
> understand if
> knowledgeable programmers plead with me to not sully Ruby's name by
> attempting this Frankenstein.
> However, I want the power of new life for our "specialty verbs" that a
> modern, supported
> "scripting" language would provide.
I think the problem is not that the code you are trying to integrate is
procedural but that it uses global variables. You might have problems with
memory allocation and deallocation, but I guess that's the case for Python
as well as Ruby or others.
Although I haven't done something like this I'd say that if it's possible in
Python it should be possible in Ruby, too. You might end up with one or
several modules containing module methods (roughly one for each function of
your C code, is it C?) but that sounds certainly possible.
Another question is how easy is it to map your legacy code's data types to
values in the host language. I cannot judge how difficult that is, partly
because I haven't done that yet and partly because I don't know your code
you want to integrate.
Just my 0.02 EUR...
Good luck!
robert