HNHacker News
TopNewBestAskShowJobs

mabster

280 karma · joined October 25, 2021

submissionscomments
mabster··on How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
But it's this and many other features of C/C++ that make it faster than Java. C/C++ developers really don't want to "pay" for something for safety.

Though, I really like the _mm_undefined_ps() intrinsics for SSE that make it clear that you're purposefully not initialising a variable. Something like that for ints and floats would be pretty sweet.

mabster··on How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
If m_fBladeAngle is really large (>2.2e8 back of the envelope), the subtraction will have no effect, and that would be an infinite loop.
mabster··on How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
Best change ever, that. Now it would also be nice if sets were ordered too.
mabster··on How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
When I was doing gamedev about 5 years ago, we were still debugging with optimisation on. You get a class of bugs just from running in lower frame rates that don't happen in release.
mabster··on Less Slow C++
For the range reduction, I've always been a fan of using revolutions rather than radians as the angle measure as you can just extract fractional bits to range reduce. Note that this is at the cost of a more complicated calculus.

I can't for the life of me find the Sony presentation, but the fastest polynomial calculation is somewhere between Horner's method (which has a huge dependency tree in terms of pipelining) and full polynomial evaluation (which has redundancy in calculation).

Totally with you on not relying on fast math! Not that I had much choice when I was working on games because that decision was made higher up!

mabster··on Cozy video games can quell stress and anxiety
I rage quit the game several times before it finally clicked.

The realisation was that "wait, Link is a coward!". I then avoided most battle encounters and spent most of my time just exploring.

mabster··on What do I think about Lua after shipping a project with 60k lines of code?
Yeah that's fair enough, and I've lived with it because of how good MyPy is. But I always end with weird variable names like uuids_as_list as a result!
mabster··on What do I think about Lua after shipping a project with 60k lines of code?
We were using Luajit with our own extensions with our own binding mechanisms that included automatic translation of indices. And we had A LOT of bindings.

There was some "fun" there. Luajit C functions uses space indentation that becomes tabs every 8 spaces, i.e. mixed tabs and spaces. And his custom assembler for the assembly portions.

I personally spent a lot of time "refactoring code to generate less garbage" as we had purposeful garbage collection in our idle time.

One of the advantages with Lua was that everyone could code in it. I.e. for our games all the artists, sound engineers and producers were developing Lua which was super productive.

But the function signature one in particular - that would have saved me a lot of stress on release nights!

mabster··on What do I think about Lua after shipping a project with 60k lines of code?
My big Lua codebase was a gamedev codebase, haha!
mabster··on What do I think about Lua after shipping a project with 60k lines of code?
I have mixed feelings about Java. It's a solid feature set, and I really love how InterruptedException was always a thing, so you can generally terminate a thread and it works (a lot of languages don't do this right). I love checked exceptions.

But the spooky action at a distance type annotation hell, needing builders everywhere because of lack of named parameters, poorly conceived generics, nullability not being first class, lambdas being incompatible with checked exceptions, etc. are a pain.

mabster··on What do I think about Lua after shipping a project with 60k lines of code?
The thing I find annoying with MyPt is trying to tell it I'm doing variable shadowing.

E.g. X is a list of strings Translate X to a list of indices Translate X back to a list of strings.

In that paragraph the input and output types are the same, but not complains about the second line.

I always have to introduce a variable with a new name.

mabster··on What do I think about Lua after shipping a project with 60k lines of code?
When I started, the culture was already engineered to prevent this reluctance. You would hear "the code is fragile, it's going to break. Noone will shout at you for that." This was great. But I would prefer to just not have to "run in eggshells" haha!
mabster··on What do I think about Lua after shipping a project with 60k lines of code?
I would argue that machine code is typed, but this will be up to interpretation. I.e. you can add two 32 but floating point numbers or two 16 bit integers or store an 8 bit value. It's just doesn't require you to purposefully type pun in some circumstances (e.g. where floating point and integer registers are shared).
mabster··on What do I think about Lua after shipping a project with 60k lines of code?
I guess I mean both. In that you can take something dynamically typed and add type definitions to make it more typed over time. JavaScript would not be what I'm talking about without the existence of Typescript.
mabster··on What do I think about Lua after shipping a project with 60k lines of code?
To extend on this: There was always this implied impression that the original developers were hot because they got stuff up and running really quickly and that all the newer developers were lukewarm because they weren't getting stuff happening quickly at all, all as a result of the original language choice!
mabster··on What do I think about Lua after shipping a project with 60k lines of code?
With dynamically typed languages I feel it's better to wait until you've tried to maintain the code for a while before you consider the languages effectiveness.

I had to maintain a very large Lua codebase that has been active for several years. One big problem with Lua was how it will happily take more or less parameters to functions and continue to execute compared to something like Python where it is an error to pass the wrong parameters. This meant when we update a function signature we would often incorrectly update call sites, etc.

I can't remember the specifics but we had a few issues with tables being both dictionaries and lists. IIRC, if you delete a list index and there are later list indices, they will turn into dictionary keys. We had a few bugs to do with not traversing the entire array portion of a Lua table because of this.

I also implemented a few classic algorithms, e.g. bisect in Lua and you have to be very careful with 1-based indices. You also have to be very careful when interfacing between C and Lua. I prefer 0-based indices and [start, stop) style ranges for everything nowadays.

I much prefer statically typed code during maintenance. But dynamically typed languages like Python or Typescript where you can bolt on types, later if you wish, are not too bad.

Also using named parameters as much as possible is great for maintenance.

mabster··on I want a good parallel computer
I loved and really miss the cell. It did take quite a bit of work to shuffle things in and out of the SPUs correctly (so yeah, it took much longer to write code and greater care), but it really churned through data.

We had a generic job mechanism with the same restrictions on all platforms. This usually meant if it ran at all on Cell it would run great on PC because the data would generally be cache friendly. But it was tough getting the PowerPC to perform.

I understand why the PS4 was basically a PC after that - because it's easier. But I wish there was still SPUs off the side to take advantage of. Happy to have it off die like GPUs are.

mabster··on Ross Ulbricht granted a full pardon
Agreed. It was well written.

The focus wasn't on the exact timeline and facts of the situation. It was on what it felt like as he read the piece.

mabster··on Optimizing uint64_t Digit Counting: A Method that Beats Lemire's by up to 143%
FYI, Hackers Delight uses a slight variation of Lemire's. He multiplies by 19/64 (so the divisor is a shift) and has the highest integer at the end of his table (i.e. 2^64 - 1). He also uses a shift instead of a conditional, so his code is branchless.

Generally I prefer this kind of approach. But, I suspect your digit counting is a very hot path so your tables will generally be in cache. So your approach will likely win anyway.

mabster··on Charset="WTF-8"
I was saying the exact same thing about how I don't understand why people get offended when they have to transcribe their name to use Hanzi!

We should have a world vote to settle which alphabet we use.

mabster··on Revisiting the DOS Memory Models
I wrote a similar TSR (Terminate and Stay Resident) program that would reboot the machine if the letter E was typed. We had a few of us at school always messing with each other haha
mabster··on Redis is trying to take over the all of the OSS Redis libraries
And 3. Off by one errors.
mabster··on Show HN: I made an ls alternative for my personal use
I'm not going to speak for Linux, but on Mac the Finder is annoying enough that I ended up using CLI for file manipulation (ranger).
mabster··on History of Hangul
I started learning Korean but never really got the far. But, straight after learning Hangul you get into sound mixing (https://www.missellykorean.com/korean-sound-change-rules-pdf...). Trust humans to invent something simple and then make it complicated over time!

Japanese has similar stuff with their u-dropping, but not as complicated as Korean.

mabster··on Something weird is happening with LLMs and chess
Even knowing that the software exists isn't enough. You have to learn how to use the thing.
mabster··on DB48X: High Performance Scientific Calculator, Reinvented
It's not clear from that page nor the GitHub repo whether they are using decimal floating point underneath? It's one of the nicer things when using a calculator over something like Python.
mabster··on Reports show some Canada euthanasia deaths driven by social reasons
Maybe we just try take the good and leave the bad when we borrow from previous societies?
mabster··on Reports show some Canada euthanasia deaths driven by social reasons
I agree except for any emphasis on taking a load off the medical system.

That people with terrible quality of life have the option is a good thing. It should be available for full autonomy.

I just don't want a case of any pressures to get euthanised, whether from family or society.

mabster··on Ask HN: What should I buy in Japan?
For anyone looking at knives (and other culinary tools), have a look at Kappabashi in Tokyo. There's a lot of stores there.
mabster··on Ask HN: What should I buy in Japan?
I think the selection is about the same, but it's cheaper.
← PreviousPage 3 of 5Next →