Better HN
topnewbestaskshowjobs
Log inSign up

BiteCode_dev

24,628 karma · joined Oct 21, 2019 (7y ago) · 5,512 submissions

I write to save you time and effort when dealing with Python:

https://www.bitecode.dev/

Email: contact at bitecode.dev

Submissions

comment 10mo ago · link · parent

While it's true that the exposure of top European firms can be often 50%+ of total revenue from U.S, that:

- Doesn't make them non viable without the American market, just less rich.

- Doesn't reflect the 5 to 10 times higher price Americans pay for the same drugs.

You can have a healthy industries with plenty of billions to be around and have decently priced drugs.

What you get in the US is uber profitable industries and people scrapping around.

comment 10mo ago · link · parent

It's a very charitable explanation.

My experience with the people around me who are in this situation is rather either:

- They just don't care. Society and others are not on their radar.

- They don't think it's that bad.

- They think it's not great, but the benefit is too good so they ignore the voice at the back of their head. Or they have a lifestyle and that takes priority.

- They think it's bad, but the friction to live according to their own moral view of the world is higher than their desire to adhere to such a moral view.

When I was 20, I declined interview offers from Facebook and Google. Huge opportunity cost. My friends looked at me like I was dumb.

I have friends regularly coming to me with ideas that are about spamming, selling personal data or basically fraud. They don't see a problem with it.

When you talk to people and say "advertising is basically normalized lying at the scale of the entire society", people just give you a blank stare.

There is no need to look for coercion every time you see something bad to explain it. The human population is diverse and they all draw the line of what's acceptable in different places.

It's not rocket science.

comment 10mo ago · link · parent

This is not like IT where the Americans are completely dominant and clearly superior.

The European pharma companies are doing more than fine, despite their main market being heavily regulated and price-controlled.

The less charitable explanation is that US companies want to charge outrageous prices, and the American system let them to, so they do it.

That's what the USA are: a machine to prioritize profits over people. Sometimes it turns out fine, like for the startup scene. Sometimes it's terrible, like when lives at stake.

Other explanations sound like heavy copium to me.

comment 10mo ago · link · parent

Can you tell us more? Espacially, how does they both fair with auth.

comment 10mo ago · link · parent

Why, because it's free?

comment 11mo ago · link · parent

At least one worker for each virtual cpu core you get for CPU. I got 16 on my laptop. My servers have much more.

If I have 64 cores, and 20 dependencies, I do want the 20 of them to be uncompressed in parallel. That's faster and if I'm installing something, I wanna prioritize that workload.

But it doesn't have to be 20. Even say 5 with queues, that's 100ms. It adds up.

comment 11mo ago · link · parent

And kill many apps, maybe even OSes.

When most of what a user can do can be done from one single UI, the low friction will win.

And since all the data must be sent to the service, and that a super intelligent AI analysis all this data, the spying that is already considered outrageous today will reach unprecedented level.

Now, associate that with the fact the last year people in charge of said systems kissed the ring of the power that be in the most disgusting way. Add what we learned about surveillance from 3 letters agency.

You get your dystopia. It's not an if now. It's a when.

We need to solve that problem now. Once we hit it, we will lose the ability to solve it.

And I'm not sure where you could go on earth to escape it.

comment 11mo ago · link · parent

The golden rule to understand the success of uv is to remind yourself how big and diverse the python community is. Your context is only a tiny fraction of the contexts in which python is going to be executed.

E.G: if you compare it to your machine, it's a different thing that if you compare it to a locked down corporate machines.

I have clients that have Python setup so bad installing all deps for a project takes... 18 minutes. Those are not crazy projects either. It's just the context that is bad. And you won't be able to change the context. But we are in talk to change the package manager to uv.

There are so many different setups that are different than yours. If you are a professional trainer, and you get a new group every week, having 12 people installing their env in a blink is a win. If you are a researcher and you want to download the top 100 pypi packages and attempt to install them, speed is a bliss. If you are a blogger and try a lot of new stuff for an article, it's great. If you are working at repl.io and you get millions of venv created every day, boy does that matter. If you are sysadmin in charge of deploying kub pods, you might be looking at serious savings. Etc.

Speed affects many things:

- CI runs

- AI iterations

- docker builds

- isolated builds over multiple versions of python

