Python and the need for speed
steve at pearwood.info
Thu Apr 13 02:32:22 EDT 2017
On Wed, 12 Apr 2017 14:38:52 +0100, Ben Bacarisse wrote:
> Steve D'Aprano <steve+python at pearwood.info> writes:
>> On Wed, 12 Apr 2017 03:39 am, Paul Rubin wrote:
>>> I still do my everyday stuff in Python and I'd like to get more
>>> conversant with stuff like numpy, but it feels like an old-fashioned
>>> language these days.
>> "Old fashioned"? With await/async just added to the language, and type
>> annotations? And comprehensions and iterators?
>> Admittedly type annotations are mostly of interest to large projects
>> with many developers and a huge code base. But the rest?
>> Comprehensions may have been around for a decade or two in Haskell, but
>> most older languages don't have them. I'm pretty sure Java doesn't.
>> to me.
> They've been in in Haskell for nearly three decades, but they were
> around before that. Miranda had them, as did Miranda's immediate
> predecessor, KRC. KRC dates from about 1980, so if you've been using
> that lineage of languages, list comprehensions have been a standard
> feature for 37 years. I've been using them almost my entire programming
Indeed, and this is a very common phenomenon: features which "ordinary"
programmers imagine are "trendy" and new end up having their roots in
some functional language dating back to the 1980s, or 70s, or in extreme
cases the 1950s and Lisp.
That's what I meant: even though Haskell has had comprehensions for
decades, they haven't hit "mainstream" procedural languages (Java,
or more (how time flies...) but they still to this day get reactions from
many Python programmers like
"I don't get these fancy new list comprehensions, what's wrong with an
(not quoting anyone in particular, although Bart did specifically mention
he didn't grok comprehensions).
> them, but then JS seems to hide its function nature under an imperative
> Just another perspective...
Thanks. I knew comprehensions have been around for a while, I didn't
realise they went back to Miranda and even older.
More information about the Python-list