[Gllug] Linux workstation admin simpler than OS X

gllug at jameslaver.com gllug at jameslaver.com
Sun Aug 2 10:20:06 UTC 2009


On Sun, Aug 02, 2009 at 10:43:44AM +0100, Richard Jones wrote:
> It's not memory leaks, just poor use of memory.  Perl, Python and Ruby
> throw away all the knowledge of compiler technology which was
> accumulated over the 1960s, 70s and 80s.  Instead they take a very
> naive approach to building interpreters and do zero static analysis on
> the code.  The result is that they waste runtime resources as a
> tradeoff for having very simplistic implementations (making life easy
> for the implementers of these languages, and hard for everyone that
> has to use them -- the reverse of how it should work).

I'm left to wonder if you've actually look at the perl internals, since 
it's the one that doesn't so that. Perl is actually surprisingly 
optimising, although it would rather waste memory to improve speed. The 
problem is that Perl is so dynamic that you can't make these guarantees 
universally. If you can play with the symbol table at will, you can do 
what you want. There are still ways around this, but it's a much bigger 
problem than you make out and perl of all of them is the one that does 
the most work at compile time.

Certainly, it's not to simplify the lives of the maintainers. Perhaps 
you should read P5P sometime so you can rant more informatively (because 
certainly there *are* unsatisfactory things).


> As an example: all three languages will store, at runtime, the type of
> every single variable, even short-lived temporary variables, and even
> variables where it could be proven that the type will never be needed.
> This is amazingly dumb, and no compiler written since about 1975 works
> like this.

Perl has a fixed set of types internally and storing what type it is is 
merely a matter of which pointer in the structure actually goes 
somewhere. Oh no, a couple of bytes. Big whoop

Of course memory still costs a pound a byte. Silly me for forgetting.

> As another example: they all use reference counting, which is very
> primitive form of garbage collection that has very high overhead.  But
> it is simple to implement, particularly if you have no background at
> all in computer science and you consider academic papers to be
> irrelevant to hacking away at code.

Perl may indeed use reference counting, but it's vaguely intelligent 
about how it does it. While I think it would be interesting to port it 
to a generational model, lack of tuits and all that.

> Use a real language (OCaml in my case) and you don't have to put up
> with this nonsense.

OCaml is awkward to do a number of things in and makes me want to spork my
eyes out when i look at code written in it.

I'm sure you think the same about Perl though.

--James
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list