Practical Projects in Nex
Contracts at Work
Nine complete, runnable programs — CLI tools, libraries, concurrent code, networked services, and a desktop GUI — with contracts holding each one together.
Front Matter
- PrefacePrefaceWhy a projects book, how it differs from the other three, who it is for.
- Front MatterHow This Book WorksThe anatomy every project follows, the file layout convention, and how to build and run each one.
Part I — Command-Line Tools: The Baseline Discipline
- Chapter 1A Text-Analysis CLIA word-frequency counter. The CLI's contract before its code: flags, exit codes, and boundary-located errors.
- Chapter 2A Persistent Task TrackerModeling task state with refinement types, round-tripping it through JSON, and evolving a file format without breaking old data.
Part II — Libraries, Not Apps
- Chapter 3A Generic LRU CacheDesigning the interface before the implementation; an invariant as the real specification.
- Chapter 4An Expression InterpreterGrammar to AST by hand; a
unionand an exhaustivematchas the evaluator's safety net.
Part III — Concurrency in One Process
- Chapter 5A Concurrent Duplicate FinderFan-out, fan-in with
TaskandChannel; testing code whose scheduler is not deterministic.
Part IV — Talking Over the Wire
- Chapter 6A TCP Chat ServerA protocol designed before any code; one task per connection, a shared broadcast channel.
- Chapter 7An HTTP JSON APIA service and its CLI client either side of
net/Http_Server; Project 4's interpreter embedded as an endpoint.
Part V — Crossing Into the Host Platform
- Chapter 8A Live Desktop DashboardReal Swing listeners in Nex, and the isolation pattern a feasibility spike found and this project follows.
Part VI — Capstone: Composing What You've Built
- Chapter 9Capstone: Nex RadarFive earlier projects wired together through
intern, without any of them knowing about each other.
Appendices
- Appendix APractice IndexPractice → project → chapter lookup table.
- Appendix BBuilding and Packaging Each Project
nex compile jvm, standalone jars, and the interpreter/JVM-backend split. - Appendix CThe Project Layout ConventionWhy every project separates its library from its entry point, and what
checks.nexis for. - Appendix DReading GuideFor a reader who has not done Programming with Nex first.
- Back MatterWhat to Build NextFurther project ideas, left out of this book on purpose.