News for hackers. Stuff that matters.

leontrolski

Re:Pgtestdb's template cloning approach to testing is fast on Saturday August 01, 2026 @02:23PM (#49136973)
Agreed, benchmarking, I only see a slight speedup on MacOS - https://github.com/leontrolski/postgresql-testing#:~:text=ra...
Re:Pgtestdb's template cloning approach to testing is fast on Saturday August 01, 2026 @02:21PM (#49136958)
Being to lazy to think or test it - does the above reset SEQUENCEs?
Re:Pgtestdb's template cloning approach to testing is fast on Saturday August 01, 2026 @02:20PM (#49136945)
I concur with this approach. TRANSACTION-y tests (the default in Django) often don't quite line up with reality and make it hard to eg. drop in a breakpoint and run a server against the test's db state.

I've experimented (see below) with TEMPLATE dbs and such in Python (with inspiration from this library). IMHO the "around 100ms" mark is pretty slow for a big test suite. Interestingly, pg_restore is only twice as slow as TEMPLATEs.

https://github.com/leontrolski/postgresql-testing

I'd be interested about how all this compares to snapshotting the postrgres dir with ZFS and restoring to that, but don't have a Linux box to hand.

Re:Pip install Postgres – no Docker/Brew/apt on Thursday July 23, 2026 @05:19PM (#49028195)
Some discussion on (ab?)using pypi to distribute binaries - https://discuss.python.org/t/use-of-pypi-as-a-generic-storag...
Re:(How to Write a (Lisp) Interpreter (In Python)) on Monday June 22, 2026 @02:25AM (#48626469)
Similarly - 80 line LISP interpreter with integers, lexical scope, first class functions

https://leontrolski.github.io/interpreter.html

Re:All of human cooking compressed into 2 megabytes on Wednesday May 27, 2026 @08:10AM (#48293036)
Neat.

I'm trying to compress recipes into little schematics https://leontrolski.github.io/recipes.html

Re:Generalised plusequals on Saturday April 25, 2026 @04:55AM (#47899853)
What would be the equivalent to this in Haskell (with or without lens):

    cat = Cat(age=3)
    l = [1, [2, cat], 4]
    alt l[1][1].age.=9
That would give us l equal to:

    [1, [2, Cat(age=9)], 4]
Re:Generalised plusequals on Saturday April 25, 2026 @04:41AM (#47899789)
This is surprising to me:

  l[1][1].age:9
  # (1,(2,{"age":9}),4)
How come it doesn't return just:

  {"age":9}
Or is there something totally different going on with references here? As in, how is this different to:

  l_inner = l[1][1]
  l_inner.age:9
Re:Is anybody else bored of talking about AI? on Tuesday March 24, 2026 @05:58PM (#47510042)
Yes, AI or no AI, tell me about something actually interesting that you're working on.

Currently it feels a bit like everyone is talking about what new editor they're using. I don't care about that type of developer tooling very much. AI isn't coming up with some exciting new database, type system, etc etc.

"Look at how I'm able to web dev x% faster" because of LLMs is boring.

Re:Venn Diagram for 7 Sets on Saturday November 08, 2025 @06:13AM (#45855868)
Ditto, another Upset blog post - https://leontrolski.github.io/upset.html
Re:A Early History of Algebraic Data Types on Thursday September 25, 2025 @03:18PM (#45377594)
Lovely writeup!

> Pascal did not have sum types because Wirth thought they were less flexible than untagged unions

I'm not sure whether my dream language would have tagged or untagged unions (Scala 3 has both it seems). I'd be interested if anyone has any further points of comparison beyond:

Tagged unions, eg. in Rust: enum Tagged {A(i64), B(String), C(f64)} Untagged unions, eg. in typed Python: Tagged = int | str | float

Tagged unions are better as you can represent duplicated types and types with no data, eg: enum Tagged {A, B(f64), C(f64)}

Untagged unions are better as you can willy nilly create new subsets and intersections of types. I find often in AST-ish work I want to express eg: def f(x: A | B | C) -> A | B

Re:Do not download the app, use the website on Saturday July 26, 2025 @05:03AM (#44692589)
A reminder of all the features available right now with PWAs - https://whatpwacando.today
Re: on Friday July 11, 2025 @12:36AM (#44528430)
> also fast when transactions are held open

In my linked example, on getting the item from the queue, you immediately set the status to something that you're not polling for - does Postgres still have to skip past these tuples (even in an index) until they're vacuumed up?

Re: on Thursday July 10, 2025 @05:00PM (#44525560)
I'd be interested as to how dumb-ol' polling would compare here (the FOR UPDATE SKIP LOCKED method https://leontrolski.github.io/postgres-as-queue.html). One day I will set up some benchmarks as this is the kind of thing people argue about a lot without much evidence either way.

Wasn't aware of this AccessExclusiveLock behaviour - a reminder (and shameless plug 2) of how Postgres locks interact: https://leontrolski.github.io/pglockpy.html

I plan on using it for semi throw away UIs for things where I don't want the user to have to spin up a Web server. Right now there's no canvas support, but there is that kind of thing in the Tk/Tcl docs (linked in the project). I probably need to add a way to reference a specific Widget so you can access the raw name and run taw Tcl against it.
Well that was dumb - fixed, sorry

Older »