Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Coverity Scan
- Date: Tue, 01 Mar 2011 11:49:33 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: Re: [tlug] Coverity Scan
- References: <4D639689.1010302@example.com> <4D63EFBC.1020900@example.com> <4D64C5DD.1040607@example.com> <4D64CB49.10906@example.com> <4D652AF5.10304@example.com> <4D655712.1090608@example.com> <37687.61.213.3.170.1298510044.squirrel@example.com> <4D661A15.8010009@example.com> <4D666540.5000705@example.com> <4D66EF27.7070905@example.com> <87sjvcd49n.fsf@example.com> <4D699BD4.5050507@example.com> <AANLkTimM=G=TrPLwwv6KwoqZfxiqmRf+zeKRZRbuxTFd@example.com> <4D6AEBC4.2000301@example.com> <4D6B0F3D.4080206@example.com> <AANLkTikU+TF87-DLUi5TwKBK-MRdMN-Byr7NJgfLK9mu@example.com>
Josh Glover writes: > I think it is down to the fact that Perl was born as awk + sed, then > had a bunch of stuff bolted on, whereas Python was designed from the > start as a clean, OO (why the primitive types, Guido?) For efficiency. The technology of the time didn't allow both object orientation from the word go, and efficiency. See Zen Principle #9. While today's C Python interpreter (VM) is pretty efficient as such things go, note that JPython (a Python compiler targeting the Java virtual machine) and IronPython (a Python compiler targeting the .NET virtual machine) are both of efficiency comparable to C Python. IOW, technology has advanced a lot, generic VMs are now competitive with software designed for the task. Also, it's trivial to wrap any of the primitive types in a class if you need that capability. In Python 3, there no longer is a distinction between primitive types and classes. The implementation is different, but the API is common. I believe it's still impossible to do certain things with those classes (for example, I think it's impossible to derive subclasses from them) but this is a deliberate restriction rather than imposed by the technology. The only significant request for derivation from a primitive type is for string and bytes and is IMO wrong-headed. People in the web framework community really want polymorphism across bytes (what you get from the wire) and strings (what the compiler builds from "" literals). What it comes down to is that the *computing* world is still very much ASCII and you can mostly get away with ignoring 8-bit-set bytes and praying you never see any ISO-2022-JP. But "I don't think we're in Kansas any more, Toto," and experience shows that it's not a good idea to mix the two. The claim that this is needed for efficiency seems bogus, given that regexps are used a lot; compiling one regexp takes as much time as converting 50MB of Latin-1 to Unicode. Even complex encodings like ISO-2022-JP or UTF-8 can be converted at 1% of that speed; response time is clearly going to be dominated by IP latency even for them. BTW, ISTR that Ruby also had some primitive types, at the class level. In Python that was never so. Classes were objects, and could be manipulated as such. You pays your yen and you takes your kroner (and the bank takes its 1% -- always). > language intended for pedagogy. No, it was intended to be a useful language clean enough for pedagogy. The communities are very different. The Python language designers are mostly elite professionals, while Perl hackers are, well, hackers. Not quite as bad as Emacs developers, but the cowboy developer ethic is still there.
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Do you whitelist or blacklist utf-8?
- Next by Date: [tlug] Prevent access shared server using PHP
- Previous by thread: Re: [tlug] Do you whitelist or blacklist utf-8?
- Next by thread: [tlug] Prevent access shared server using PHP
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links