Re: JavaVM compiler for Python?

Farshad Nayeri (nayeri@gte.com)
18 Apr 95 18:38:22

In article <3mve46$flj@insosf1.infonet.net> jeffo@worf.infonet.net (Jeffrey C. Ollie) writes:

connolly@www18.cern.ch (Dan Connolly) writes:

>In article <CVALE.95Apr17161219@netcom20.netcom.com> cvale@netcom20.netcom.com (Chris Vale) writes:

> Dan> e.g, also. Try something like:
> Dan> a = {} for i in [0..1000]: a['indx' + `i`] = 'value' +
> Dan> `i`
> Dan> and watch the heap grow!)
>
> Hmm, don't you mean something like
> a = {}
> for i in range(0,1000):
> a['indx'+str(i)] = 'value'+str(i)
> ?
> this seems to take less than a second to generate, and less than 15k
> of heap ( 486DX2 66mz running windows/NT 3.5). So what is the problem?
> I think you need to learn a little about the language since your code
> isn't correct anyway. The problem is you seem to be assuming something
> based on your understanding of the underlying architecture rather than
> from practial experience. Try it, you might actually like it.

>No... this was from real experience. It has been a little while, so
>I'm a little rusty. But we were building a CD-ROM index of the web:
>50,000 documents. Just keeping a list of URLs that big made the python
>heap exhaust virtual memory. We were forced to switch to perl.

>I looked at the source to the runtime, and it does 2 mallocs per
>string object: one for the header, and one for the char array.
>Considering that strings are immutable, there's an obvious optimization
>that's not being exploited (or wasn't in 1.0.3 or 1.1 or so.)

Just because a particular implementation of a language has problems
(and this is an implementation issue (btw, several nasty memory
leaks were fixed in v1.2) and not a language design issue) doesn't
mean that the language is without merit. When the Python
implementation has gone through as many iterations as the Perl
implementation, it may be as fast and memory efficient as Perl is.

It's almost like people were rejecting C because GCC had a few bugs...

Personally, I like Python because it feels designed, not accumulated.

I think we are getting in one of these usual Usenet situations. In his
original post, Dan asked if anyone was working on a Python to JavaVM
compiler. (If you will go back, you will see.) I don't think he meant
to criticize Python, the language, or saying Java was better. He is
simply asking if anyone is considering re-implementing Python (as he
asked on one other newsgroup that I read.) I think his is a reasonable
question.

I think Python folks are sensitive to comparisons with Perl, so Dan
may want to be more careful in this context not to sound like a Perl
fanatic (because I don't think he is a Perl fanatic).

Getting back to the point, all of this may be important *if* Java is
widely deployed. Dan seems to think so. Dan, can you explain why you
think this is the case?

I personally don't find Java _that_ big a deal, given that I am used
to programming in Modula-3 with basically all of Java as far as
functionality is concerned (except GUI & Mac support?). Also, Dan,
what makes you think Java will do better with your 50,000 URL catalog?

Now, if someone was willing to re-implement Python in Modula-3, then
that'd be great! Then you may have _real_ threads, much faster gc,
real exceptions underneath it all.

(50,000 URLs exhausting virtual memory doesn't make sense to me. Dan,
are you sure these numbers are right)

-- Farshad

--
Farshad Nayeri
nayeri@gte.com