User loginNavigation |
PythonPython 3000 Status UpdateGuido updates the vision. Syntax focus seems cancerous, leaving FP sandwiched between set literals and backtick syntax, under Miscellany:
Guido says that example "gives reduce() a bad name" which leaves me wondering as to its relevance. The idea that FP = Miscellany makes me wonder why the more stunning Python success stories (Google) involve FP techniques. Elsewhere:
So FP is not even a free-standing category yet. I sometimes wish PLT Spy would revive, or that some FP language would target Python intermediate code. The value of Python is often stated to be its libraries. I also wonder if Python people might build intuition by watching REBOL (=Lisp) people at work. They seem to enjoy puzzles. The motivating notion would be "hey! that REBOL trick should be so easy in Python." Python in Pardus LinuxPardus Linux is a case study of functional Python. It's a Linux distribution built from semi-scratch, the main focii being package management and init subsystems - places where C and shell script make poor sense. A funded group has finally tackled these issues.
A package management software deals a lot with sets, lists, and dependency graphs....We have extensively used functional operators (map, filter, reduce) and list comprehensions, even metaclasses are used in a few places. Someone nudge Guido. Scheme or Oz might have been the better choice, but give them credit. They admit frankly to social acceptance issues. By Mark Evans at 2007-06-19 22:55 | Logic/Declarative | Object-Functional | Python | XML | 8 comments | other blogs | 12799 reads
Charming Python: Decorators make magic easy
While metaprogramming is inherently a bit confusing, I think this article could have a been a little clearer. Still, it's a nice highlevel introduction to decorators. By Ehud Lamm at 2007-01-05 14:40 | Meta-Programming | Python | 7 comments | other blogs | 10577 reads
Type inference for PythonThe subject of type inference for dynamically-checked languages came up in the Buried Treasure thread. A question was raised in that thread having to do with why static type inference in these languages is difficult. Since there's a nascent body of literature which addresses that question, here are a few links to articles and papers about type inference for Python. A nice overview can be found in Localized Type Inference of Atomic Types in Python, a Master's thesis by Brett Cannon. The whole thesis is relevant, but for an overview of the issues, see Chapter 3, "Challenges of Inferring Types in Python". Chapter 4 summarizes previous attempts involving static inference in Python, including Psyco (previously on LtU) and Starkiller. The limitations of these attempts are briefly addressed. Type inference solutions for Python invariably involve restrictions to make the problem tractable. The above paper focuses on "inferring atomic types in the local namespace". Another approach is described in Aggressive Type Inference, by John Aycock. Aycock makes an important observation:
The article offers a type inference approach which exploits this observation. (If the meaning of the above quote isn't clear, I recommend reviewing our mammoth three-part thread on the subject, "Why type systems are interesting", part I, part II, and part III.) The PyPy implementation of Python in Python (previously on LtU) uses a restricted subset of Python, called RPython, to implement parts of the language. RPython is sufficiently static to be able to support full-program type inference. It is not a "soft" inference approach, and is not designed to be used with ordinary Python programs. The paper Compiling dynamic language implementations covers the approach used for static analysis of RPython. The PyPy Coding Guide, starting at section 1.4 may also be useful. (It may be interesting to note that the PyPy approach is very similar to that used previously for Scheme 48. The core of Scheme 48 is implemented in PreScheme, a subset of Scheme that supports full-program type inference.) Finally, Guido van Rossum has a number of blog entries on the subject of adding optional static typing to Python:
If anyone knows of any other good treatments of type inference in Python or similar languages, please post links here. By Anton van Straaten at 2006-05-30 01:54 | Python | Type Theory | 18 comments | other blogs | 56663 reads
EasyExtend - Python MetaProgrammingJust saw this announcement on Google groups / comp.lang.python.
You'll want to probably want to check out the examples. By andrew cooke at 2006-05-22 22:37 | Meta-Programming | Python | 1 comment | other blogs | 12168 reads
Python 2.5a1 releasedPython 2.5 seems to be feature complete now and is released as a first alpha. See here for a complete list of new features. From a language perspective enhanced generators and the new with-statement are probably the most interesting features. For many developers the incorporation of the small relational database sqlite, the new XML package elementree and the foreign function interface ctypes might be the highlights. Class decorators in Python
More + links: here. By Ehud Lamm at 2006-03-30 15:48 | Cross language runtimes | OOP | Python | login or register to post comments | other blogs | 11427 reads
Tail call elimination decorator in PythonFeatures of a programming language, whether syntactic or semantic, are all part of the language's user interface. And a user interface can handle only so much complexity or it becomes unusable. This is also the reason why Python will never have continuations, and even why I'm uninterested in optimizing tail recursion. Thus spoke Guido - as LtU readers already know. Now, not even four weeks later, it has become clear that turning tail recursions into iterations can be achieved by an innocent little decorator in pure Python. No Rube Goldberg machine(s) in sight. By Kay Schluehr at 2006-02-28 07:33 | Functional | Implementation | Python | 35 comments | other blogs | 67322 reads
Guido: Language Design Is Not Just Solving Puzzles
The discussion is about multi-statement lambdas, but I don't want to discuss this specific issue. What's more interesting is the discussion of language as a user interface (an interface to what, you might ask), the underlying assumption that languages have character (e.g., Pythonicity), and the integrated view of semantics and syntax of language constructs when thinking about language usability. PyPyPyPy, the Python implementation written in Python, was mentioned here a couple of times in the past. After it was mentioned in a recent LtU discussion, I took another look, and boy did they make a lot of progress when I wasn't looking. PyPy can even compile itself now... You should check it out again if you are interested in this sort of thing. There's even an introduction to the techniques used by PyPy, including a nice (but very high level) overview of abstract interpretation. By Ehud Lamm at 2006-01-28 11:47 | Meta-Programming | Python | 18 comments | other blogs | 17918 reads
|
Browse archives
Active forum topics |
Recent comments
26 weeks 5 days ago
26 weeks 5 days ago
26 weeks 5 days ago
48 weeks 6 days ago
1 year 1 week ago
1 year 2 weeks ago
1 year 2 weeks ago
1 year 5 weeks ago
1 year 9 weeks ago
1 year 9 weeks ago