can someone smarter than me explain the significance of this please
>>109536187It is probably the same as with Go, that if you have something like a channel that you just want to use as a signal, you send an empty struct of 0 bytes, so effectively only the sync primitive gets activated.That is the only usecase that I can imagine for a type of 0 bytes in size
idk maybe ask in the thread that already exists faggot nigger stupid idiot african black>>109534245
>>109536187 Here's a much simpler explanation of what that Jai code image shows:## The Core ConceptThis code is playing with two big ideas in programming:**1. What's the "size" of nothing?**- Think of `size_of(void)` like asking "how big is empty space?"- The answer is **0 bytes** - nothing takes up zero space- This is similar to asking "how many apples are in an empty basket?" the answer is 0**2. Dereferencing null pointers**- A "null pointer" is like a pointer that points to nowhere - it's set to null- In most languages, trying to access what a null pointer points to crashes the program- Think of it like trying to read from a closed book that doesn't exist## Why This Jai Code is SpecialThe magic here is that Jai is intentionally designed to be **super safe**:- When you try to dereference a null `void*` pointer, Jai safely reads **0 bytes** (nothing)- Because `void` has size 0, reading nothing from nowhere doesn't hurt- This is **different from C/C++**, where this would crash your program## The Counter-Intuitive PartMost programmers would expect:- `null_pointer.something` program crashes- `size_of(void)` should be 1 (to make sense in memory)But Jai does the opposite - it's designed to prevent crashes even when programmers make mistakes like this.## Why This MattersThis showcases how Jai tries to be **friendlier** than languages like C/C++:- It catches mistakes that would otherwise crash programs- It makes "unsafe" code safe by design- It's like having a seatbelt that automatically clicks when you forget to buckleThe code is essentially showing how Jai protects you from one of programming's most dangerous bugs - null pointer dereferencing - by making it do nothing harmful instead of crashing your entire program.
>>109536232AI sloppa I'm not reading and i'm hiding this comment. bye.