spenrose
6 hours ago
1. Python was designed by testing syntax with novice users to see what they could adopt easily.[1] > 90% of current Python users weren’t born when it was created. They all had to learn, and Python is the easiest language to learn because Guido and his teammates, unlike $LANGUAGE_DESIGN_GOD, approach the problem as experimental scientists rather than auteurs.
2. Python is conceptually compact, dominated by hash tables with string keys. The initial leader in the ecosystem, Perl, is conceptually sprawling and difficult to reason about.
3. Python also took lessons from the Unix shell, a mature environment for accommodating beginners and experts.
4. Python had a formal process for integrating C modules from early on.
5. Python’s management has an elegant shearing layer structure, where ideas can diffuse in from anywhere.
6. $NEXT_GENERAL_PURPOSE_LANG (Ruby, Go) weren’t enough better to displace Python. Both were heavily influenced by Python’s syntax, but ignored the community-centric design process that had created that syntax in favor of We Know Best.
7. Speaking of open source entrepreneurialism, JavaScript has become a real rival thanks to the Web (and node), but it is handicapped by the inverse failure mode: where Go is dominated by a handful of Googlers, JavaScript was effectively unmanaged at the STDLIB level for a crucial decade, and now it can’t recover. (I’d also guess that having to write a module system that works well in the chaos that is Web clients and simultaneously the Unix world is a daunting design problem.)
8. Python got lucky that data science took off.
[1] https://ospo.gwu.edu/python-wasnt-built-day-origin-story-wor...
spenrose
5 hours ago
I forgot two, er, three:
9. Python got lucky that its inevitable screwups (Python3) didn’t quite kill it.
10. Swift and Kotlin both define programming as serving the compiler (specifically LLVM) rather than serving the coder’s problem. (I haven’t discussed Rust so far since it isn’t attempting to compete with 98% of Python use cases, but if you squint you can see it as going one step further than Swift and Kotlin and in effect forcing the coder to be a sort of human compiler who thinks in types and memory management. This is not a criticism of Rust, BTW.)
0. And behind all of this is Moore’s Law and the demographic explosion of programmers. Python was an implicit, perhaps unconscious bet that if you served people thoughtfully, the tradeoffs with serving the needs of contemporary silicon wouldn’t matter as much.
spenrose
4 hours ago
I can't stop thinking about this. WRT Perl specifically, it’s fascinating how the two competitors adopted Unix shell patterns. Python is handicapped to this day by not automagically snarfing up environment variables, etc. But Perl leaned hard into TECO-style gibberish and the meta-syntax that is regular expressions, confronting beginners with arbitrary complexity. It feels like Wall embraced the system administrator side of coding — the side that has an enormous capacity for tracking corner cases and managing impedance mismatches. Wall was trained, perhaps not coincidentally, as a linguist, a field where continent facts really matter. Guido, on the other hand, was an accomplished mathematician. (This is the Dwarf / Elf distinction from Cryptonomicon.)
qcnguy
2 hours ago
Kotlin didn't target LLVM at all when it was designed, that feature came much later. The primary target for Kotlin is and always was the JVM. And Kotlin was designed with usability in mind from day one, that was the justification for it. Weird to say Kotlin define programming as serving the compiler. The compiler bends over backwards to serve the user.
spenrose
2 hours ago
Thank you for the correction
bb88
2 hours ago
Rust isn't so much "competing" as it is "complimentary" to python. This is very much how python was billed originally as a scripting language for "C" in it's early days.
The slow parts of your python program can be rewritten in rust or C, your choice. So refreshing.
LexiMax
4 hours ago
I feel like if #1 was done today, there is no way on god's green earth that whitespace would be used for code blocks.
It is far and away the most common footgun novices run into when I'm answering questions about why their code doesn't work.
zahlman
3 hours ago
> It is far and away the most common footgun novices run into when I'm answering questions about why their code doesn't work.
It was, in my experience, before Python 3 clamped down on mixed spaces on tabs; before the `SyntaxError`s got better (for example the handling of `try` without `except`); and before VSCode got so popular (such that all the novices were using who-even-knows-what random editor and you had to figure out every time how they were actually producing the indentation, whether it does/can convert tabs to spaces).
And, oddly enough, before LLMs. Not so much because they explain anything all that well, but because lazy clueless people now get correctly indented code generated in-place rather than copying and pasting from Stack Overflow and not having any clue how to make the pasted code line up properly.
But now I far more often see people who are clueless enough that they can't distinguish the REPL from a command line ("why is `pip install ...` a syntax error?"), or are struggling with whatever is the latest attempt by the Python team to make Python easier to install and manage on Windows, or who seemingly can't wrap their head around the idea that Python has to know where on disk to look for the installed libraries (or why it won't work to just put everything in the system environment). And in terms of the language itself, probably the biggest stumbling blocks are things like command-query separation ("why can't I `foo.append(bar).append(baz)`?") and just using functions properly (which typically boils down to "why doesn't `return foo` let me refer to `foo` in the calling function?", but generally stated completely differently).
scoofy
2 hours ago
My background is philosophy of language. I studied formal/mathematical logic in grad school. I was always embarrassed that I couldn't code, but the computer sciences classes were teaching languages that were inscrutable for someone even with my background, with syntax heavily focused on jargony math and technical concepts like object orientation (likely java at the time).
Around 2010, I was talking about this with friend about this failing of mine, and he said "you should try python, I've heard it is popular with non-math folks." So I bought a book, and as soon as I opened it, I could just read it. It took me a couple days of reading to wrap my head around object orientation, but on the functional side, I could have written fizz buzz like, maybe half an hour after opening the book.
Humans have logic pre-built into our brains, it's just that we use natural language as our syntax. Python cleverly used as much of the natural language syntax as was practicable to remove the barriers to entry for non-math majors. Whitespace is perfect example of a natural language syntax feature.
tim333
3 hours ago
#1 helps make Python maybe the most readable language which is probably more important than some minor hassles formatting it.