From First Steps to Language-Oriented Programming
Introduction: Why Racket?
- The Racket Promise: One Language to Rule Them All
- Where Racket Shines and Where It Does Not
- A Brief Tour of What You Will Build
- How to Read This Book
Chapter 1: Origins and Philosophy
- From Lisp to Scheme to PLT Scheme to Racket
- The Homage Report: Designing a Language for Language Design
- Homoiconicity and Code as Data
- The Read-Eval-Print Loop and Interactive Development
- When Racket Is the Right Tool
Chapter 2: Getting Started with Racket
- Installing Racket on Your System
- DrRacket: The Integrated Development Environment
- The REPL and Interactive Exploration
- Your First Programs: From Hello World to Simple Calculations
- Project Structure and File Organization
Chapter 3: Expressions, Values and the Language Core
- S-Expressions: Parentheses as Structure
- Literals: Numbers, Strings, Characters, Booleans, Symbols
- Variables, Definitions and Bindings
- Functions: Definition, Application and Arguments
- The Evaluation Model: How Racket Computes
Chapter 4: Control Flow and Recursion
- Conditionals: cond, if, when, unless and case
- Recursion as the Foundation of Repetition
- Tail Calls and Efficient Recursion
- Iteration with map, filter, foldl and foldr
- Pattern Matching for Structural Decomposition
Chapter 5: Data Structures and Collections
- Pairs and Lists: The Fundamental Building Blocks
- Vectors for Indexed Access
- Strings and Characters in Practice
- Hash Tables and Sets for Efficient Lookup
- Choosing the Right Collection for the Job
Chapter 6: Structured Data, Contracts and Safety
- Defining Structures with struct
- Accessors, Mutators and Predicates
- Contracts: Runtime Guarantees Between Modules
- Structured Error Handling with Exceptions
Chapter 7: Functional Programming in Racket
- Higher-Order Functions: Functions That Take Functions
- Closures and Lexical Scoping
- Immutability and Side Effects
- Functional Design Patterns in Racket
- When to Mutate and When Not To
Chapter 8: Modules, Libraries and Organization
- The Module System: require and provide
- Creating Your Own Libraries
- Language Pragmas and #lang Choices
- Package Management with raco pkg
- Documentation with Scribble
Chapter 9: Macros and Metaprogramming
- What Macros Are and Why They Matter
- Syntax Objects and the Quote/Unquote Model
- Writing Your First Hygienic Macro
- Pattern Matching in Macro Definitions
- Building Domain-Specific Language Constructs
Chapter 10: Object-Oriented Programming in Racket
- Classes and Objects: The Basics
- Inheritance and Super Calls
- Interfaces and Mixins for Flexible Design
- When to Use OOP in Racket
Chapter 11: Concurrency, Parallelism and Performance
- Threads and Lightweight Concurrency
- Synchronization: Semaphores, Channels and Mutual Exclusion
- Futures and Parallel Computation
- Parallel Threads in Racket 9.0+
- Profiling and Performance Tuning
- Optimizing Hot Paths in Racket
Chapter 12: Input/Output, Files and Networking
- Ports and Streams for I/O
- Reading and Writing Files
- Command-Line Applications with racket/cmdline
- Networking Basics: TCP and UDP
Chapter 13: Web Development and Databases
- Building a Web Server with racket/web-server
- Routing and Request Handling
- Templates and Dynamic HTML Generation
- Database Access with DB Libraries
- A Complete Small Web Application
Chapter 14: GUI Development and Desktop Applications
- The racket/gui Framework Overview
- Building Windows and Dialogs
- Widgets, Layouts and Event Handling
- A Small Desktop Application Example
- When GUI Development in Racket Makes Sense
Chapter 15: Language-Oriented Programming and DSLs
- What Is a Language in Racket?
- Creating Your Own #lang
- Custom Readers and Syntax Extensions
- Building a Practical DSL from Scratch
- The Philosophy of Language-Oriented Programming
Conclusion: Architectural Guidance and Next Steps
- Idiomatic Racket Design Principles
- Project Architecture at Scale
- Performance and Maintainability Practices
- Deployment and Distribution Options
- Further Learning Resources and Community
- Quick Reference: Key Forms, Functions and Conventions