Jano Svitok
8/8/2006 2:33:00 PM
On 8/8/06, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
> Jan Svitok wrote:
> > On 8/8/06, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
> >> Apparently there is a SWIG wrapper for GiNaC that generates Python
> >> bindings for it. It can't be very difficult to port that to Ruby,
> >
> > Ruby support in SWIG is not as complete as Python's, mainly regarding
> > stl and wide strings. So the ease of porting will depend on whether
> > you encounter any deficiency or not. Anyway, chances are that you
> > won't. In that case porting should mean just changing swig command
> > line...
> >
> > J.
> >
> >
> I've downloaded their code and I'm looking at it now. I'm rather
> hampered by not knowing any Python. Meanwhile, are you talking about the
> *latest* SWIG? I've got 1.3.29, which includes support for "pike",
> "mono", "lua" and "ocaml" in addition to the more common languages. When
> I was looking through the SWIG documents, it looked like they had a
> fairly complete section on the Ruby interface. ANd it doesn't have to
> work on Windows . :)
>
> <ducking>
>
what I meant is (SWIG 1.3.29):
in ruby there are following std_*:
std_common.i
std_deque.i
std_except.i
std_map.i
std_pair.i
std_string.i
std_vector.i
in python there are these additional files:
std_alloc.i
std_basic_string.i
std_carray.i
std_char_traits.i
std_complex.i
std_container.i
std_ios.i
std_iostream.i
std_list.i
std_multimap.i
std_multiset.i
std_set.i
std_sstream.i
std_streambuf.i
std_vectora.i
std_wios.i
std_wiostream.i
std_wsstream.i
std_wstreambuf.i
std_wstring.i
So if you need e. g. std::list or std::set, you have to experiment. (I
somehow managed to get list working, and my colleague got working
wstring)
It has to be noted though, that python's support seems to be the most
complete, and fortunately for us, ruby is supported pretty good as
well. It saved me a lot of work... the swig generated .cpp file has 5
MB!
J.