From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA13465; Tue, 18 Nov 2003 22:20:43 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA13442 for ; Tue, 18 Nov 2003 22:20:41 +0100 (MET) Received: from cmailg2.svr.pol.co.uk (cmailg2.svr.pol.co.uk [195.92.195.172]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hAILKf105559 for ; Tue, 18 Nov 2003 22:20:41 +0100 (MET) Received: from modem-71.beedrill.dialup.pol.co.uk ([217.135.32.71]) by cmailg2.svr.pol.co.uk with esmtp (Exim 4.14) id 1AMDH5-0005rq-Kv for caml-list@inria.fr; Tue, 18 Nov 2003 21:20:40 +0000 Date: Tue, 18 Nov 2003 21:20:37 +0000 (GMT) From: John J Lee X-X-Sender: john@alice To: Caml Mailing List Subject: Re: [Caml-list] GC and file descriptors In-Reply-To: <20031118200209.GA549@exomi.com> Message-ID: References: <1069092899.17437.58.camel@pelican> <20031118120517.GA881@exomi.com> <1069168782.18363.90.camel@pelican> <20031118200209.GA549@exomi.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 1100,:01 python:01 closures:01 python:01 scopes:01 scopes:01 reinventing:01 foo:01 admittedly:01 foo:01 finalization:01 dynamically:01 pre-alpha:01 inefficient:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 18 Nov 2003, Ville-Pertti Keinonen wrote: > On Wed, Nov 19, 2003 at 02:19:42AM +1100, skaller wrote: > > You haven't seen Python 2.2? Its a genuine functional > > programming language now, with full lexical scoping, > > closures, and even some advanced concepts like > > iterators which cannot be programmed in Ocaml. > > AFAIK (correct me if I'm wrong!) Python still doesn't have > conventional lexical scoping. (warning: I am far from a Python language lawyer) Python local scopes are not dictionaries. > Each scope is a dictionary, and class Class and global scopes are, yes. > scopes require explicit references (which is one of the most annoying > things in Python in practice; when writing code including classes, the > amount of self.-referneces more than makes up for the lack of let ... > in expressions used in other languages in terms of the amount of > typing involved). People using languages that don't have this seem to end up reinventing it. We see names like "m_foo" all the time in C++. Since self is just a conventional name of the first argument of Python methods, some projects (very few, admittedly) choose to use "s" instead of "self" (s.foo, not self.foo), and people still understand the code, since they use it consistently. > As for the functional part...considering that Python distinguishes > between expressions and statements, and lambda-expressions are only > permitted to include expressions, that's a fairly nasty limitation. Yes, I agree. I don't think Python puts much emphasis on functional ways of doing things, so it's only "nasty" if a functional language is what you're looking for (and perhaps we *should* all be looking for that, I dunno). > With these features (plus dynamic typing and especially supposedly > deterministic finalization, i.e. reference counting), Python is > inevitably fairly inefficient, I doubt it can never achieve the > efficiency of the best Common Lisp implementations (which are > probably the most efficient possible implementations of dynamically > typed languages, apart from the lack of continuations). I would certainly expect so. Of course, Python programmers rarely give a damn about that. :-) Still, the PyPy project (with Armin Rigo of Pysco fame on the team) has been making grand claims about execution speed, and a little of that vapour has condensed to the point where they have detailed plans (for a project at this stage), which were required for a pending application for EU funding, and a running interpreter in some larval state, ready or almost-ready for pre-alpha distribution, I think... ie, still vapourware ;-) John ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners