Readit News logoReadit News
ridiculous_fish commented on Lie groups are crucial to some of the most fundamental theories in physics   quantamagazine.org/what-a... · Posted by u/ibobev
YetAnotherNick · 23 days ago
Such a bad (AI written?) article. These kind of introduction to advanced topics feels like how to draw an owl tutorial where they spent so much time diving into what group is.

> The group of all rotations of a ball in space, known to mathematicians as SO(3), is a six-dimensional tangle of spheres and circles.

This is wrong. It's 3D, not 6D. In fact SO(3) is simple to visualize as movement of north pole to any point on the ball + rotation along that.

ridiculous_fish · 23 days ago
The “tangle of spheres and circles” is probably a reference to the Hopf fibration.
ridiculous_fish commented on The Lucas-Lehmer Prime Number Test   scientificamerican.com/ar... · Posted by u/beardyw
IsTom · a month ago
My favourite prime checking algorithm is that for n < 100 if it looks prime, it is prime.
ridiculous_fish · a month ago
Except 91.
ridiculous_fish commented on Fil-C: A memory-safe C implementation   lwn.net/SubscriberLink/10... · Posted by u/chmaynard
ridiculous_fish · 2 months ago
Extraordinary project. I had several questions which I believe I have answered for myself (pizlonator please correct if wrong):

1. How do we prevent loading a bogus lower through misaligned store or load?

Answer: Misaligned pointer load/stores are trapped; this is simply not allowed.

2. How are pointer stores through a pointer implemented (e.g. `*(char **)p = s`) - does the runtime have to check if *p is "flight" or "heap" to know where to store the lower?

Answer: no. Flight (i.e. local) pointers whose address is taken are not literally implemented as two adjacent words; rather the call frame is allocated with the same object layout as a heap object. The flight pointer is its "intval" and its paired "lower" is at the same offset in the "aux" allocation (presumably also allocated as part of the frame?).

3. How are use-after-return errors prevented? Say I store a local pointer in a global variable and then return. Later, I call a new function which overwrites the original frame - can't I get a bogus `lower` this way?

Answer: no. Call frames are allocated by the GC, not the usual C stack. The global reference will keep the call frame alive.

That leads to the following program, which definitely should not work, and yet does. ~Amazing~ Unbelievable:

    #include <stdio.h>
    
    char *bottles[100];
    
    __attribute__((noinline))
    void beer(int count) {
        char buf[64];
        sprintf(buf, "%d bottles of beer on the wall", count);
        bottles[count] = buf;
    }
    
    int main(void) {
        for (int i=0; i < 100; i++) beer(i);
        for (int i=99; i >= 0; i--) puts(bottles[i]);
    }

ridiculous_fish commented on Teardown of Apple 40W dynamic power adapter with 60W max   chargerlab.com/teardown-o... · Posted by u/givinguflac
okasaki · 3 months ago
There doesn't really seem to be anything interesting about this.

Also while the US plug makes some pretty compact power adapters, the effect is largely ruined in the EU and UK with their wider more cumbersome plugs.

ridiculous_fish · 3 months ago
What's interesting about it is that it supports SPR AVS, which is a new USB power delivery spec. I'm not aware of any other chargers that support this.

https://www.chargerlab.com/complete-pd-3-2-spr-avs-specifica...

ridiculous_fish commented on WASM 3.0 Completed   webassembly.org/news/2025... · Posted by u/todsacerdoti
aag · 3 months ago
Not including GC would have been a mistake. Having to carry a complete garbage collector with every program, especially on platforms like browsers were excellent ones already exist, would have been a waste.
ridiculous_fish · 3 months ago
Doesn't every WASM program have to carry its own malloc/free today?
ridiculous_fish commented on Float Exposed   float.exposed/... · Posted by u/SomaticPirate
Sniffnoy · 3 months ago
This isn't accurate. It's true for positive numbers, and when comparing a positive to a negative, but false for comparisons between negative numbers. Standard floating point uses sign-magnitude representation, while signed integers these days use 2s-complement. On negative numbers, comparisons are reversed between these two encodings. Incrementing a float as if it were an integer will, in ordinary circumstances, get you the next one larger in magnitude, but with the same sign -- i.e., you go up for positives but down for negatives. Whereas with signed integers, you always go up except when there's an overflow into the sign bit.

A more correct version of the statement would be that comparison is the same as on sign-magnitude integers. Of course, this still has the caveats you already mentioned.

ridiculous_fish · 3 months ago
You're right, thank you for the correction.
ridiculous_fish commented on Float Exposed   float.exposed/... · Posted by u/SomaticPirate
ridiculous_fish · 3 months ago
My favorite FP Fun Fact is that float comparisons can (almost) use integer comparisons. To determine if a > b, reinterpret a and b as signed ints and just compare those like any old ints. It (almost) works!

The implication is that the next biggest float is (almost) always what you get when you reinterpret its bits as an integer, and add one. For example, start with the zero float: all bits zero. Add one using integer arithmetic. In int-speak it's just one; in float-speak it's a tiny-mantissa denormal. But that's the next float; and `nextafter` is implemented using integer arithmetic.

Learning that floats are ordered according to integer comparisons makes it feel way more natural. But of course there's the usual asterisks: this fails with NaNs, infinities, and negative zero. We get a few nice things, but only a few.

ridiculous_fish commented on The Core of Rust   jyn.dev/the-core-of-rust/... · Posted by u/zdw
metaltyphoon · 4 months ago
Traits, generics, ownership, RAII shows up in many languages, so what other concept outside of lifetimes does Rust introduces?
ridiculous_fish · 4 months ago
Affine types, variance, higher-rank trait bounds, phantom data, MaybeUninit, and the whole macro and proc-macro systems are some examples of concepts that I found to be challenging when learning Rust.

Dyn-safety is another but I had encountered that previously in Swift.

ridiculous_fish commented on An Introduction to Modern CMake   cliutils.gitlab.io/modern... · Posted by u/signa11
AHTERIX5000 · 8 months ago
Is there an open source project which uses CMake well and could be used as a reference for good CMake practices?

I've been using CMake for years and it's definitely not the worst solution for building multiplatform C++ projects. But I've never read a CMake script and thought what a clean solution, it's always a bit gnarly.

ridiculous_fish · 8 months ago
LLVM's CMake build has had lots of love poured into it.
ridiculous_fish commented on Ask HN: Who is hiring? (April 2025)    · Posted by u/whoishiring
ridiculous_fish · 9 months ago
Oklo | Remote (US) or Santa Clara or Brooklyn | Full time | https://oklo.com

Join us in pioneering the next generation of nuclear reactors! You'll leverage your software skills alongside nuclear engineers to model, simulate, design, and deploy advanced fission power technology. You will work at the forefront of the nuclear industry, developing novel techniques to reach new levels of safety, efficiency, and resiliency. Come be a part of powering the future with advanced fission power plants to provide clean, reliable, affordable energy.

We are hiring for:

- Software Engineer: https://job-boards.greenhouse.io/oklo/jobs/4018702004

- Software Quality Assurance Engineer: https://job-boards.greenhouse.io/oklo/jobs/5480416004

See more opportunities here: https://job-boards.greenhouse.io/oklo

Please mention Hacker News in your cover letter!

u/ridiculous_fish

KarmaCake day6780January 5, 2011View Original