This journal is generated by AI

Learning C23: Going Behind the Curtain of Modern Systems

This week I dove deep into Paul J. Lucas’s book on learning C23, which provides a comprehensive tour of the latest C standard and why understanding systems programming at this level matters. With 133 highlights, this was clearly a major focus of my learning.

  • Modern C Features: C23 introduces many modern conveniences like bool, nullptr, constexpr, auto, typeof, and compound literals. The language is evolving while maintaining its core philosophy of being “close to the machine.”
  • East const Convention: A stylistic choice where const is placed to the right (east) of the type, making pointer declarations more readable when reading from right to left. This consistency helps with complex pointer declarations.
  • Type System Enhancements: New types like _BitInt for bit-precise integers, decimal floating types (_Decimal32, _Decimal64, _Decimal128), and complex number support show C’s continued evolution for specialized use cases.
  • Practical Systems Understanding: The book emphasizes that C was designed to work directly with machine details—understanding memory layout, alignment, and how data structures map to hardware is still valuable even when working in higher-level languages.

This connects to my broader interest in understanding how modern systems work under the hood, especially as I work with distributed systems and blockchain technology where performance and correctness matter deeply.

Time Management and Reflective Living

Arnold Bennett’s classic How to Live on 24 Hours a Day offers timeless wisdom about making the most of our daily time budget. The key insight is that we already have all the time there is—the challenge is how we use it.

  • The Inner Day: Bennett suggests dedicating 7.5 hours per week (about 90 minutes per evening) to cultivating your mind. This “inner day” should begin at 6 p.m. and end at 10 a.m., separate from your workday.
  • The Reflective Mood: What’s most lacking in modern life is the reflective mood—taking time to examine conduct against principles, to think deeply rather than just consume information. The solitude of the evening commute is perfect for this.
  • Slow, Deep Reading: When reading for cultivation, give at least 45 minutes to careful, fatiguing reflection on what you’re reading. Your pace will be slow, but that’s the point—the good stuff rises up to meet you in the extra time you give it.
  • Topic Reading with Limits: Choose a limited period, subject, or single author. Define the direction and scope of your efforts rather than reading aimlessly. Forget the goal; think only of the surrounding country, and you’ll find yourself in a lovely town on a hill.

This resonates with my experience that slowing down often yields better results than rushing, whether in reading, coding, or thinking through problems.

Formal Methods: Exploring Quint and TLA+

I’ve been exploring formal specification languages, particularly Quint, which provides a more accessible syntax for writing formal specifications compared to TLA+. This connects to my interest in distributed systems and ensuring correctness.

  • Quint’s Design Philosophy: Quint restricts the prime operator (') to assignments in the format <var>' = <expr>, preventing hard-to-grasp expressions while maintaining the power of temporal logic. The tooling reports errors if you misuse ' or forget to update variables in some branches.
  • State Machine Modeling: Actions named init and step define the state machine—init defines initial states, step defines transitions. This makes the model structure clear and checkable.
  • Pure Functions and Actions: Definitions prefixed with pure are functional—same input always produces same output. Actions use the prime operator to modify state. This separation helps reason about what changes state and what doesn’t.
  • Non-determinism: Quint supports non-deterministic definitions using any and oneOf, which can only be used inside actions before assignments. This is crucial for modeling systems with multiple possible behaviors.

The connection to TLA+ is clear—both are tools for specifying and verifying system behavior, but Quint’s more familiar syntax might lower the barrier to entry for formal methods. This is particularly relevant as I work on systems where correctness is critical.