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
comment 5y ago · link · parent
It works out of the box, is uber fast, support Vue + React and does everything webpack did for me.
I stopped thinking about my tooling and could go back to spend those CPU brain cycle on solving my clients problems.
Peace of mind.
Thanks Evan You.
comment 5y ago · link · parent
I worked for a client that had this wonderful Python dsl that compiled to Verilog and VHDL. It was much easier to use than writing the stuff the old way. Much more composable too, not to mention tooling.
They created that by forking an open source project dating back to Python 2.5 that I could never find again.
Imagine if that stuff would still be alive today. You could have a market for paid pypi.org instances providing you with pip installable IP components you can compose and customize easily.
But in this market, sharing is not really a virtue.
comment 5y ago · link · parent
I myself have coded a streaming platform getting half a million user every day in Python. Baring the CDN to store the content, it runs on 2 servers, one for the DB.
So real things get done in Python pretty well.
comment 5y ago · link · parent
import random
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
def hello(seconds):
print(f"Starting hello in {seconds}s")
time.sleep(seconds)
print(f"End of hello in {seconds}s")
return seconds
# At the end of this blocks, it automatically join() and clean
with ThreadPoolExecutor(max_workers=2) as executor: # 2 tasks in parallel max
# this send jobs to threads via safe queues
a = executor.submit(hello, random.randint(0, 5))
b = executor.submit(hello, random.randint(0, 5))
# this collect results from queues in order of completion
# sync is automatic
for future in as_completed((a, b)):
print(future.result())
And if about network I/O only, you can get even more perfs using asyncio.Threads in Python are only inferior to Java threads when it's about using several CPU.
comment 5y ago · link · parent
- you need a GUI
- you need perf beyond what Python is capable and you identified it clearly in advance
- you can't use numpy / multiprocessing / cython, pypy or they won't give you the perf you need
- you can't find a main hotpath you can optimize with a 5 lines c or rust extension and write 99.99% of your app in python. Or you don't want to bother.
If you ever find yourself in this very use case, then yes, use Java.
But I never found myself in this very precise use case.
comment 5y ago · link · parent
The cryptography module in Python is awesome. lxml and sud deals with XML and Soap in a blink.
Modeling large business concept is a joy with dataclasses, and the language will never be the perf bottleneck.
Now I understand that if you are experienced with Java, it would solve all those problems perfectly.
But again, I would not, personally, gain anything by using it for this.
comment 5y ago · link · parent
It now has 2 dependencies. It is a 1000 times easier to use than hibernate, despite being one of the worse ORM in Python.
That the problem with old Java libs like Swing or Hibernate: they have been designed for the 90' and don't leverage the potential of what a modern Java version can do.
comment 5y ago · link · parent
2 - You assume they knew about it. It's a lot of work to create FOSS, it's very easy to miss those things given the huge amount of information you have to check for compat and security. Hell, I certainly don't assume my main dependency, which is a rock solid language no changing the major version and used by millions is going to break my project. I don't read each line of each changelog of each version upgrade of each of my dependency.
3 - Even if they knew about it, they may never have realized it would have broken something before people told them so.
4 - They may even have noticed, 3 years ago, but forgot about it. It was 3 years ago!
It's only human. It's FOSS.
comment 5y ago · link · parent
It was necessary for the things that are were not easy to do without breaking compat such as unicode, fixing comparison bugs, etc.
Now none of the stuff that broke compat in 3 after the initial release were things that were necessities. They were goodies. You don't need make from __future__ import annotations as default. You don't need to make async/await keyword.
comment 5y ago · link · parent
Pyinstaller builds bundle the python binary with the project. It works without a Python installed on the system, is not portable and the resulting binary is fat. It also can fail in numerous way and be slow, but end users will find it the easier to use when they work.
Pyz files just contains python code. Shiv produce them by bundling your code and the dependencies, but you still need a Python installed on the system to run that. You pay the cost of zipping only on the first run though, after that, it's unzipped. And their are portable if you use no binary wheel. It's light and easy to get right.
In that sense, they look more like War files in Java.
Pyinstaller, like cx_freeze and nuikta are for end users.
Pyz are for devs.
comment 5y ago · link · parent
The 2 to 3 transition was hard because we did an abrupt cut. We could have had few transitioning versions that supported both worlds, then disabled the old ways but with a switch to put them back on if needed for a while, and allow for a more peaceful transition.
comment 5y ago · link · parent
But there are strategies that are in used or have been in used that we could draw inspiration from:
- async/await didn't need to become keywords so fast. True/False were not for 15 years.
- changing the default encoding is behind env var flag.
- changing the way the c api is done is currently made doing the separate HPy project. It's not breaking anything.
So there were instances where people intelligently decided to move the language forward, but stopped and remembered Linus wisdom of "we don't breaking userland". And they did improve things without breaking others.
Guido used to be very strict on that too. But after so many years, we can't expect him to spend all his energy still policing every aspect of the project, especially after he stepped down as a BDFL.