HNHacker News
TopNewBestAskShowJobs

mmaniac

331 karma · joined October 24, 2023

trmetroidmaniac@gmail.com
submissionscomments
mmaniac··on SQLite Code of Ethics
Least harmful CoC
mmaniac··on MacBook Neo Deep Dive: Benchmarks, Wafer Economics, and the 8GB Gamble
You can have as many as you like, but Safari will kill them when you're not looking.
mmaniac··on Functional programmers need to take a look at Zig
The biggest problem with monads that I am aware of is that they don't compose: if m1 and m2 are monads, then you can't automatically derive a new monad m3 where m1 (m2 a) and m3 a are equivalent.

Monad transformers are one solution to this. This lets you write the composition rules for m2 once, and then reuse them for every m1. A solution, but boilerplatey.

I don't understand algebraic effects quite as well, but my understanding is that they do simply compose.

mmaniac··on Matt Godbolt sold me on Rust by showing me C++
> You know what's the most interesting part of this whole article? The thing Rust is very famous for, memory safety, did not feature at all.

I think that's the essential point, really... It'd be hard to argue that the rest of Rust isn't overall "better" than C++, but the compromises made to flexibility and ergonomics to achieve memory safety in Rust are the biggest points of contention for Rust critics.

mmaniac··on A decompilation and port of Sonic Advance 2-a GameBoy Advance game written in C
The GBA SDK is pretty minimal in terms of library support. It's mostly functions for accessing save data plus wrappers around syscalls found in the bootrom. Those syscalls are some basic math functions, a few decompression algorithms, and an early version of the MusicPlayer2000 sound engine.
mmaniac··on Modern C
What's so bad about _Generic?

I would not let the name distract you - it's equivalent to overloading, not "generics" (i.e. parametric polymorphism)

In that capacity I think it's quite a lot more sane than C++. Having a closed set of overloads, not having name mangling, not having complex name lookup rules are all a good thing.

mmaniac··on Ask HN: Why some languages use 1 byte for boolean type
Time to put my language lawyering cap on.

C99 §6.7.2.1.13

> Within a structure object, the non-bit-field members and the units in which bit-fields reside have addresses that increase in the order in which they are declared. A pointer to a structure object, suitably converted, points to its initial member (or if that member is a bit-field, then to the unit in which it resides), and vice versa. There may be unnamed padding within a structure object, but not at its beginning

C99 §6.7.2.1.13

> An implementation may allocate any addressable storage unit large enough to hold a bit-field. If enough space remains, a bit-field that immediately follows another bit-field in a structure shall be packed into adjacent bits of the same unit. If insufficient space remains, whether a bit-field that does not fit is put into the next unit or overlaps adjacent units is implementation-defined. The order of allocation of bit-fields within a unit (high-order to low-order or low-order to high-order) is implementation-defined. The alignment of the addressable storage unit is unspecified.

Which is standardese for pretty much exactly everything you said :)

The consequence of the first rule is that there's only one sane way to lay out structs. The only way to break that rule which I can imagine would be to add extra padding - you can't swap the order of any members under these rules.

mmaniac··on Ask HN: Why some languages use 1 byte for boolean type
Isn't struct layout in C implementation defined in general?

C itself doesn't specify any ABI. A given platform simply uses one as a matter of convention.

mmaniac··on The 90s Gamer Experience: Handwritten Notes and Maps
Etrian Odyssey released in 2007 and was a fun throwback to this sort of experience. The concept for this game is that the Nintendo DS's touch screen can be used to draw a map and keep notes while dungeon crawling. It's funny to think that it's about as old now as the style of games it was imitating then.

The 3DS also had a note-keeping system built into the main menu and usable in any game, but I don't think many people bothered.

mmaniac··on "Homotopical macrocosms for higher category theory" identified as woke DEI grant
Nothing new under the sun.
mmaniac··on "Homotopical macrocosms for higher category theory" identified as woke DEI grant
Those rights, like to bear arms and freely associate, only exist on paper. That they are in a state of nominal existence and practical abrogation serves to deradicalise and defuse resistance against the government, not encourage it.
mmaniac··on Ask HN: Which messaging apps do you use?
All my online friends are on Discord, but I don't like it.

Family and IRL friends use WhatsApp.

mmaniac··on Pat Gelsinger was wrong for Intel
I think the point is that Intel had such a lead in the Bulldozer era that for AMD to overtake them was a tremendous failure.

I would not say that the first gen of Zen is was a clear winner over Skylake. It took a couple iterations before AMD clearly took the lead. AMD was simply so far behind that several large generational improvements were needed to do better than Intel.

mmaniac··on Unless my phone can be a PC, I don't want to keep paying for extra performance
The first smartphone I owned was a ZTE Blade 13 years ago. As a budget phone, that definitely had compromised performance.

It's been years and years since I ever felt like my phone's performance was holding back its usefulness to me. I have only ever replaced my phone because the battery could no longer hold a charge or the charging port was damaged beyond use.

It has a camera, web browser, chat apps, and receives emails. It also makes calls and texts. It doesn't lag while doing these things. That's plenty.

