HNHacker News
TopNewBestAskShowJobs

BiteCode_dev

24,628 karma · joined October 21, 2019

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

https://www.bitecode.dev/

Email: contact at bitecode.dev

submissionscomments
BiteCode_dev··on Exe.dev
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.

BiteCode_dev··on How uv got so fast
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.

BiteCode_dev··on How uv got so fast
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.

BiteCode_dev··on Ask HN: Why Did Python Win?
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.

BiteCode_dev··on URL Pattern API
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.

BiteCode_dev··on URL Pattern API
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.

BiteCode_dev··on Over 40% of deceased drivers in vehicle crashes test positive for THC: Study
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.

BiteCode_dev··on Over 40% of deceased drivers in vehicle crashes test positive for THC: Study
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.

BiteCode_dev··on History LLMs: Models trained exclusively on pre-1913 texts
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.

BiteCode_dev··on Announcing the Beta release of ty
Also note that R, U and T are one letter away to spell Rust.
BiteCode_dev··on Announcing the Beta release of ty
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.

BiteCode_dev··on An Implementation of J (1992)
Pastebin mate.
BiteCode_dev··on Announcing the Beta release of ty
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.
BiteCode_dev··on Thin desires are eating life
Always fun when geeks discover basic philosphical concepts like it's a new thing and not something greeks nailed 2000 years ago.
BiteCode_dev··on An Implementation of J (1992)
People wrote video games in Excel.
BiteCode_dev··on An Implementation of J (1992)
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.
BiteCode_dev··on An Implementation of J (1992)
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.

BiteCode_dev··on An Implementation of J (1992)
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.

BiteCode_dev··on A “frozen” dictionary for Python
Clearly the ROI is perfect for you.

I won't waste more of your time.

BiteCode_dev··on Things I want to say to my boss
Never put it this way before, but it's exactly why I started blogging. I was fed up with how bad Python content was online.
BiteCode_dev··on A “frozen” dictionary for Python
pyrsistent is super slow, though. Just ran a quick benchmark:

  - Creation - 8-12x slower  
  - Lookup - 22-27x slower  
  - Contains check - 30-34x slower  
  - Iteration - 5-14x slower  
  - Merge - 32-158x slower  
 
Except at 10k+ items, batchup dates on 100K+ items or inserting 100 keys.

This is rarely the case in practice, most dictionaries and dict operations are small, if you have a huge dict, you probably should be chunking your load or delegating that to infra.

Not to mention pyrsistent's API is incompatible with dicts, so you can't pass it to external code without conversion.

You'd better have an incredible ROI to justify that.

BiteCode_dev··on A “frozen” dictionary for Python
Ordering is very useful for testing.

This morning for example, I tested an object serialized through a JSON API. My test data seems to never match the next run.

After a while, I realized one of the objects was using a set of objects, which in the API was turned into a JSON array, but the order of said array would change depending of the initial Python VM state.

3 days ago, I used itertools.group by to group a bunch of things. But itertools.group by only works on iterable that are sorted by the grouping key.

Now granted, none of those recent example are related to dicts, but dict is not a special case. And it's iterated over regularly.

BiteCode_dev··on Things I want to say to my boss
Also, this is why we still gravitate toward FOSS communities. It's the last vestige of a dying era. A circle where people like that have a chance to hang up together and keep the warm feeling of being human.
BiteCode_dev··on Python Workers redux: fast cold starts, packages, and a uv-first workflow
Anybody using it for something serious ? I can't see a use case beyond I need a quick script running that is not worth setting up a vps.
BiteCode_dev··on Nvidia allowed to sell its H200 chips to China, the gov takes a 25% cut
So close to understand the concept of taxes.
BiteCode_dev··on If you're going to vibe code, why not do it in C?
- C takes a lot more context than a high-level language

- a lot of C code out there is not safe, so the LLM outputs that

- C encodes way less of the programmer's intention, and way more implementation details. So unless the author is extremely good at naming, encapsulating and commenting, the LLM just has less to work with. Not every C code is Sqlite/redis/ffmeg quality.

- the feedback loop is slower, so the LLM has less chance to brute force a decent answer

- there is no npm/pypi equivalent for C on which to train the LLM so the pool for training is less diverse

- the training pool is vastly Linux-oriented, with the linux kernel and distro system libs being very prominent in the training data because C programs on Windows are often proprietary. But most vibe coders are not on Linux, nor into system programming.

Sure, you can vibe code in C. Antirez famously states he gets superb ROI out of it.

But it's likely you'll get even better results with other languages.

BiteCode_dev··on Microsoft has a problem: lack of demand for its AI products
Microsoft has this problem with most of its products.

It's not just AI, it's a market fit and quality problem.

They don't need to solve it, however.

Their strategy has been quite clear: make it barely usable so that is passes muster to auditors, integrate it with systems that corporations need, and sell them on the integrations.

Teams and Azure suck?

So what?

Big companies will pay for that, because it's integrated with their ldap, has an audit trail, gives them the ISO-whatever stamp, and lets them worry about something else.

That the users are miserable is almost never the question for the ones signing the checks.

In a world where box-checking is paramount, this approach is a winning strategy.

BiteCode_dev··on I failed to recreate the 1996 Space Jam website with Claude
Tell claude to put the screenshot as an centered image with the body having the starry background on repeat. Then define the links as boxes over each icons with an old little tech trick called an image map.

Common at the time before flash took over.

BiteCode_dev··on Characters? In This Economy?
Ah, HN Has eaten the 80 part of the title.
BiteCode_dev··on Migrating the main Zig repository from GitHub to Codeberg
Levels of indirection matter.
← PreviousPage 7 of 34Next →