♥️ Security + Privacy, PL, Formal Methods, DX, Rust 🦀, Lean, F* 🏳‍🌈 {⊥/⊥}

Morgantown, WV
Joined January 2011
Sigh
Programming used to be really fun. I’m kind of sad it’s over now
422
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
I'm so close to just buying a cabin in the cascades, taking up falconry & coffee roasting, and occasionally dropping highly political atmospheric black metal tracks I recorded in the forest. Facts.
1
1
6
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
My talk "Concrete syntax matters, actually" from the Topos Institute Colloquium is now available! I think it's some of my best work yet youtube.com/watch?v=kQjrcSMY…
5
12
1
54
8,780
After a nearly two year hiatus from writing production code, I find myself, once again, buried underneath lifetimes. It's kind of like a weighted blanket that's, perhaps, a touch crushing at times.
2
292
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
This one from @ilyasergey's course on Programming with Proofs, as a reference reading .. (link to the course: 👇) .. I just skimmed through the contents and here's my 1000 ft view of it .. looking forward to a deep dive read very soon, looks like a great way into the combination of FP, proof systems and Lean .. The course page also refers to work-in-progress class “Practical Verifications of Data structures and Algorithms” (aka PraVDA) - it would be interesting to get some insights into it as well .. The Hitchhiker’s Guide to Logical Verification (2025 Desktop Edition) is a textbook-style guide to interactive theorem proving using the Lean 4 proof assistant. • It introduces the logical foundations of Lean, starting from simple type theory and gradually moving to dependent types, inductive definitions, and structured proofs, treating Lean as a vehicle for learning rigorous reasoning rather than an end in itself. • The book then develops functional and effectful programming in Lean (with inductive types, type classes, monads, etc.) and shows how to prove properties of programs using techniques like induction and rule-based reasoning. (This is the part that looked very interesting to me) • In later chapters it covers program semantics -operational, Hoare and denotational, and connects them to machine-checked proofs, including the use of proof automation and metaprogramming in Lean. • Throughout, the goal is to equip readers with enough practical and theoretical background to tackle real verification projects and move comfortably between Lean and other modern proof assistants.
6
37
1
244
12,672
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
Going live now! Continuing our Lean 4 Series — today I'll test my knowledge in proving insertion sort correct! This is part of our ongoing fundraiser to replace my iPhone camera with a proper setup. Every tip helps! 💜 ☕️ko-fi.com/typetheoryforall ▶️twitch.tv/typetheoryforall
4
16
1,468
Lots of oversimplified takes about Rust unwrap due to the Cloudflare outage. In production code, I don't unwrap where I simply believe an error is unlikely, implying that the occasional crash is acceptable. I unwrap where the correct behavior upon the error is to panic.
1
1
327
Most of us don't work in spaces where panics are forbidden, and there's a valid case for panics upon irrecoverable errors. Unwrap in recoverable situations because handling errors properly is too tedious, etc, is, of course, bad.
1
203
All of that said, expect over unwrap makes sense in production code bases. I still make it a mission to get rid of all unwraps in codebases I touch. For the truly "this will never happen" error cases, unreachable! is sometimes more appropriate.
185
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
Beyond excited to share that @SunscreenTech's paper "Parasol Compiler: Pushing the Boundaries of FHE Program Efficiency" has been accepted to IEEE Security & Privacy '26! Proud of our team! Pre-print 🔗 eprint.iacr.org/2025/1144
25
7
3
57
12,648
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
Really love this
1
2
33
2,976
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
When mainstream languages try to imitate Haskell.
8
29
5
348
33,893
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
What is a type? My new Programming Language Pragmatics video discusses denotational, structural, and behavioral views of typing, demystifies terminology, talks about why types are useful, and introduces subtyping.
6
11
1
160
8,491
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
This is a great thought raising a “mechanical sympathy” point that’s often missing from day-to-day DDD conversations - the in-memory layout of your data and the access patterns of your hot paths matter a lot for performance. In regular designs of domain models we tend to focus more on the conceptual model of the problem domain. Eric Evans’ DDD also talks about modelling the ubiquitous language and capturing domain invariants and not about specifying memory layouts. Treating "domain model" as a prescription for in-memory representation confuses conceptual model with data structure choice. Despite the original domain modelling literature not considering the aspects of mechanical sympathy, the following are real concerns when the tyre hits the road: 1. Access patterns dominate performance. If a workload touches one field of millions of objects in tight loops, a Struct of Arrays (SoA) can massively reduce cache misses and help prefetchers do their job. This is standard data-oriented design (DOD) guidance. 2. False sharing is real. Co-located hot fields updated by different threads can thrash a shared cache line and nuke scalability. Padding, alignment, and data partitioning are sometimes required. However at the same time AoS vs SoA is context-dependent. If your operations usually need several fields from the same entity at once, AoS can be faster (fewer loads, better spatial locality for that use case). There isn’t a one-size-fits-all rule. Some of my thoughts on addressing this .. Think "clean domain model at the edges, data-oriented core for hot loops" .. 1. Model for the business first (standard DDD) Keep entities, value objects, and domain services intention-revealing and faithful to the problem space. This is your collaboration/communication surface. 2. Measure before changing layout Profile CPU time, cache misses, branch misses, and lock contention. Optimize measured hotspots only. 3. Introduce a data-oriented “kernel” behind the model - For the tight loop: use SoA buffers that match the access pattern (SIMD-friendly, batchable). - Keep this layout behind a domain service/repository boundary so the rest of the code can stay idiomatic DDD. - Map between entities and buffers at the boundary (cost is paid at well-chosen seams, not everywhere). This is standard DOD practice. 4. Split hot vs cold fields - Extract “hot” mutable counters/state into a separate structure (or shard by thread) to avoid false sharing. Keep “cold” descriptive fields with the entity. - Manual padding can help or use `CachePadded` like padding (as in Rust). In native code, align/pad structures and avoid mixing hot data in the same line. 5. Choose layout based on operation - SoA if you stream through one/few fields across many items (filters, aggregations, vector math). - AoS if most accesses touch many fields of the same item (rich object logic). 6. Exploit read models/projections If you use CQRS or simply maintain projections, it’s natural to keep a domain model for commands/invariants and one or more performance-tuned read models (often SoA-ish indexes or columnar structures) for queries/analytics. This is general DDD/CQRS practice. Evans doesn’t forbid multiple coexisting models. Let me know your thoughts in the replies .. Maybe I should implement something as a PoC for such modelling strategy ..
99% of domain models I’ve seen are designed w/ following perf issues: Array of Structs instead of Struct of Arrays which dramatically impacts prefetchers & cache lines negatively. False sharing. Packing hot fields w/ cold fields. Domain models need to serve the access patterns
7
1
43
6,488
Reading complex typing judgments is not, in fact, like riding a bike. Still, it feels good to be reading papers again after this very messy year.
2
230
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
Accumulate the recipes and materialize at the boundary. Compose the algebra and commit to the implementation as late as possible. A very typical functional programming pattern.
What if instead of invoking multiple services for a request breaking txn boundaries you could ask a group of services to provide processing logic & you compose a pipeline of ops & crunch it all in resident memory efficiently. Compose functionality not invoking remote functions?
2
3
17
2,543
NYC bound October 10-13 for Aeropress Championship! Would love to catch up with some folks IRL.
1
234
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
How does one implement a type checker? My latest Programming Language Pragmatics video discusses how a type checker, like an interpreter, traverses the AST of a program, implementing the functionality of the typing rule for each AST form.
1
8
54
2,503
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
People on twitter will really be like "you believe in safe language features? that pales in effectiveness to my strategy, not making any mistakes!" and then make mistakes
2
6
47
1,582
sabree λ ☕ → 🥓 → 👨🏿‍💻 retweeted
Why is pypi and npm a good target for attackers? I would argue because both ecosystems made the choice not to use minver. That means the ecosystem moves up quickly. Without a lockfile, you will get the latest version immediately, making attacks attractive xitter.cf/feross/status/19680527…
It's simple really. • Permissive publishing culture, no gatekeepers • They're the largest ecosystems, so you see it more
2
1
20
5,465