But it also unlocks some use cases.

E.G:

- uvx is great only because uv is fast. Because uv calls are virtually instants, using uvx feels like magic.

- "uv run --with" exist only because overlaying a new venv on top of the other is basically free. And it's a killer feature.

- You never create lock files in uv. Because the operation is transparently done in the background since it's so fast. I can't recall the last time I ran uv sync. Because uv run automatically call it, since it's so fast you don't notice. So you just skip the middle man and go straight to coding.

I was a big proponent of "speed is not that important". Until I got speed.

And then I realized I missed a lot, because they are things you just can't do if you are slow.

comment 11mo ago · link · parent

Without the sci-fi, if you take people with 10 to 12 kids, you have great accidental, natural, objective experiments here.

You can study those kids and compare them to the reported lifestyle of the parents at the time before their conception.

comment 11mo ago · link · parent

For the latter point, you are blinded by your own competence.

Bootstrapping a clean python env is the single biggest problem for people that are not daily coding in python.

That's half of the community in the python world.

When you write sqla that's not obvious, because you know a lot. But for the average user, uv was a savior.

I wrote a pretty long article on that here:

https://www.bitecode.dev/p/why-not-tell-people-to-simply-use

We also discuss it with brett cannon there:

https://www.bitecode.dev/p/brett-cannon-on-python-humans-and

But the most convincing argument is to teach python to kids, accountants, mathematicians, java coders and sysadmin.

After 20 years of doing that, I saw the same problems again and again.

And then uv arrived. And they disapeared for those people.

comment 11mo ago · link · parent

Real thread are very recent and didn't exist when uv was created. So you needed multiprocesses.

comment 11mo ago · link · parent

HTTP range strikes again.

As for 20 ms, if you deal with 20 dependencies in parallel, that's 400ms just to start working.

Shaving half a second on many things make things fast.

Althought as we saw with zeeek in the other comment, you likely don't need multiprocessing since the network stack and unzip in the stdlib release the gil.

Threads are cheaper.

Maybe if you'd bundle pubgrub as a compiled extension, you coukd get pretty close to uv's perf.

comment 11mo ago · link · parent

That's decent value considering the price of a vps is close for much more work.

The only difference is the bandwidth: vps in europe givr you 10 tiles that, unmeterred.

Very cool for training: I can make people log into those vm and deploy nginx just for learning.

comment 11mo ago · link · parent

Indeed, but unzipping while downloading do. Analysing multiple metadata files and exporting lock data as well.

Now I believe unzip releases the GIL already so we could already benefit from that and the rest likely don't dominate perfs.

But still, rust software is faster on average than python software.

After all, all those things are possible in python, and yet we haven't seen them all in one package manager before uv.

Maybe the strongest advantage of rust, on top of very clean and fast default behaviors, is that it attracts people that care about speed, safety and correctness. And those devs are more likely to spend time implementing fast software.

Thought the main benefit of uv is not that it's fast. It's very nice, and opens more use cases, but it's not the killer feature.

The killer feature is, being a stand alone executable, it bypasses all python bootstrapping problems.

Again, that could technically be achieved in python, but friction is a strong force.

comment 11mo ago · link · parent

Other design decisions that made uv fast:

- uncompressing packages while they are still being downloaded, in memory, so that you only have to write to disk once

- design of its own locking format for speed

But yes, rust is actually making it faster because:

- real threads, no need for multi-processing

- no python VM startup overhead

- the dep resolution algo is exactly the type of workload that is faster in a compiled language

Source, this interview with Charlie Marsh: https://www.bitecode.dev/p/charlie-marsh-on-astral-uv-and-th...

The guy has a lot of interesting things to say.

comment 11mo ago · link · parent

From the perspective on somebody who lived it:

- the first and MAIN reason is excellent windows support. Nobody wants to say this, but it was the first unix friendly community for a good scriting language to not shit on windows users.

- batteries included is frawn uppon today, but it was a BIG deal back then

- python had the best c integration system after lua and got the Numric lib because if that. It became numpy.

- it was dynamically typed, but strongly typed. No ===.

- optional parenthesis for ruby and symbols from perls were a repellant to many C and java users.

- the error messages were better than the competition.

- lisp shell without lisp

- docstrings and help()

