HNHacker News
TopNewBestAskShowJobs

turtledragonfly

914 karma · joined November 9, 2021

My company: https://festina-lente-productions.com/

email: contact@festina-lente-productions.com

submissionscomments
turtledragonfly··on Vincent van Gogh's paintings and drawings
I like this collection because of how much there is to see. Van Gogh was more prolific than I had somehow imagined.

There are different kinds of artists, and one kind (that I identify with) does it because of some semi-compulsion. It's not "oh, I think I'll do some art today, wouldn't that be nice?" but rather "I _need_ to make something; I will not feel right until I do. Where's my paint?" These are the ones who would keep producing even if nobody ever saw their work.

I guess that jives with my understanding of Van Gogh's history. Not a commercial success, not sought-after. But he did it anyway.

turtledragonfly··on Making Games
> Why had I tried to make personally meaningful art and make money from it? Isn’t that a contradiction?

This is somewhat where I am now, working on an indie game that I must realistically guess will not pay the bills, once I release it.

I took a somewhat backwards/opposite approach, though: worked at a "real job" for decades, got some savings, and now am finally scratching that itch. If it fails financially, it will still be an emotionally and personally satisfying journey for me (also painful, but that's what happens when you care about things :)

I appreciate this post for its honesty, and it's presentation of issues as the author's own experiences and self-discovery, not trying to wrap it up as advice per-se. I find it much easier to take advice from people who aren't pushing it as such.

turtledragonfly··on Exposing Floating Point (2019)
Then would it be fair to say that if you don't know what calculations might be coming, all other things being equal, 1 is a good choice since it is "unbiased" in this sense?
turtledragonfly··on Exposing Floating Point (2019)
Okay, I think we are basically on the same page.

But since I'm finding this helpful ... (:

We've been talking about addition so far, and relative scales between numbers. But suppose we just consider a single number, and multiply it by itself some times.

Certainly if that number is 1, we can keep doing it forever without error.

But the further we get away from 1 (either 1e+X or 1e-X), the more quickly error will be generated from that sequence, eventually hitting infinity or zero.

I'm just trying to express through this example that there is still something "special" about 1 in scale (likewise 0, in offset), where you want to be "close to" it, in the face of doing some arbitrary math, in order to produce better results. It doesn't even need to involve relative sizes between 2 different numbers.

turtledragonfly··on Exposing Floating Point (2019)
There's something I'm not quite getting, here.

Let's take your bank example, with 32-bit floats. Since you say it doesn't matter, lets set "1" to be "1 trillion dollars" (1e12). A customer currently has a balance of 1 dollar, so it's represented as 1e-12. Now they make 100 deposits, each of a single dollar. If we do these deposits one-at-a-time, we get a different result than if we do a single deposit of $100, thanks to accumulated rounding errors. Ok, fine.

Now we choose a different "1" value. You say "which one we pick, or picking none at all, won't affect the accuracy," but I think in this case it _does_? In this second case, we set "1" to be 1 dollar, and we go through the same deposits as above. In this case, both algorithms (incremental and +$100 at once) produce identical results — 101, as expected.

I agree that there can be multiple ranges that we care about, which can be tricky, but I don't agree that it doesn't matter what "1" we pick.

But I am probably misinterpreting you in some way (:

turtledragonfly··on Exposing Floating Point (2019)
I suppose implicit in my assumptions is that if "1" is the number I care about, that's the sort of values I'm going to be working with w/regard to my target data.

So, if I am doing some +1/-1 sort of math on a bunch of numbers, and those numbers are "far away" (eg: near 1e+8 or near 1e-8), then it is better to transform those numbers near "1 space", do the math, then transform it back, rather than trying to do it directly in that far-away space.

But yes, I suppose in your phrasing, that does come down to the ratio of the numbers involved — 1 vs 1e±8. You want that ratio to be as near 1 as possible, I think is what you mean by "limit the ratio"?

turtledragonfly··on Exposing Floating Point (2019)
> `0.001` and `0.002` are essentially equally accurate as `1` and `2`. `1.001` and `1.002` are worse.

Well let me just be 100% clear: I never meant to suggest the `1.001` encoding, at any point in this exchange (:

> You want to move the range of numbers you are dealing with so that is becomes centered around zero (not near 1!)

Yes, I think I like that terminology better - "centered around" rather than "near".

The reason I didn't say 0 originally is because keeping numbers "near zero" in an absolute sense is not the goal. If your numbers are all close to 1e-8, you would do well to scale them so that "1 float unit" is the size of the thing you care about, before doing your math. I think that is what you are saying in your cents example, too. So, the goal is about what "1 unit" means, not being specifically near a certain value. That's where the "1" in my original phrasing comes from; sorry for the confusion.

turtledragonfly··on Exposing Floating Point (2019)
> If you're calculating millimeters, you want to be using .001 and .002, not 1.001 and 1.002.

I think if millimeters are what's important, one should represent them as '1' and '2', no? That's what I meant by keeping things near 1 (apologies for my clumsy language). I mean whatever unit you care about should be approximately "1 unit" in its float representation.

But yes, thank you for helping enunciate these things (:

turtledragonfly··on Exposing Floating Point (2019)
> Imo the right advice is to either store things in some sort of offset format

Yeah, I agree that's what it comes down to, basically. It's more or less what I meant by "keep things near 1". I almost said "keep things near 0", but I didn't want to suggest that 1e-12 is somehow better than 1e+12. Really, it's more like "try to keep '1 float unit' to be about the size of the stuff you care about in your calculation".

> E.g., say you're adding some velocity to an objects position

As I interpret this example, I think it would be beneficial to re-center things to a common nearby origin, rather than doing them in some far-away-from-0 space. The more calculations being done (each one introducing some error), the more it matters.

For the specific case of "add X to each number" maybe it wouldn't matter, but I'm talking about arbitrary sequences of math being done.

If each of your calculations (applying velocity, maybe some rotation, etc) introduces some floating point roundoff error, then that is a potentially large accumulated absolute value when far away from the origin (eg: could be off-by-kilometers rather than off-by-meters). But if you normalize things down to small relative numbers first, produce all your error in that space, then transform back to faraway-space, that's only one opportunity to produce big-size error, rather than several accumulated. In other words, you've taken your local off-by-meters value, transformed it into global kilometer-size space, and so maybe your final result is off-by-1-kilometer, due to some rounding or whatnot. Whereas if you did all your computation in kilometer-space, then each step of math you do can introduce additional off-by-kilometer error, and you could be off-by-10s-of-kilometers in the end.

This whole conversation has got me doubting myself, so I made an example in godbolt that hopefully is clear: https://godbolt.org/z/MfP7e7Tbh

turtledragonfly··on Exposing Floating Point (2019)
Hm, maybe my terminology is not quite right; let me try again:

With float32, if I want to do some "small-scale" math with a clump of numbers near 1 trillion, I will have a bad time. I can't even add 1 to them, reliably. Might get x+1==x, and soforth.

But If I instead transform my space down to something near 1 (say, subtracting 1 trillion from everything), then I have available the fine-grained results of that math.

It's true that when it gets transformed back to "origin = 1trillion", that detail will be lost, but during the time I'm doing those intermediate calculations, the error is staying small in absolute value.

So, probably "precision" was the wrong word to use. Maybe relative vs. absolute error?

Compare that to fixed-point, where it doesn't matter where the cluster of numbers is, as long as things stay representable (which can indeed be a problem). You'll get the same absolute error either way.

Hopefully that makes sense; my grasp of the specific terms, etc is a little tenuous at times (:

turtledragonfly··on Exposing Floating Point (2019)
I don't entirely follow...

Most of the diagrams in this article are SVG files. Yes, you can look at the source (a big pile of numbers), but that doesn't say how they were created.

I realize that a lot of this author's other articles have animated WebGL stuff, and the source code is illuminating, but not so much here, unless I'm missing something.

turtledragonfly··on Exposing Floating Point (2019)
Pretty solid article. I'm glad there was mention of the non-uniform-distribution of floats, though my biased view wishes there were a little more emphasis that floats really really want to be "near 1", to keep precision. The practice of normalizing data to a [0,1] space, doing your math there, then transforming back to "big" space is useful not just for conceptual simplicity, but also for maintaining precision in intermediate results.

Also, there's a pretty good range of integers that can be represented exactly by floats; one of the reasons the Lua developers were resistant to adding an integer type for many years. I believe you can represent about 24 bits of exact integers in a 32 bit float.

I've been wrangling with fixed-point representations a lot lately, so the differences are stark in my mind (:

turtledragonfly··on Gut–Brain axis
Heck no!

And if you're interested, check out the Nobel-prize-winning split-brain experiments. Example: https://www.youtube.com/watch?v=aCv4K5aStdU

turtledragonfly··on Gut–Brain axis
Also, if you're interested in what intestines look like squirming about in real time: (beware! NSFW, medical gore, blood/guts/etc) https://old.reddit.com/r/medizzy/comments/ttz995/peristalsis...

Gross, but fascinating too.

turtledragonfly··on Gut–Brain axis
People are wowed by animals that have multiple brains (eg: octopus' arms), perhaps not realizing that humans do too, in a sense — the enteric nervous system (described in the article).

It's the reason you can still digest food if you're a quadriplegic, for instance.

The enteric nervous system has about the same number of neurons as a cat brain, for point of reference.

Sometimes I think of the activity of my guts as my little cat brain, taking care of things down there, so I don't have to (:

turtledragonfly··on Sponge spicule
I love this micro-structure sort of stuff. Another good one is nacre (aka "mother of pearl")[1], which is composed of microscopic hexagonal platelets, made from aragonite. Nanotechnology is pretty old and common tech, it seems; we just don't have a good handle on it ourselves, yet.

On a different note, one interesting theory is the "Clay origin of life"[2], where life began with non-organic crystal replication, and bootstrapped from there. Reminds me of the phrase "humans are the reproductive organs of machines". Maybe the crystals are the ones really driving the show, and we were just developed to help out (:

[1] https://en.wikipedia.org/wiki/Nacre#Structure_and_appearance

[2] https://en.wikipedia.org/wiki/Abiogenesis#Clay

turtledragonfly··on Getting to know the right people (2022)
I liked the postscript:

  Not really sure why this piece was abandoned. I think it was too large
  and I didn't quite know what I was building up to, partially because
  I was theorising about a problem that I haven't had a huge amount of
  success with personally.
In particular because I liked the article, and I'm glad they published it even though it wasn't finished and had some (acknowledged) missing bits.

There are a lot of hollow articles out there which look polished, and there are a lot of un-polished articles (or even un-published) that are actually good, and I for one would like to see more of the latter.

It's good, and brave, to publish something that's a little unfinished or scattered or doesn't seem to have a Final Point being made. There can still be good nuggets inside, even though it invites criticism from the peanut gallery (not the fine folks on HN of course, but just in general).

turtledragonfly··on Screwing up my page tables
I like these war stories — the worst bugs aren't solved by tools or tests, but by semi-desperate flashes of insight after you've been tearing your hear out for hours. It's great when the very foundations of what you're used to trusting (eg: an allocator, the kernel, your compiler, etc) are where the bugs lie.
turtledragonfly··on C++ Object Lifetime
Ah, thanks for that follow-up. That is more in line with my mental model.

So... seems like a bad example in the article (:

turtledragonfly··on C++ Object Lifetime
How can you write an article like this and not say the magic word: RAII

RAII is one of the great things about C++, precisely because it allows detailed control over object lifetimes (even in the face of exceptions, etc).

However, I did learn something from this article: I didn't realize that a delegating constructor counted as "fully initializing" the object. The main constructor is, I imagine, just treated as some "extra code that is run after the real ctor"?

But I wouldn't rely on subtleties like that, or rely on others to know about it. Just use simple RAII (:

turtledragonfly··on GNU poke: an extensible editor for structured binary data
Is there allowance for file formats whose contents are dynamic, based on the values present in other parts of the file?

For instance "if value at offset X is 123, then treat this other block of data as format ABC, otherwise treat it as as DEF". Obviously can get complex. The Adobe PSD format does horrible things like this all over the place (:

turtledragonfly··on GNU poke: an extensible editor for structured binary data
There are a lot of interesting tools in this area.

Here's a previous comment of mine with a list of various such things: https://news.ycombinator.com/item?id=34990984

There was some good discussion on that previous post from others, as well.

turtledragonfly··on It’s time to embrace slow productivity (2022)
> slow is smooth and smooth is fast

Another phrase with similar meaning (and interesting history) is "festina lente" ("make haste slowly," in Latin). I named my company after it (:

It's certainly an ancient concept. I feel like software is ultimately about humans organizing complex activities, and humans haven't changed that much in the past few millennia, even if the activities have gotten more complex and abstract.

I feel like the ones-size-fits-all approach of trying to say approach X or Y is superior (eg: scrum vs. kanban vs. waterfall, etc) is totally off the mark. Different sorts of work require different sorts of effort. Creative and full-of-unknowns work is different from assembly-line sort of work is different from maintenance work, etc.

On a meta level, I think part of the "slow is smooth..." philosophy is to take a deep breath at the beginning and think about what sorts of approaches are going to be best suited for the tasks at hand. As opposed to some mindless "scrum is in, so we'll do that for everything". Or "everyone is using NoSQL now, so we should too" or any number of other cargo-cult-y behaviors.

Festina Lente!

turtledragonfly··on Street Fighter II, paper trails (2021)
Tricks for packing data are still relevant today, though obviously hardware has changed so the tricks are different. One important concept on today's machines is that memory latency is huge relative to the cost of executing other instructions (eg: arithmetic, logic). In some senses, such packing has become even more important as time has gone on. There was a point in history when memory operations and ALU operations were about the same speed, so it made sense to keep even small computations in memory, and retrieve them later (eg: a lookup table, possibly pre-computed). Nowadays, it is often faster to re-compute values from scratch when needed, rather than going to memory, even for biggish computations.

In today's world, the GPU largely deals with textures, but the same rule holds — it can make sense to compute values rather than doing texture fetches. Anyway, I'd say your instinct is right — developers are still using lots of tricks to get things where they are. There is still a lot of competitive pressure to provide more, more, more and squeeze the most out of the hardware.

All that said, the 100GB download is often going to be audio/video. Then probably textures. There is certainly standard compression going on for a lot of that. But not the sort of manual "these texels go here, those texels go there" fiddling of data like described in this article. Though UV unwrapping is still and art and a science (:

turtledragonfly··on Vim Keybindings Everywhere – The Ultimate List
One fun tidbit about using Vi keybindings in readline is: you can use '*' as a wildcard when searching history. You can't do it in the default Emacs mode. I use this all the time!

Originally I read about this feature in a POSIX spec, noticed it did not work, and filed a bug with readline about it.

They fixed the bug, but since it was only mentioned in the spec for Vi mode, they did not add the feature to Emacs mode.

I'm glad to have done my part to make Vi mode strictly superior to Emacs mode (:

turtledragonfly··on Vim Keybindings Everywhere – The Ultimate List
They mention 'readline' under 'shells', but it's really more general than that. For instance, you can configure plain commandline GDB to use vim key bindings that way, and any other program that uses readline.

Similar can be done for 'editline' (a readline alternative sometimes seen on BSD systems).

turtledragonfly··on Guidelines for Brutalist Web Design (2018)
I don't know, I might enjoy Roccoco web design — it seems what we have today is just plain user-hostile. Dystopian web design?
turtledragonfly··on When a mosquito can’t stop drinking blood, the result isn’t pretty
That's an interesting re-phrasing of the age-old question "what's the purpose of life?" (:
turtledragonfly··on Why the brain’s connections to the body are crisscrossed
It is a fascinating series of experiments.

For others interested, look up Roger Sperry's split-brain experiments[1], done at CalTech. He received the 1981 Nobel Prize for the work. I'm surprised the above article doesn't mention it.

We don't cut cut peoples' brains in half any more, so it was a unique moment in time when they had people available with this condition, and the results are quite illuminating.

Here's a video with some interviews with real patients: https://www.youtube.com/watch?v=aCv4K5aStdU

And a here's a timestamp where one of the experiments is performed: https://www.youtube.com/watch?v=aCv4K5aStdU&t=101s

[1] http://scihi.org/roger-wolcott-sperry-split-brain/

turtledragonfly··on Lerp
Good explanation. But one thing that might not be obvious is that "b" is a moving target in the article (and in many cases where this technique is used), so using your equation, moving "b" by one unit in a given frame will also move x(t) by one unit, causing it to feel a bit faster/more aggressive.

Your final equation will guarantee that you will end up at (a given closeness to) the target at a given time, wherever that target might be, and however fast it might be moving away.

Using the (poorly-named) approach in the article gives you a subtly different behavior, where the easing is essentially "reset" each frame. If you "run away" from the easing object at the right speed, you can delay it reaching you for an arbitrarily long amount of time, which has a different feel, and different practical consequences depending on the context. This is demonstrated in the "Follow the mouse" example in the article.

← PreviousPage 4 of 7Next →