Better HN
topnewbestaskshowjobs
Log inSign up

leontrolski

2,205 karma · joined Mar 29, 2019 (7y ago) · 116 submissions

https://leontrolski.github.io/
Submissions

1.

The case for living in a declining superpower(trimmings.substack.com ↗)

3 points · by leontrolski · 1mo ago · discuss

2.

SI Units for Astronauts(leontrolski.github.io ↗)

2 points · by leontrolski · 1mo ago · discuss

comment 3mo ago · link · parent

Agreed, benchmarking, I only see a slight speedup on MacOS - https://github.com/leontrolski/postgresql-testing#:~:text=ra...

comment 3mo ago · link · parent

Being to lazy to think or test it - does the above reset SEQUENCEs?

comment 3mo ago · link · parent

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.

comment 4mo ago · link · parent

Some discussion on (ab?)using pypi to distribute binaries - https://discuss.python.org/t/use-of-pypi-as-a-generic-storag...

7.

Pip install Postgres – no Docker/Brew/apt(github.com ↗)

29 points · by leontrolski · 4mo ago · 8 comments

8.

Prism: An Impure Functional Language with Typed Effects(stephendiehl.com ↗)

6 points · by leontrolski · 4mo ago · discuss

comment 5mo ago · link · parent

Similarly - 80 line LISP interpreter with integers, lexical scope, first class functions

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

comment 6mo ago · link · parent

Neat.

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

comment 7mo ago · link · parent

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]

comment 7mo ago · link · parent

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

13.

Generalised plusequals(leontrolski.github.io ↗)

16 points · by leontrolski · 7mo ago · 11 comments

14.

“Disregard That” Attacks(calpaterson.com ↗)

129 points · by leontrolski · 8mo ago · 94 comments

comment 8mo ago · link · parent

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.

16.

Aldo's Game of Music(aldodevos.nl ↗)

1 points · by leontrolski · 8mo ago · discuss

17.

National Raisin Reserve(en.wikipedia.org ↗)

6 points · by leontrolski · 11mo ago · discuss

18.

Show HN: I 3D printed a running buggy(leontrolski.github.io ↗)

1 points · by leontrolski · 1y ago · discuss

comment 1y ago · link · parent

Ditto, another Upset blog post - https://leontrolski.github.io/upset.html

20.

Using Python 3.14 template strings to write Python(leontrolski.github.io ↗)

3 points · by leontrolski · 1y ago · 1 comment

comment 1y ago · link · parent

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

comment 1y ago · link · parent

A reminder of all the features available right now with PWAs - https://whatpwacando.today

23.

Cheeky Python Shell Script(leontrolski.github.io ↗)

3 points · by leontrolski · 1y ago · 1 comment

comment 1y ago · link · parent

> 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?

comment 1y ago · link · parent

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

26.

Senior Engineer tries Vibe Coding [video](youtube.com ↗)

2 points · by leontrolski · 1y ago · discuss

27.

Show HN: trolskgen – Ergonomic Codegen for Python(github.com ↗)

2 points · by leontrolski · 1y ago · 1 comment

28.

My dream thermostat (2024)(leontrolski.github.io ↗)

48 points · by leontrolski · 1y ago · 68 comments

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

Well that was dumb - fixed, sorry
1234