zig stream on riscv emulator: ebreak and ecall twitch.com/borngraced
short zig stream on riscv emulator twitch.com/borngraced
5
274
TL;DR: endianness operates at byte level.. instead of swapping 0s and 1s you change the order of bytes.
People heard about little and big endian, but a lot of them still don't have intuitive understanding of it. For example, a common mistake is to think that you just read 1s and 0s from left to right vs right to left.
Writing a parser for big endian format (like TTF) helps a lot
1
11
317
short zig stream on riscv emulator twitch.com/borngraced
If you can't get the same performance out of C, C++, Rust, and Zig then you are doing it wrong. They can be matched essentially one-to-one and all even have inline as escape hatches. None of these languages produces faster binaries than the others can.
sami retweeted
Static allocation makes taste explicit through your code, it forces your whole team into good design.
It helps you understand the physics of your system, eliminates fragmentation, gives you physical memory safety. You can't use-after-free if you never free!
sami retweeted
Wow the first launcher with the fastest file search OOB
This quoted post is unavailable.
sami retweeted
Specific knowledge is found by pursuing your genuine curiosity and passion rather than whatever is hot right now.
sami retweeted
This is a really good blog post and you should read it
planetscale.com/blog/concurr…
Single Load and store are Atomic:
What I learnt:-
In modern CPU architectures, *aligned* data accesses are atomic for single loads and stores, provided the data types are *naturally aligned*. In short, what it means is that the reader shouldn't see tearing.
On my hardware :-
you should read this article if you want to learn Rust or already knows Rust but don't actually understand it sot.dev/learn-the-shape-of-y…
I have a real issue with how most people/resources teach Rust (extends to Go, Zig etc). they barely talk about data types, memory layout, or what goes on the stack vs heap. Having the basic idea of this stuff work is what actually makes you much better at learning the language/programming.
This is why people “know Rust” but still fight String vs &str, Vec vs [T; N], Box/Rc/Arc, trait objects & lifetimes.
A better teaching style should be something like:
let s = String::from("hello");
// stack: String value = pointer, length, capacity
// heap: UTF-8 bytes: h e l l o
// move: copies the String header, invalidates old binding
// drop: frees the heap buffer owned by the final String owner
One diagram like this beats 20 abstract lifetime examples.
here's a great example of how to teach/learn rust rust-book.cs.brown.edu/exper…
I have a real issue with how most people/resources teach Rust (extends to Go, Zig etc). they barely talk about data types, memory layout, or what goes on the stack vs heap. Having the basic idea of this stuff work is what actually makes you much better at learning the language/programming.
This is why people “know Rust” but still fight String vs &str, Vec vs [T; N], Box/Rc/Arc, trait objects & lifetimes.
A better teaching style should be something like:
let s = String::from("hello");
// stack: String value = pointer, length, capacity
// heap: UTF-8 bytes: h e l l o
// move: copies the String header, invalidates old binding
// drop: frees the heap buffer owned by the final String owner
One diagram like this beats 20 abstract lifetime examples.
here's a great example of how to teach/learn rust rust-book.cs.brown.edu/exper…
sami retweeted
Proofs and Types paultaylor.eu/~pt/stable/Pro…