mmaniac··on Intel announces retirement of Pat Gelsinger
Ice Lake wasn't the first iteration of 10nm - that was the disastrous Cannon Lake in 2018.
mmaniac··on Executing ARM Jazelle (JVM Bytecode) on the Wii's Starlet
I was approaching it from the perspective of "What would be useful to do on a Wii?" When you approach it from the perspective of "I want to play with Jazelle - what can I use?" it makes much more sense. Thanks.

EDIT: Following one of the reference links, apparently you can enter Jazelle mode on the Nintendo 3DS's application cores. That's another suitable target. https://github.com/SonoSooS/libjz

mmaniac··on C99 doesn't need function bodies: VLAs are Turing complete
Array parameters are a lie and have always been evil. I'm only more convinced of that now.
mmaniac··on X's Objection to The Onion Buying InfoWars
This seems roundabout. If Elon Musk objects to The Onion using InfoWars' X accounts, can't he just make up a reason to ban them after the sale goes through? It's not like X can't unilaterally and arbitrarily close accounts.
mmaniac··on Executing ARM Jazelle (JVM Bytecode) on the Wii's Starlet
This seems very useless. I'm not sure Jazelle was ever used for anything, and I'm not sure why anyone would want to either - least of all on the Wii's IO processor.

Still, this repo links to some other stuff I found interesting. The Starlet exploit which is linked is funny for how basic it is, and it also seems to be part of a much bigger and more ambitious (but mothballed?) project.

mmaniac··on Ten best selling CPUs on Amazon are all AMD chips
Intel just can't stop floundering. Alder Lake and Arrow Lake were talked up a lot, but Alder Lake only approximately caught up to AMD, and Arrow Lake is still well behind.
mmaniac··on Bringing Faster Exceptions to Rust
The most interesting part of this article for me is at the beginning.

> Now imagine that calls could specify alternate return points, letting the callee decide the statement to return to:

  // Dreamed-up syntax
  fn f() {
        g() alternate |x| {
          dbg!(x); // x = 123
      };
  }

  fn g() -> () alternate i32 {
      return_alternate 123;
  }
This sort of nonlocal control flow immediately calls to mind an implementation in terms of continuation passing style, where the return point is given as a function which is tail called. Nonlocal returns and multiple returns are easy to implement in this style.

Does there exist a language where some function

  fn foo() -> T throws U 
is syntactic sugar for something more like?

  fn foo(ifOk: fn(T) -> !, ifExcept: fn(U) -> !) -> !
mmaniac··on An Update on Apple M1/M2 GPU Drivers
I'm not sure I've ever seen a bigger case of pissing in the wind than Asahi Linux. I respect the dedication but it takes a special kind of personality to not wash their hands of an affair like this.
mmaniac··on AMD Ryzen 7 9800X3D Linux Performance: Zen 5 With 3D V-Cache
Adding onto that, the roadmap to Intel's next generation isn't exactly clear. Arrow Lake Refresh would have seemingly bumped core counts healthily, but that's cancelled now. I don't believe that it's cancelled because its successor is ahead of schedule.
mmaniac··on Switch 2 will be backwards compatible with Switch
NDS and 3DS cartridges had a similar form factor but operated by a completely different protocol. I expect Switch 2 to do something like that, given that piracy-enabling cartridge emulators for the Switch 1 currently exist.
mmaniac··on Switch 2 will be backwards compatible with Switch
Modchips on newer Switches use fault injections (clock/voltage glitching) but there exist mitigations for those. The Xbox One is confirmed to use them.

I encourage you to watch this video where Microsoft describes the security design of the Xbox One, which so far has been almost bulletproof.

https://www.youtube.com/watch?v=U7VwtOrwceo

mmaniac··on Switch 2 will be backwards compatible with Switch
Would they still support autostereoscopic 3D, though?

I'd kill to see a New 2DS XL with this mod, however...

mmaniac··on Switch 2 will be backwards compatible with Switch
MIPS II got rid of the load delay slot, so any software relying on that wouldn't work.

The PS2 EE also had a nasty bug which would cause some loops to terminate early. There's a decent chance any random MIPS code would satisfy this bug's conditions.

https://lore.kernel.org/all/d59a6bef6541d35d4460b966c0fe651a...

mmaniac··on Cramming Solitaire onto a Nintendo E-Reader card
The Game Boy Micro still contained a useable SM83 and GBC PPU on the SoC, but the cartridge is inaccessible. In theory you might be able to run a tiny payload from WRAM (32KB?) but it's pretty useless otherwise.

https://github.com/AntonioND/gba-switch-to-gbc

mmaniac··on Global Book Banning Statistics
I'd be very interested in how they define a book ban. If I can go to any book retailer in some jurisdiction and buy the book I want, it isn't banned.
mmaniac··on Guide to SSH Reverse Tunneling
SSH is one of those swiss army knives which turns out to be much more useful than initially expected. The various port forwarding modes have bailed me out of a few tricky situations.
Page 1 of 8Next →