
Someday we will all program in Python - empone
http://davidbau.com/archives/2009/05/22/your_compiler_vanishes_in_a_puff_of_logic.html
======
andrewljohnson
The only reason to write in a language like C or Java today (over Python) is
speed. And there are a very limited number of applications that require that
sort of speed. There's no question that Linux should be written in a low level
language, or a high-performance chess bot. But I'm incredulous when I see
anyone write a website in even the relatively high-level Java.

So, the author is right that we're getting more Pythonic, but he's wrong to
say we'll all write in Python some day. Some day, something like Python will
be the fast low level language, there will be new slower languages that are
easier to use than Python, and C will be a memory. The evolution of
programming languages will never end, not in our lifetime certainly, and
probably not as long as we walk the earth.

I must say though that I pray for more convergence. It annoys me to write code
in JavaScript and Python, having to remember subtle differences between the
two as small as capitalization of true and False, and tricky pitfalls like the
scope of a variable declared in an if block.

It does seem an unnecessary burden for me as a web developer to have to know a
handful of languages. You can hardly make a website today without knowing
HTML, CSS, Javascript, Python/Ruby, and you better know your SQL too. Then,
let's talk APIs.

~~~
fauigerzigerk
_The only reason to write in a language like C or Java today (over Python) is
speed. And there are a very limited number of applications that require that
sort of speed_

You probably mean a very limited number of web app frontend code. That may be
true. But I think you underestimate what is being done with software.

With a language that is 200 times slower than C or Java you can't do any data
analysis, graphics or image processing, machine learning, algorithmic
optimisation, financial software like trading, pricing and risk management,
embedded systems, bioinformatics, simulation and a whole lot more.

You're basically excluding yourself from doing anything that mankind couldn't
do before. Progress it's called. Most AI tasks require massive computational
power. But even just things like pickling a Python object is too onerous for
Python itself. I don't think that's good enough.

~~~
DannoHung
Can we at least all agree that no one should be writing anything in a shell
scripting language any longer?

I'd be happy with just winning that battle.

~~~
vorador
Why are you against shell scripting languages ?

~~~
DannoHung
Because I have seen the horrors that they wreak in a production system where
they are responsible for mission critical logic.

The horror. The horror.

~~~
vorador
Could you give examples of it ? You could also write horrible python or ruby
code.

~~~
DannoHung
I don't feel comfortable posting code from my employer here, sorry. But let me
address your counter-argument on its own: Saying you can write bad Ruby or
Python is a turing tarpit argument. You can write bad code in any language,
but I've seen a lot more bad shell script code than I've seen bad Python. Add
to that that shell scripting languages are very irregular and I can't see why
anyone would use a shell script for something that they actually relied on
that was more complicated than invoking a few commands in sequence.

------
adamc
I thought the second comment was interesting:

>I believe the flaw in the argument is that the higher-level languages are
actually _more_ constrained, because they have made too many broad promises
and are unable to tell when they can violate them without ill effect, even
though it is obvious to the programmer. We might think that your example above
would be a perfect case in which we could parallelize the loop... but what if
sum() had side effects, such that it would produce the wrong result if not
evaluated in order? What if sum() didn't have any directly detectable side
effects, but called another function which called another function which
did... sometimes, from code in a runtime eval? The compiler has no way of
knowing this, so it has to assume the worst, and this is why it ends up being
unable to make all the optimizations that one thinks it "should" be able to
make. The human looks at it and says "duh, it's called 'sum'. If it has side
effects, I'm going to smack somebody up the side of the head" and proceeds to
optimize in the expected ways.<

~~~
mjuyhjui
Which is exactly why Fortran compilers are still faster than C++.

------
b-man
I think it is funny that the guy went and said something correct like this:

"In an ideal world, high-level languages like Python would replace all other
programming languages."

That includes smalltalk, scheme, clisp, and every marvelous language not yet
invented.

But then he goes on and says something very closed minded like

"Someday we will all program in python."

As if python got everything correct, and we have a perfect map of how humans
think with it. The arrogance.

~~~
natrius
The last part didn't seem entirely literal to me.

------
cubix
Or how about in Clojure?

(map (partial reduce +) (partition 7 7 daily))

Edit: Possibly that should be partition-all from seq-utils to sum the
remainder days if the length of daily isn't divisible by 7.

~~~
tybris
That's pretty unreadable for someone who doesn't know clojure.

~~~
stefano
That could be said for any language. It's just that the first language someone
usually learns borrows more from algol than from lisp. This leads to the idea
that Python/Ruby/PHP/Javascript are easier to learn than Clojure/Common
Lisp/Scheme.

~~~
lacker
Python/Ruby/PHP/Javascript _are_ easier to learn because most people already
know a similar language. Just because it seems unfair doesn't mean it's not
true.

~~~
stcredzero
Python and Ruby do one particular thing right that Smalltalk didn't:

Operator Precedence for Algebras.

Implementing an Algebra is a very important thing for a language to be good
at. Being able to use algebras without having to switch mental gears is a good
thing for scientists, mathematicians, and technical people of all stripes.

IMHO, the ability to easily implement your own algebra is a hallmark of a
great language. Having that with the operator precedence is a bit of very
justified syntactic sugar.

------
tybris
Some day we will stop writing COBOL.

~~~
malkia
2012... the year COBOL died!

------
_pius
_weekly = [sum(daily[j:j+7]) for j in range(0, len(daily), 7)]_

While I appreciate the general sentiment that high-level languages will take
over the world, there is very little that's new in this article and I am not
impressed by the showpiece Python code from the article. For loops are the
future?

~~~
fcr
Well I guess the list comprehension and list slicing features in the above
example are more interesting than the for loop.

------
samuel
_The less the programmer says, the more flexibility the compiler has to speed
things up._

I seriously doubt it. The more the compiler knows, the more it can optimize
things.

What it's "daily" in this example? It could be anything. The only thing the
compiler knows at compile time is that it should generate some lookups
searching and calling the functions "__iter__", "__slice__", etc... Put that
line into a function which receives daily as a parameter and it could mean
something different _at every single invocation_. Human beings, looking that
code think know what it does, while in fact don't have a clue. The equivalent
code in clojure someone has wrote only is really equivalent under some very
specific assumptions.

I know, I know, at runtime you could gather all kinds of interesting data to
optimize things. But, that's not easy nor cheap and, sometimes, iterating over
an array, it's just iterating over an array.

~~~
malkia
Also... The more the runtime knows, the more it can optimize away (JIT).

------
juliend2
Unfortunately, it will take a long time for all the web dev to switch (from
PHP) to Python. Lazyness is stronger than any high-level language feature or
development speed. I've long given up trying to convince my clients to switch
for a python-friendly host. Imagine: i still have some clients running their
website on PHP4.

------
danbmil99
So true.

[edit:] if only... Amend to: some day, we will program as efficiently as
possible, and software will do most of the annoying housekeeping.

