Python is DOOMED! Again!
marfig at gmail.com
Fri Jan 30 19:42:31 CET 2015
In article <54ca5bbf$0$12992$c3e8da3$5496439d at news.astraweb.com>,
steve+comp.lang.python at pearwood.info says...
> Why should I feel guilty? You wrote:
> "Static analysis cannot and should not clutter executable code."
> But what are type declarations in statically typed languages like C, Pascal,
> Haskell, etc.? They are used by the compiler for static analysis. The same
> applies to type declarations in dynamically typed languages like Cobra and
> Julia. And yet, there they are, in the executable code.
> So there are a whole lot of languages, going all the way back to 1950s
> languages like Fortran, to some of the newest languages which are only a
> few years old like Go, both dynamically typed and statically typed, which
> do exactly what you say languages "cannot and should not" do: they put type
> information used for static analysis there in the code.
(Sorry if I'm late...)
You are comparing static analysis with compile time checking which
can result in implicit conversions and that can affect the resulting
binary code. Something that Python won't do with type annotations. And
something that Julia, Scala or C does.
This is also the first time I hear compilation mentioned as static
analysis. But I suppose... After all it does perform a crude form of
static analysis as a natural consequence of compile time checks, besides
doing a whole bunch of other things that aren't static analysis. A dog
has four legs and two eyes. So does an elephant. I suppose you are going
to argue with me that a dog is an elephant after all.
To be clear, type declarations in Julia, Scala, C have the potential to
produce side-effects, can result in optimized code and can result in
compile time errors or warnings. They also affect runtime evaluation as
you could easily attest if you input a float into a function expecting
an int, whereas in Python the float will be gladly accepted and will
only fail at the point in code where its interface won't match the
Meanwhile, type annotations in Python are instead completely ignored by
the interpreter. They do nothing of the above. They do not participate
in code generation and execution.
> As I said, these languages disagree with you. You are not just arguing
> against Guido, but against the majority of programming language designers
> for 60+ years.
You are right. I'm not arguing against Guido. I have yet to hear his
opinion on what you are saying, so I don't even know if I should want to
argue with him. And I'm not arguing against the majority of programming
languages either, because as much as you try I have yet to hear an
argument from you that convinces me they don't agree with me.
No. I'm arguing with you.
More information about the Python-list