Hacker News new | past | comments | ask | show | jobs | submit login

This reminds me a bit of splittable random number generators [1], which are useful for monte carlo methods with fork-join parallelism. Perhaps ordinals would be the non-random version of that? But then again, it seems like ordinals couldn’t be a fixed-size datatype like a float, so why not use dotted paths as strings?

[1] https://docs.oracle.com/en/java/javase/17/docs/api/java.base...




The things you gain compared to a string-based API are

(a) Potentially some space efficiency. They can't be fixed-size, but they can absolutely be a small number of varints (the standard zig-zag encoded 7 bits per byte with a high-bit signalling more data would be fine, or since everything in sight is unsigned you could skip the zig-zag).

(b) An intrinsic notion of order that is almost definitely correct. When the standard dictionary order suffices (actually a bit tricky with strings, starting with upper/lower-case and quickly devolving into questions of what an upper-case emoji is, but assume ASCII for the sake of argument), strings are probably a better conceptual fit. You'll struggle with the path-based approach when the number of dots changes though, when you have some concerns ordered monotonically one direction and others ordered the other way, when you need a notion of enough space to _always_ be able to slot an intermediate value in, ...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: