sami (@sotdev_) header
sami (@sotdev_) profile picture

recovering mess. https://www.nitter.gq/t.co/rWJEBVIqB7

Joined November 2021
Photo by sami (@sotdev_)Photo by sami (@sotdev_)Photo by sami (@sotdev_)Photo by sami (@sotdev_)Photo by sami (@sotdev_)
Pinned Tweet
most software engineers don’t care what’s happening beneath the abstraction
4
9
225
7,876
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
sami retweeted
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.
If someone claims like "I rewrote that C program in another lang and improved the performance by 10x". Trust me, there are only 2 reasons: - the original C code was partially crappy - the benchmark was deliberately constructed You just cannot beat C on perf, man.
23
11
404
18,411
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!
1
2
18
938
A tier-up optimizing JIT compiler is a physics game.
1
1
1
468
Wow the first launcher with the fastest file search OOB
This quoted post is unavailable.
1
2
43
5,139
sami retweeted
Specific knowledge is found by pursuing your genuine curiosity and passion rather than whatever is hot right now.
57
4,241
204
35,600
sami retweeted
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 :-
1
1
27
1,902
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…
4
7
115
13,863
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…
14
34
3
328
39,089
I wish Go could present test errors as nicely as Rust does
7
444
Join us
This Post is from an account that no longer exists. Learn more
1
2
6
655