- the packaging ecosystem that everybody craps on today was actually the best at the time. Ruby's was AWFUL at the time.

- one of the first scripting language with good namespace. Ruby could have been that but killef it with monkey patching for years.

- python found ground outside of the web unlike php, js and ruby very early

- python devs were willing to work with os devs to improve integration, and so linux and mac got system tools written in python

- django and twisted were amazing at the time. The dev server without apache was a killer feature

- google advertised they used python for the search engine and youtube. Then HN successes like reddit znd dropbox. It became so famous.

It was not inevitable at all. Just a collection of random stuff.

comment 11mo ago · link · parent

My bad, I should not read AI generated code while drunk at a xmas party. That's the total run time for 10000 iterations.

Average time for 100 tests is hence 0.8 ms. Completely normal, and absolutely acceptable, especially for an operation as rare as routing.

Letting my previous comment as-is for historical purposes. And to remind myself I'm a dumbass.

comment 11mo ago · link · parent

I just tried to match a URL against about a hundred patterns of various types (thanks to Claude code), expecting it to be a non-issue.

A hundred regex tests, for example, is generally very fast. A quick Python script made them run in 0.85ms. A hundred Flask router tests is 2.64ms.

So I had no reason to think this API would be slow. Surely matching a URL is a subset of generalized regexes and can only be fast? And given that routing is not an activity you do a lot, why would it matter anyway?

But the performances were atrocious: it took 8 seconds to resolve the worst-case scenario on Firefox, and it locked the entire browser UI.

Ok, note to self, stay away from the URL Pattern API.

comment 11mo ago · link · parent

France gets around that by assuming it's the car's owner's fault. If you were not driving the car during the infraction, the person driving the car must fill out a form saying he or she did and take the hit voluntarily.

If the car's owner is a company, the company must declare a default conductor for this purpose.

comment 11mo ago · link · parent

For these reasons, many countries have adopted a point-based system for driving licences. E.G: in France you have 12 points, driving over the speed limit is a fine, but also removes up to 6 points depending on the speed.

If you go down to 0 points, your licence is suspended.

If you stay without a fine for long enough, you get back points.

Some countries have fines that depend on how much you make. Some countries will destroy your car if you really behave badly.

comment 11mo ago · link · parent

Wasn't that the elevator pitch for Palentir?

Still can't believe people buy their stock, given that they are the closest thing to a James Bond villain, just because it goes up.

I mean, they are literally called "the stuff Sauron uses to control his evil forces". It's so on the nose it reads like an anime plot.

comment 11mo ago · link · parent

Also note that R, U and T are one letter away to spell Rust.

comment 11mo ago · link · parent

Having fast and reliable code indexing, enable good "go to definition", completion and auto import is actually very exciting.

Pyright/pylance were a boon because they were the first non-pycharm good implementation.

But they still have rough edges and will fail from time to time, not to mention the latency.

comment 11mo ago · link · parent

Pastebin mate.

comment 11mo ago · link · parent

Damn it, this unicorn farting rainbows and craping gold is not yet capable of towing another car. I don't know why they advertise it as a replacement for my current mode of transportation.

comment 11mo ago · link · parent

Always fun when geeks discover basic philosphical concepts like it's a new thing and not something greeks nailed 2000 years ago.

comment 11mo ago · link · parent

People wrote video games in Excel.

comment 11mo ago · link · parent

Didn't know that but I assume you can share most of the engine's logic anyway. Those kind of generalisations tend to break down once you get pratical implementations.

comment 11mo ago · link · parent

Personally, to defer importing numpy until I can't anymore.

Sometimes you just need a little matrix shenanigans, and it's a shame to have to bring in a bazooka to get decent ergonomics and performances.

comment 11mo ago · link · parent

You don't really often need an array language, just like you don't really often need regexes.

When when you have a problem that perfectly fits the bill, they are very good at it.

The problem is they are terrible at everything else. I/O, data validation, manipulation strings, parsing, complex logic trees...

So I feel like just like regexes, there should be an array language parser embedded in most languages, that you opt in locally for just this little nudge.

In Python, it would be nice to be able to "import j" like you "import re" in the sdlib.

The entire J code base, including utility scripts, a console, a stdlib and a regex engine, is 3mb.

1
678
184