News for hackers. Stuff that matters.

chombier

Re:Beyond the & on Thursday October 22, 2026 @01:54AM (#50191669)
Re:Writing Efficient C++ Code on Monday September 28, 2026 @04:24AM (#49875068)
A few weeks back there was this nice little database query language as a language library [1] posted on HN, with the constraint that everything had to be 6NF.

At the time I thought this would naturally fit in a data-oriented design/ECS system to run complex queries. I wonder whether anyone has tried this before and whether this actually works in practice?

[1] https://prela-lang.org/tutorial/

Re:Harnessing the Universal Geometry of Embeddings on Monday September 07, 2026 @02:46AM (#49594763)
That of the underlying, hypothetical universal brain topology?
Talk starts as 6:01:10
Re:The case against geometric algebra on Monday June 22, 2026 @04:53AM (#48627579)
IIRC there's a fairly natural positive definite quadratic form on GA (used as the canonical norm) that takes the scalar part of the geometric product of a multi-vector and its reverse.

On the other hand, there's the k-th exterior power of the metric where one asks that wedge/interior products be adjoint in order to extend the metric to higher-degree forms.

I was under the impression that these metrics are the same, but maybe I'm completely wrong? Assuming I'm not, then the GA approach seems more natural to me.

Re:The case against geometric algebra on Sunday June 21, 2026 @12:48PM (#48620399)
> pull out Hodge Duals every time you want to do something that involves the metric, but I'm also unconvinced that geometric algebra is the answer here.

I don't know, I recently tried to work out how the metric on vectors/1-forms induces a metric on higher-degree forms, and if the geometric product magically gives this for free I'd say it's a win (same for the Hodge star).

Re:(How to Write a (Lisp) Interpreter (In Python)) on Sunday June 21, 2026 @12:25PM (#48620229)
If you ever wondered how to write a programming language, this is probably the best resource to get started (and then of course Crafting Interpreters).

See also part 2 https://norvig.com/lispy2.html

Re:Google Flight Simulator on Monday June 15, 2026 @11:58AM (#48543207)
Gimbal lock?
Re:Behavior-Oriented Concurrency for Python on Wednesday May 06, 2026 @09:22AM (#48035937)
I was a bit curious to learn what the differences are between this and the actor model, and I found this lobste.rs discussion to be helpful: https://lobste.rs/s/gsjskz/behavior_oriented_concurrency_for

> In BoC, the equivalent of a message is received by multiple actors and operates with exclusive access to the message and all of the receivers.

(emphasis mine)

IIUC with actors, messages are processed by exactly one actor so it can be difficult to express transactions (e.g. transferring funds from A to B cannot be done atomically). Erlang somewhat fixes this with "selective receive" which re-introduces the possibility of deadlocks. BoC fixes both issues.

Re:Ty: A fast Python type checker and LSP on Wednesday December 17, 2025 @06:31AM (#46300812)
Apart from installation problems/crash issues, do you have some feedback about type checking with ty vs. pyrefly? Which is stricter, soundness issues, etc?

Both are rust/open-source/new/fast so it's difficult to understand why I should choose one over the other.

Re:Cloth Simulation on Wednesday December 10, 2025 @11:37AM (#46219881)
For inextensible cloth there's also "Efficient simulation of inextensible cloth" [0] that is particularly clever and efficient

[0] https://dl.acm.org/doi/10.1145/1276377.1276438

Also check out Jean Gallier's notes (available online) https://www.cis.upenn.edu/~jean/gbooks/manif.html
Re: on Wednesday November 19, 2025 @04:37AM (#45977607)
Nice! It would be interesting to visualize the total momentum vector, IIRC Verlet being symplectic should be good at preserving symmetries, whereas RK4 is good at conserving energy.
Re:In Defense of C++ on Wednesday September 17, 2025 @06:36AM (#45274076)
I've been programming in c++ for 25 years (15 professionally) and I really don't see any reason to keep using it apart from dealing with legacy codebases.

Most arguments in the article boil down to "c++ has the reputation of X, which is partly true, but you can avoid problems with discipline". Amusingly, this also applies to assembly. This is _exactly_ why I don't want to code in c++ anymore: I don't want the constant cognitive load to remember not to shoot myself in the foot, and I don't want to spend time debugging silly issues when I screw up. I don't want the outdated tooling, compilation model and such.

Incidentally, I've also been coding in Rust for 5 years or so, and I'm always amazed that code that compiles actually works as intended and I can spend time on things that matter.

Going back to c++ makes me feel like a caveman coder, every single time.

Re:Death to Type Classes on Monday September 15, 2025 @03:37PM (#45254001)
Thanks, I scanned through all the comments/links but this is the actual resource one wants to read to get familiar with Backpack.
Re:Das Problem mit German Strings on Wednesday August 27, 2025 @05:34AM (#45037292)
my tl;dr: after reading the article:

- two 64-bits words representation

- fixed, 32 bits length

- short strings (<12 bytes) are stored in-place

- long strings store a 4 byte prefix in-place + pointer to the rest

- two bits are used as flags in the pointer to further optimize some use-cases

Re:Introduction to Bluesky's AT Protocol on Thursday August 21, 2025 @03:45AM (#44970182)
That was a nice read, thanks.
A quick comparison of the two languages would be interesting, in case anyone has experience with both.
Re:Tree Borrows on Thursday July 10, 2025 @04:54AM (#44518833)
The PLDI talk is also available: https://www.youtube.com/watch?v=CJi_Fcs4bak
Re:Presentation Slides with Markdown on Monday April 28, 2025 @11:33AM (#43822628)
pandoc has a reveal.js backend which I use it to build my slides from markdown (with a few ad-hoc inline css tweaks)
Re:Nix Derivations, Without Guessing on Thursday April 10, 2025 @04:39AM (#43641982)
What I found hard with Nix is the sheer amount of things I had to get familiar with before it started to really click:

- nix, the command-line tool

- nix, the language

- nixpkgs with the general API/idioms (overriding, overlays)

- individual nixpkgs packages that sometimes deviate from common practices

- flakes (which I haven't properly looked into yet)

The Nix pills series [1] and nixpkgs documentation [2] do help a lot, but that is quite a lot to process.

[1] https://nixos.org/guides/nix-pills

[2] https://nixos.org/manual/nixpkgs/stable/

Re:Rotors: A practical introduction for 3D graphics (2023) on Thursday March 06, 2025 @03:44AM (#43277898)
Yes, but from the canonical form of rotation matrices [1] I would expect such matrices to be represented as a sum of bi-vectors/rotors, which should take the same amount of data?

[1] https://en.wikipedia.org/wiki/Orthogonal_group#Canonical_for...

Re:Rotors: A practical introduction for 3D graphics (2023) on Wednesday March 05, 2025 @11:18AM (#43268614)
Geometric Algebra supporters keep advertising that rotors are great since they work in any dimension, which makes me wonder: would an arbitrary n-dimensional SVD-like decomposition benefit from using rotors instead of rotation matrices, and if so how? And if not, why?
Re:Deep Research on Monday February 03, 2025 @05:25AM (#42916822)
> and also faster than it takes me to verify the answer given by the machine.

I always thought there was a kind of NP-flavor to the problems for which LLMs-like AI are helpful in practice, in the sense that solving the problem may be hard but checking the solution must be fast.

Unless the domain can accomodate errors/hallucination, checking the solution (by a human) should be exponentially faster than finding it (by some AI) otherwise there's little practical gain.

Not exactly the same: `x` is given a polymorphic type (in F) in Haskell (restricted to values in ML) whereas the unannotated let-over-lambda will give `x`a monomorphic type.
Re:OCaml Syntax Sucks on Monday November 25, 2024 @02:19AM (#42233971)
There is a kind of "do notation" in OCaml with binding operators [1] (let*) for monads and (let+) for applicatives that is actually quite pleasant in practice.

[1] https://ocaml.org/manual/5.2/bindingops.html

Re:Stop Making Me Memorize the Borrow Checker on Sunday November 17, 2024 @02:39AM (#42162609)
Besides, if you still want to skip learning there are escape hatches like Rc<RefCell> but these hint pretty strongly (e.g. clones everywhere) that something might be wrong somewhere.
Re:Stop Making Me Memorize the Borrow Checker on Sunday November 17, 2024 @02:35AM (#42162590)
> Of course you have to internalise the rules of a borrow checker

This is generally a good thing: the more you internalise the logic of borrow checking, the earlier you start thinking about "who owns what" instead of deferring the choice to later, which often ends up in a tangled mess of "incidental data structures" as it is sometimes called in the c++ world [1].

Of course in c++ this means you have to internalise this discipline the hard way, i.e. without the borrow checker helping you.

[1] https://isocpp.org/blog/2016/05/cppcon-2015-better-code-data...

Re:How the STL Uses Explicit on Thursday June 27, 2024 @01:18AM (#40807493)
I think this is because `mutable` qualifies the call operator of the lambda (like a reverse const qualifier) so by-value captures are effectively const during the call unless the lambda is marked `mutable`. References themselves are always const, but the referenced object may be modified through the reference depending on its constness even though the lambda is not `mutable`.

Is there a way to force capture by const-reference by the way?

Re:Exponentially Better Rotations on Saturday June 15, 2024 @03:24AM (#40688077)
> >Distances are canonically defined in the space of rotations

> I am sorry, but this is simply not true.

It is true, there is a canonical choice given by the bi-invariant Riemannian metric on compact Lie groups, such as rotations (in this case the shortest angle between rotations)

Whether or not you want this metric in practice is another problem, of course.

> The article we are discussing does not provide any means of "averaging" any more than two rotations,

The Karcher/Fréchet mean described in the original article does average more than two rotations

Older »