"But calibrating that response raises questions of principle, practice and priority. Businesses will go their own way. Some, such as PayPal, Visa and MasterCard, which handled donations to WikiLeaks, and Amazon, which provided web-hosting services, have dumped it as a customer in response to American outrage. More may follow. They risk attacks from its fans, just as those that refuse face hostility from their customers in America. Too bad: business is full of hard choices."
Every single time there’s a HN discussion about censorship and I comment about how we shouldn’t be okay with censorship of anyone regardless of how offensive they might be or whether or not it’s some private corporation and usually it gets downvoted.
When the wind starts blowing the opposite direction, only then do people wake up.
No, they demand a principled balance between the two freedoms, that's independent of the content of the speech. What you're talking about is what's status quo - freedom for private businesses to not serve someone, except when it contradicts certain narratives, at which point it becomes a national news story about bigoted business owners.
Saying the balance should be predicated on ignoring the content of the speech makes sense only if speech itself was a pure function without side-effects, only if saying something truly had no other consequence than it being said can we safely ignore the content.
But the precise content of speech is exactly the part that matters! If a death sentence is read out aloud in verse, or just sent in via a short text message (that is via two very different types of speech) is clearly not very important if the end result in either case is an aid worker being blown up with a Hellfire. Speech very often triggers actions, to ignore this fact is to state nothing may be prevented because judgment is only possible by examining actions committed to reality.
The "balance" is based on something that, while explicitly stated, you somehow disregarded: that some--and, by and large, the current legal landscape--considers the freedom of speech right of the platform to censor people, and so to obtain "anyone can say anything" we have to take away "the freedom to not say something"... which we actually already do in various instances (often involving protected classes) and so, personally, I consider that to be a tractable goal to regulate: some things are "utilities" or even "quasi-governmental entities" and should be forced to be something like a common carrier.
So, if i would manage to besiege the city of rome, conquer it and declare the forum romanum mine, and to throw out all the romans. Does that make writing "Romanes eunt domus" an act, that forbids you forever the usage of my conquered streets? M i the conqueror allowed to sentence a citizen to house-arrest, by defining social negative space?
Social media companies which are actively working with the government to censor opposing view points while also enjoying legal immunity from lawsuits. You think there’s a fair balance of “freedom” here? Should telecom/electricity/railroads also get to ban whoever they like? Did you support net neutrality?
Most likely they just `assert` error conditions and let that blow up as error reporting, rather than write a full conditional and raise a custom exception.
I’ve been guilty of that in my own code when I just want to tell myself about an error.
With asserts enabled this is fine. With asserts disabled you might start sending nukes while the president is still outside or the doors to the bunker are still open.
"-o" is mostly "--remove-assertions" already, so that wouldn't help.
While today's use case for assert is unit testing, the actual killer feature of the keyword is that it's removed only from prod.
The idea is that you can write things like function contracts, that are expensive, but only exist in dev.
Now, if one of you dependencies use assert for something they expect to still be in prod, which is the problem we are talking about in the first place, "-o" or "--remove-assertions" will strip their assert too, breaking their code, and hence, yours since it depends on it.
Before this thread i had no idea assert was debug only in python.
Another solution would be to accept the current role of assert as quick error checking and add in debug_assert to indicate a conditional error check. The biggest issue with that approach is that a majority will suddenly ask "Wait, python has a debug mode?"
I still do not understand what the problem is and what users need to know. So assert throws and exception in debug mode and is 'commented out' in production, right?
So the problem is some vendors ship libs that have failing asserts so cannot run in debug mode?
It's pretty well done, I almost forgot I was in my shell, and when the games gets to "tree to map the dungeon", I was almost surprised I didn't think about it before: I felt like playing a game, not coding in bash :)
It's fun and probably useful, but Python is not 30 times slower than lua (from 33s to less than a sec).
The 2 codes don't do the same thing, if you perform the same computation on the python code (monochrome mandelbrot, inline loop, 49 iterations, etc), you get 0.8 vs 4.8 sec, which seems about right.
I've removed numpy since it's cheating if we compare raw language perfs:
So yes, Python is about 6 times slower. Significative, but can be worth the compromise if you consider the Python version is much, much easier to read.
And of course, a vectorized algo would be even faster (see pbourke's comment).
What's more, with SharedMemory from 3.8, you could speed that up even in pure Python using multiprocessing by sharing efficiently the array.
Those those who wonder how it can make it faster since it's using threads and Python has the GIL, numpy releases the gil while doing computation, so thread can actually use multiple cores if you speed most of your time in numpy world.
For this code we can also easily try the process executor instead of the thread executor - then we avoid the GIL. In this case, it has an approximate 10% performance penalty, probably since we have to serialize data back and forth, can't share memory.
If you use a data structure that supports the buffer protocol (such as a numpy array), you won't even pay a serialization cost.
Python has made a LOT of progress, concurrency wise. Between asyncio, process pools, threads releasing the GIL and shared memory, you can get much perfs with the stdlib alone.
Then of course you have Dask if you need more later.