Earlier quoted context omitted.
Greenspun's Tenth Rule[0] Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. - Philip Greenspun [0] https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule
How would you subvert Greenspun in large codebases without Common Lisp? I once used Drools the rules engine which used a dynamic scripting language on Java objects. Python could have replaced that language, with much better tooling, errors etc.
What's Coming in Python 3.8
501–510 of 558 posts
Re: What's Coming in Python 3.8
#502To me, the headline feature for Python 3.8 is shared memory for multiprocessing (contributed by Davin Potts). Some kinds of data can be passed back and forth between processes with near zero overhead (no pickling, sockets, or unpickling). This significantly improves Python's story for taking advantage of multiple cores.
Isn't that already the case? I thought that when you use multiprocessing in Python, a new process gets forked, and while each new process has separate virtual memory, that virtual memory points to the same physical location until the process tries to write to it (i.e. copy-on-write)?
E.G: live settings, cached values, white/black lists, etc
Re: What's Coming in Python 3.8
#503Have there been any performance benchmarks done on Python 3.8 yet? I'd be interested in seeing how it compares to 3.6 and 3.7, but haven't seen anything published.
I think that the most important thing Python can do in each release is to improve performance, incrementally.
Re: What's Coming in Python 3.8
#504Earlier quoted context omitted.
That's more than I was aware of, but I would hardly call 90% of those "prominent". Sorry to any fans of those languages, but I doubt even most people here on HN have even heard about over half of the languages in that ":=" list.
If someone is not, not a user, but familiar with ALGOL, Simula, Pascal, Modula, Ada, PL/M, Smalltalk, Eiffel, and Oberon, they should not really promote their programming language ideas as relevant... The fact that they use some "new languages" (e.g. whatever derivative stuff happens to be in fashion atm) and are not even aware of the debt of those languages to the list above, doesn't qualify them...
Re: What's Coming in Python 3.8
#505Earlier quoted context omitted.
“I've come up with a set of rules that describe our reactions to technologies: 1. Anything that is in the world when you’re born is normal and ordinary and is just a natural part of the way the world works. 2. Anything that's invented between when you’re fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. 3. Anything invented after you're thirty-five is against the n…
This 'resistance to change' catchall argument puts everything beyond criticism, and it can be used/abused in every case of criticism. It seeks to reframe 'change' from a neutral word - change can be good or bad - to a positive instead of focusing on the specifics. Anyone making this argument should be prepared to to accept every single criticism they make in their life moving forward can be framed as 'their resistanc…
Re: What's Coming in Python 3.8
#506Earlier quoted context omitted.
Check out https://speed.python.org/comparison/ . It’s not significantly faster, but it’s getting more so.
I don't know how to say head-to-head more than this graph https://speed.python.org/comparison/?exe=12%2BL%2B3.6%2C12%2...
https://speed.python.org/comparison/?exe=12%2BL%2B3.6%2C12%2...
Re: What's Coming in Python 3.8
#507Earlier quoted context omitted.
The unix philosophy of simplicity was on a per tool basis, not function or line of code. The walrus operator is Python version of what we can do now in C or in JS, doing plain assignment in an expression while evaluating it for truthiness. And more often than not, the point of that single-purposeness in Unix is so you can chain a bunch of piped commands that result in a perl-like spaghetti command that's three termin…
> while evaluating it for truthiness no, it evaluates to the left side's value after assignment
Re: What's Coming in Python 3.8
#508Earlier quoted context omitted.
Forewarned is forearmed. I headed into adulthood watching out for such mirages. For example: Making sure to listen to pop music enough that it does exactly what pop music is supposed to do (worm its way into your subconscious) so I don't wake up one morning unaccountably believing that Kylie Minogue was good but Taylor Swift isn't. My understanding of Python will probably never be quite as good as my understanding of…
How do you know to listen to Taylor Swift or whatever? In the last century it was easy to be in sync: you could just watch MTV. Is there something keeping the notion of pop coherent these days?
I’d argue it’s easier now to stay in sync than even when MTV was popular. MTV you needed a cable subscription and be sitting at a TV, now SiriusXM or Apple/Google/Spotify can stream it right to your phone laptop or tablet, and regular FM radio will play it on the local Top 40 station.
Re: What's Coming in Python 3.8
#509Earlier quoted context omitted.
I disagree this python version is as readable and here’s why. It’s about as many characters but more complex. The Kotlin version performs several distinct actions, each being clear to its purpose. These actions have the same syntax (eg requires less parsing effort). The Python version mixes at least 4 different language syntax/features, being list comprehension, if special form in the list comprehension, keywords, an…
It's surprising to me that there are people who disagree with my opinion about this, but it suggests that my familiarity with Python has damaged my perspective. You're clearly much less familiar with Python (this code doesn't contain any list comprehensions, for example), so I think your opinion about readability is probably a lot more objective than mine.
It does contain a generator expression though, which is the same as a list comprehension in general structure, but slightly more confusing because it doesn't have the relationship to lists that square brackets in a list comprehension would have given it.
Re: What's Coming in Python 3.8
#510Earlier quoted context omitted.
This completely contradicts the rest of Python grammar, and indeed many languages’ grammars. The consistent way would then be `while x < 10` but that too looks ridiculous. The issue is that you can’t have post-clause syntax in Python due to its infamous spacing-is-syntax idea.
I'm not sure why the consistent way looks ridiculous. do: body() body() while x It's just a compound statement consumes the trailing while clause. Decorators already precede a function (or class) definition[2], and one alternative for the ill-fated switch statement[1] was to have switch precede the case blocks to avoid excessive indentation. So there's plenty of precedent in the other direction. [1]: https://www.pyth…
My main gripe is the indentation. Your code reads as if the while condition is tested after the loop finishes. What if the while statement was part of the loop and could be placed arbitrarily?
do:
body1()
body2()
while x
IOW `do:` translates to `while True:` and `while x` to `if not x: break`.Addendum: I would also entertain forcing the `while` to be at the end of the loop -- as I'm not sure what this would do
do:
if foo():
while x