REPOST: Re: Two languages, too similar, competing in the same space.

Ron Stephens rdsteph at earthlink.net
Thu Dec 27 18:36:15 EST 2001


I find this very interesting. Thanks for sharing it, it sounds very useful!


HarryO wrote:

> On Fri, 28 Dec 2001 09:56:29 +1100, Ron Stephens wrote:
>
> > ... But
> > now that Ruby is out there, it absorbs enormous mind share, and
> > development time to recreate libraries etc., which are already available
> > in Python,  thus hurting Python.
>
> I have only tried it in a very minimal way, just to see that it did
> basically what was advertised, but you might be interested in this.
>
> There's a Ruby library that allows you to do things like:
>
>    require 'python'
>    require 'python/httplib'
>
>    h = Py::Httplib::HTTP.new(host)
>
>    h.putrequest('GET', path)
>    h.putheader('Accept', 'text/html')
>    h.putheader('Accept', 'text/plain')
>    h.endheaders()
>
> Ie, the "require 'python'" makes pulling in Python libraries
> as simple as ...
>
>    require 'python/SOME_PYTHON_LIB'
>
> which is almost as easy as doing it in Python.
>
> Similarly, referencing elements of such a library simply
> requires prefixing them with "Py::".  Once you have a
> handle to a Python object, you call it the same way you
> would in Python.  I don't think one could make it much simpler.
>
> So, to some extent, it's possible to avoid reinventing the
> wheel.  How well this works, I can't say, just that the
> examples I played with worked as advertised.
>
> Obviously, there's some overhead, in that it's running a copy
> of the Python interpreter to execute the Python code, but so
> long as the work the library is doing for one is larger than
> the actual overhead of the call to it, that shouldn't be a
> problem.

========= WAS CANCELLED BY =======:
Path: news.sol.net!spool1-milwwi.newsops.execpc.com!newsfeeds.sol.net!news-out.visi.com!hermes.visi.com!newsxfer.interpacket.net!news-xfer.nuri.net!feeder.kornet.net!news1.kornet.net!ua4canc3ll3r
From: Ron Stephens <rdsteph at earthlink.net>
Newsgroups: comp.lang.python
Subject: cmsg cancel <3C2BB10D.BD5002C7 at earthlink.net>
Control: cancel <3C2BB10D.BD5002C7 at earthlink.net>
Date: Mon, 31 Dec 2001 02:56:47 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.3C2BB10D.BD5002C7 at earthlink.net>
NNTP-Posting-Host: 211.57.49.2
X-Trace: news2.kornet.net 1009775497 27193 211.57.49.2 (31 Dec 2001 05:11:37 GMT)
X-Complaints-To: usenet at news2.kornet.net
NNTP-Posting-Date: Mon, 31 Dec 2001 05:11:37 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.



More information about the Python-list mailing list