From: Bauduin Raphael Date: 2003-12-01T05:27:10+09:00 Subject: Re: Ruby vs Python (IMHO) Phil Tomson wrote: > In article <20031129184817.GA1426@math.umd.edu>, > Daniel Carrera wrote: > >>Hi all, >> >>I guess I just want to share a tiny "case study" from a project that I'm >>doing in Python and which I wish I could do in Ruby instead. >> >>I am writing a BibTeX filter for the OpenOffice project (BibTeX is the >>bibliographic cousin of LaTeX). I am doing it in Python because, of the >>languages with stable bridges to the OOo component model (UNO) Python is >>the one I like best. > > > Hmmm.... so what would it take to include Ruby in the set of languages > with 'stable bridges to the OOo component model'? > There was a project about making python modules available to ruby, but it was not developed anymore ( http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/ ) I mention it because the question arose on ruby-garden (IIRC) about which modules available in Python were lacking for Ruby and I see this as an example :-) Raph > >>My requirements are mostly related to regular expressions and string >>methods. This is an area where Ruby really shines and is light-years >>ahead of the competition. >> >>Regular expressions in Ruby are infinitely eaiser and more sensible to >>use than in Python. >> >>Ruby: >> str =~ /^(#{char})\s*{\s*(#{char}+),(.*)}/ >> >> >>Python: >> regex = re.compile(r"^(" + char + "+)\s*{\s*(" + char + "+),(.*)}") >> regex.match(str) >> > > > Ouch, that's painful. > > Phil