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
The JIT effort is great, but projects like mercurial had to hack lazy import because they are so slow in python.
I wish this can be baked in the language some day: loading half the stdlib to run hello world is not very efficient.
comment 5y ago · link · parent
Half of the popular projects around JS are indeed created to workaround its deficiencies, or the JS DOM API limitations.
But working with JS, thanks to those efforts, is now much more agreeable. And the language itself has evolved in the right direction.
comment 5y ago · link · parent
I'm guessing that you actually need to know Nix to be able to use it, which kinda defeats the "usable for non-technical users" goal.
I can see the value of it, if I ever learn Nix, and want a quick way to make modifications without having to google every possibilities.
comment 5y ago · link · parent
Especially, modern Firefox is wicked fast, while just a few versions before, it was less so. The difference is _staggering_.
I think there is a space for add ons to setup Firefox to be more privacy focused. It's easier to maintain than a fork: compiling on so many targets such a huge software is very hard.
comment 5y ago · link · parent
Now you can say it, since people have been burnt enough to admit it, but ironically it's actually less true.
Yes, the JS language is always hackish. The stdlib sucks and the ecosystem is a Jenga tower. A lot of JS projects are still what I call "disposable code bases".
But.
Modern JS is tolerable. Functions are now decent, you have let/const, map/filter... There are even some nice things:
• spread and destructuring, and they play well with the limited data structures.
• simplest async paradigm ever: immediate schedule, and returns a Future, may attach a callback or prefix with await.
• concise arrow functions.
• ? and ?? operators. I actually miss them in Python.
Tooling has improved tenfold:
• VSCode gives you good code intelligence out of the box.
• any build tool will solve imports, scoping, "this" weirdness, browser compat, etc.
• new gen builders, such as ViteJS (or anything based on rollup/esbuild), are fast, reliable, and have sane default. No more webpack trouble.
• new gen packagers, such as pnpm, are fast, reliable, and save a ton of disk space. No more "takes 10 minutes, download the entire internet 3 times".
• with VueJS (SPA), htmx (ajaxify Django, Rails, Laravel...) and petite-vue (progressive enhancement), front end dev is almost fun. And light.
• Typescript.
Now, I still avoid JS if I can. I don't like having to google simple things like type coercion or how to left trim a string.
As soon as I can go Python, I do so. It's hard to beat Django or FastApi for the web, Typer for scripting, pandas for data analysis, pytest and robotframework for testing, or just the stdlib/pypi.org for pretty much everything. And with shiv and nuitka, deployment is now on a different level.
But when I have to use JS, I don't dread it anymore.
comment 5y ago · link · parent
In fact, I think we don't make enough noise given the few people outside of our bubble that knows about it.
comment 5y ago · link · parent
If you want something older and with a similar api (wrapping argparse), using only the stdlib, I can ask the same question with argh, which already worked in python 2.6.
So why write another one?
comment 5y ago · link · parent
7
But the question is rather, whats the cost / ratio ? The 7 servers costs 7 less times money that they bring. The solo dev makes $150k/years with it, and doesn't need to work full time, have flexible hours and its own business.
> How many pure python libraries did you have to replace with a Cython extension after you realized that it cannot support your scale?
Many. Being extensible with compiled extension is a feature of Python. Numpy and co are part of the ecosystem. That's an awesome thing about it: I can code in Python and get c speed anyway.
> •How many external dependencies? How many of them did you replace after they were abandoned? Surely not all actively developed library are still using Python2.7.
Many. And the project still runs, with so little resource, bring the money in and serve its purpose, after 10 years of service.
> So he cannot upgrade the project to Python3.x along with all matching dependencies either, So the project stays with all bugs and vulnerabilities.
Sure he can, it's just an expense he won't do. Bugs are workaround, vulnerabilities are shielded by other parts of the system. Essential things like injections are dealt with. Some trade off are made, like always.
> So only Google size is a benchmark for scale? If I were to start a web project which has just 10 concurrent users I would choose Go because I know I can develop the entire project with little to no dependencies,
No you can't. Not if you want the first version to come out in a few months. Because you need a scrapper, and a bdd, and registration, and auth, and permissions, and screenshotting, and upload, and videos encoding, with background tasks, and load balancing all the videos and pics, tagging, i18n, xss protection, and search, etc. So either you pay to use cloud services to do all those things for you, or you leverage a rich ecosystem. Or you take a year to do it. Even if Go were the best language in the world, it can't beat 10 years of django plugins, 25 years of python modules and the iterative speed of a dynamic syntax. Well, it can, with AWS :)
In fact, Go is a very niche language. If you take it out of the I/O and concurrency specialty, it's quite average. Rust is better at raw perfs. At same perf, java has a better ecosystem. For simplicity and easy compilation, you have nim and zig that are more expressive. Resilience ? Erlang. And for speed of dev, python is better.
So for our use case it is not were it would shine, because:
> it can scale to N users without touching the code and with the confidence that the number of servers required will be < than that of python.
1 server only run the python code, the others are for the video hosting and the db. Python is not the bottleneck in this site. It almost never is in web dev. nginx serves the content, postgres and redis deals with the data.
comment 5y ago · link · parent
There is also the stdlib. JS doesn't have simple things built in like left trim a string, csv loading, uuid generation, etc.
Then there is the API. Sorting in JS requires this weird -1/1 function. Getting the last element or truthiness to manipulate length.
Suddenly not only you have to install tons of things, but libs and frameworks can't rely on a common ground, nothing seems to integrate well. You glue a lot of things manually.
The popularity of JS is because it has a monopoly on the browser, and so a lot of people must use it, and a lot of users know it by default, and look for it elsewhere.
But when you have Ruby, Python, or even modern PHP frameworks in front of it, it's not a great deal.
Of course, not all programming tasks are about the Web. And this is where JS collapses completely. Sysadmin, data analysis, pen testing or automation using JS is a pain compared to the fluent versatility of alternatives. You know, things like connect to this ftp, download the excel files every hour, put the average of every column in the mysql db then export the thing as a PDF and send that to the boss.
comment 5y ago · link · parent
Because I have a 1 million unique users video streaming service still running python 2.7, using a few servers. The thing has a mobile version serving a different media on the fly, encodes user uploaded videos, features comments, tagging, and even has machine learning detection of content now.
It is still maintained by one single person, and he is not a professional dev.
And I'd say it's already very rare to reach that size in any project, in any company. Hell my last 3 paid projects as a freelancer have less than 20 concurrent users. And that's professional. That's people's real life.
2 out of 3 IT projects fail, no code is even shipped. I would worry about the scaling later. Once you do have the problem, pay the price for more hardware or a rewrite, you made it!
And if you do know for sure you will have the problem (you already work for a GAFAM), then not choosing python is ok, it's not a trap, it's a trade off.
But for the vast majority of us out there, having an easy, solid, battle tested and clean language with a huge ecosystem is worth a 10000 times more than some scaling potential in 5 years down the road.
I have seen so many big C++ or Java project fail I don't associate any language with big and failure anyway. I've seen devs arguing about the purity of this in Haskell, or that in Ocaml, and nothing gets to the end user because it's never perfect, or it's a toy, and doesn't handle IRL.
But what powers most companies ? Rail apps that you won't upgrade ever, but are still running. Spaghetti PHP code and wordpress that just won't dies. Horrible SAP scripts, VBA macros and excel sheets that actually deal with your real data.
Because they shipped. They did the job.
comment 5y ago · link · parent
- speeds matters of that level matters only for a limited number of use cases. Most programming use cases are fine with python speed. They were fine, in fact, with it 20 years ago, before we got that hardware speed.
- people are starting to complain about speed in python only because of all the data science going up. Suddenly here speed matters. Before, you had to get to google level of infra to find use cases where python was too slow.
- dev are expensive. Hardware is cheap. If you have a slow website, paying $200 dollar more on your server is not a big deal. But taking 3 more month dev that features with your $300k pro is another thing entirely.
comment 5y ago · link · parent
Installs are now an scp.
Now of course, you gotta remember that installing something is usually more than copying the code, and there is nothing to help you with that, in any language.
Welcome to the world of deployment, which is why things like ansible and docker exist.