24,628 karma · joined Oct 21, 2019 (7y ago) · 5,512 submissions
https://www.bitecode.dev/
Email: contact at bitecode.dev
comment 5y ago · link · parent
If I spend 20 minutes, I will just produce BS. If I invest more time and energy, something good will come out.
When I was a kid I always assumed everybody was the same: you could always express what you had in mind. Took me years to realize not only it's not the case, but most people actually don't use words for their meaning at all.
Once I got that, my oral communication improved tremendously, but writing stayed mostly the same. Oral can be messy, sometimes it's even better than way. On paper, though, being clear is a virtue.
And if you can't be clear from the beginning, just babble until your brain gets in the flow, and you'll get to something eventually. Then strip the useless part, clean up the good one, and you got a winner.
comment 5y ago · link · parent
But the process is the same, at least for me.
I assume other people do it differently, but the point is, writer's blocks seems alien to me. As long as you are not in a coma, I don't see how your mind cannot come up with something. And as long as it can, something worth committing too can be found.
It's not like sport when you have an actual physical limitation. You brain is literally a machine to produce ideas. It does that constantly, in mass.
Everybody has it, because everybody have weird dreams when they sleep.
comment 5y ago · link · parent
The good old advice of "just start writing" is easy to follow when words flow naturally.
And it works.
comment 5y ago · link · parent
It's easier to filter than to shape. And easier to shape something already filtered than shaping from a blank page.
Also, not all writing have to be good. A lof of them already have value if they are not bad.
After all, writing for the purpose of writing is a beautiful endeavor, but writing for sharing information is a great in itself, and a perfect but non-existing reference will always worse than a dry but at hand paper.
comment 5y ago · link · parent
I can write 10000 words on the spot on any random word picked out of the dictionary. Even a one I don't know at all.
Friends loved to test me on this, picking up some BS topic and see if I can come up with a scenario or a song. Then after a few minutes of my rambling they get bored of course. Having something to say doesn't mean it's interesting.
My problem is rather to learn to shut up about things and accept it's usually wiser to not have an opinion on most things.
The vast majority of words do not need to be spoken or written, but it's hard to do for me.
Case in point: was this comment worth writing?
comment 5y ago · link · parent
Mostly, resources.
Giants spent their energy speeding things strategically:
・ Google wanted Chrome to win, so they spend their effort on JS.
・ Facebook was a PHP shop, so they worked on make it fast.
・ MS had to promote .net, so they optimized c#.
Now you also have to remember that:
・ it's a hard problem
・ python is not a performance oriented language, so it was not a priority
・ when data science became popular, c-extensions were usually enough to get the perfs you wanted
・ once you have a working python code reaching perfs limit, you could start a rewrite in a fast compiled language (Google did it with go, dropbox with rust, etc). But this could take years before you need it. Youtube ran fine on PHP then Python for almost a decade. Python can take you very, very far. In fact, I'd say half the time somebody says python is too slow for them, it's because they are doing something wrong. Case in point, I have a half-million users/day streaming website running on Python. It's been running for 10 years, and needs only one dev to maintain it.
・ the PSF had no money (https://pyfound.blogspot.com/2012/01/psf-grants-over-37000-t...), and most work on python was from people on their free time. Very few paid devs on Python for decades, compared to other languages
・ there are actually a lot of improvements on tooling for perfs on python. Multiprocessing have fantastic pools and shared memory. We have asyncio (not to mention uvloop). c-extensions release the GIL, so you can use threads for parallelism with numpy. Most people are just not aware of it.
・ Python is very old, 4 years older than java. It has been design way before multi-core laptop were a thing. And so the GIL is everywhere.
・ python is in a very unique position: it's the second best language for anything. Meaning it's been used by data scientist, web devs, geographers, sysadmin, pen testers, os maintainers and biologists alike. They all have very different tooling, dev envs and workloads. Speed doesn't mean the same things for all of them. E.G: a slow starting JIT that speeds up a web server would destroy the use case for cli tools. Mercurial has not computational speed problems, but import time is killing it. But lazy imports would make debugging and new comers learning curve harder. What if they speed up things for them, but slow them down for you?
・ 2->3 made the entire community change averse. And to get speed, you need to break the C api somehow. Hence the Handle Python project.
So the previous attempts to speed up Python were by either interns, or people doing it out of passion/curiosity. A lot failed (unladen swallow, pyston1, etc). Some were successful but only for some dimension of speed and/or doing some compromises (pypy, stackless...). Some are still WIP (Pydgin, pyston 2..). The solutions that succeeded the most are actually side stepping the problem (cython, numpy, numba, dask) but usually became popular although some very good projects still deserve more light (nuitka, mypyc...)
It's only now that Python is becoming such a huge deal that MS hired Guido to work on general computational speed for cPython. Now that there is attention, money and dedication on the problem, you can already things moving in the bug tracker (coroutine unwrapping, c stack skipping calls, HandlePython, etc). It's going to take time. Millions have already been invested in V8 to make the JS slug go steroid, so catch up is not for tomorrow.
> What I meant is inline. So inside of a py file, you can rewrite the one function which you identified as the bottleneck. In C or another language.
You can already do that with cython. And there are alternative for rust, nim, go...
That's also why python speed is usually not a priority: you can rewrite your hot spot in another language and keep most of your python code.
Now, I'm glad python speed is now something the right people work on. But there were very good reason it hasn't happen until now.
The way you say it, it feels like "wow, nobody has though of that before!".
That's not what happened.
comment 5y ago · link · parent
I'm not anti-vax, I've had dozen of vaccines including covid, but I still think anti-vaxers should be able to express themself. Who knows, one day I may realize some doubts were justified.
comment 5y ago · link · parent
The idea is that the python code interpreter would not rely on global variables anymore, so that you can instantiate it several times.
The GIL is tied to the interpreter, meaning 2 threads in 2 different interpreters do not share a gil, and can be schedule on different CPU.
comment 5y ago · link · parent
That's why diskscache is better as an alternative for complex objects: https://pypi.org/project/diskcache/
It's not as good as a simple shared variable, but it's surprisingly performant, since it uses memory-mapped files.
comment 5y ago · link · parent
Threads in Python are mostly useful to avoid blocking:
- you need to make io calls and don't want to bring asyncio
- you need to process things in the background without blocking the main thread (e.g: zippping things while you use a GUI)
- you want to run a long process on a c-extension based data structure (they release the gil, so you get the perf boots), such as a numpy array or a pandas DF
comment 5y ago · link · parent
Parallelism strategies in Python usually revolve around using the multprocessing module, a c extension (numpy will release the gil, and hence all the science stack) or using a 3rd party tools (dask is pretty popular, and allow easy parallelism: https://dask.org/).
comment 5y ago · link · parent
If you want to share low level memory between process, use SharedMemory: https://docs.python.org/3/library/multiprocessing.shared_mem...
If you want to share high level data structure between process, use diskcache: http://www.grantjenks.com/docs/diskcache/tutorial.html
This is, granted, not as straightforward as just sharing a variable between threads, but it will get you far.
comment 5y ago · link · parent
When IE6 became the engine mono culture, it was the best.
But then it stopped innovating, because it didn't need to. It also pushed moves that were only for the good of Micorosoft, since they had monopoly, trying to make the web a less open place.
It was a pain to develop for, a pain to debug, and a capricious master.
Google has shown they can be very naughty as soon as they got power over something.
Learn from history. Do not give them that power.
comment 5y ago · link · parent
Regularly, on imgur, you see a pic in interest for a celebrity, a rich person, a movie. It looks organic, but if you look closely, there are plenty of weird things about it. Then it disappears as suddenly as it arrived.
I believe that they sell the front page to PR firms that need to promote something in a way the people think themself came up with the hype.
It's probably the same for a lot of communities with a strong influence on trends, like popular sub reddits or hacker news.
There is no better ads than the one you don't see. There is no better slogan than the one you repeat to your friends as a catchphrase. And there is no better propaganda than the one based on ideas you thought you had by yourself.