- The Zylisp Guide
- Title Page
- Copyright
- About the Cover
- Dedication
- Preface
- Forward
- Acknowledgments
- Part I: Getting Started with Zylisp
- 1. Introduction
❱
- 1.1. Why Zylisp?
- 1.2. Origins
❱
- 1.2.1. ZetaLisp
- 1.2.2. Erlang
- 1.2.3. Clojure
- 1.2.4. LFE
- 1.2.5. Go
- 1.3. The Zylisp Project
❱
- 1.3.1. Code Repositories
- 1.3.2. How It All Fits Together
- 1.3.3. Contributing
- 1.4. Book Organisation
- 2. Welcome to Zylisp
❱
- 2.1. Hello, World
- 2.2. The REPL
- 2.3. Setting Up Your Environment
- 3. A Tour of Zylisp
❱
- 3.1. Command-Line Arguments
- 3.2. Finding Duplicate Lines
- 3.3. A Web Server
- 3.4. Concurrent URL Fetching
- 3.5. Loose Ends
- Part II: Zylisp Fundamentals
- 4. Program Structure
❱
- 4.1. Expressions and S-Expressions
- 4.2. Definitions and Declarations
- 4.3. Names and Naming Conventions
- 4.4. Scope and Visibility
- 4.5. Packages and Files
- 4.6. Comments and Documentation
- 5. Basic Data Types
❱
- 5.1. Numbers
- 5.2. Booleans
- 5.3. Strings and Runes
- 5.4. Constants
- 5.5. Type Declarations
- 6. Functions
❱
- 6.1. Function Declarations
- 6.2. Parameters and Arguments
- 6.3. Multiple Return Values
- 6.4. Recursion
- 6.5. Anonymous Functions and Closures
- 6.6. Variadic Functions
- 6.7. Higher-Order Functions
- 6.8. Error Handling
- Part III: Immutable Data Structures
- 7. Lists and Sequences
❱
- 7.1. The List: Lisp's Fundamental Structure
- 7.2. List Operations
- 7.3. Immutability Guarantees
- 7.4. Sharing and Structural Sharing
- 7.5. List Comprehensions
- 8. Composite Types
❱
- 8.1. Vectors (Immutable Arrays)
- 8.2. Maps (Immutable Hash Tables)
- 8.3. Sets
- 8.4. Records
- 8.5. Working with Immutable Data
- 9. Pattern Matching
❱
- 9.1. Introduction to Pattern Matching
- 9.2. Basic Patterns
- 9.3. Destructuring
- 9.4. Guards and Conditionals
- 9.5. Pattern Matching in Function Parameters
- 9.6. Advanced Patterns
- 9.7. Implementation Notes
- Part IV: Types and Abstraction
- 10. The Type System
❱
- 10.1. Type Annotations
- 10.2. Type Inference
- 10.3. Basic Type Checking
- 10.4. Function Types
- 10.5. Parametric Polymorphism
- 10.6. Type Aliases vs New Types
- 10.7. The Unit Type and Void
- 11. Structs and Records
❱
- 11.1. Defining Structs
- 11.2. Field Access and Updates
- 11.3. Struct Embedding
- 11.4. Struct Patterns in Matching
- 11.5. Immutable Structs by Default
- 12. Methods
❱
- 12.1. Method Declarations
- 12.2. Receiver Types
- 12.3. Value Receivers
- 12.4. Method Sets
- 12.5. Composing Types with Embedding
- 12.6. Encapsulation
- Part V: Interfaces and Protocols
- 13. Interfaces
❱
- 13.1. Interfaces as Contracts
- 13.2. Defining Interfaces
- 13.3. Interface Satisfaction
- 13.4. The Empty Interface
- 13.5. Type Assertions
- 13.6. Type Switches
- 13.7. Interface Composition
- 14. Common Interfaces
❱
- 14.1. String Conversion
- 14.2. Error Handling Interface
- 14.3. Comparison and Ordering
- 14.4. Iteration Protocols
- 14.5. I/O Interfaces
- Part VI: Concurrency (The Go Way in Lisp)
- 15. Goroutines
❱
- 15.1. What Are Goroutines?
- 15.2. Creating Goroutines
- 15.3. Goroutine Lifecycle
- 15.4. Goroutines vs OS Threads
- 15.5. Example: Concurrent Server
- 16. Channels
❱
- 16.1. Channel Basics
- 16.2. Creating Channels
- 16.3. Sending and Receiving
- 16.4. Buffered vs Unbuffered Channels
- 16.5. Channel Direction
- 16.6. Closing Channels
- 16.7. Range over Channels
- 17. Concurrency Patterns
❱
- 17.1. Select Expression
- 17.2. Timeouts
- 17.3. Non-Blocking Operations
- 17.4. Pipelines
- 17.5. Fan-Out, Fan-In
- 17.6. Cancellation
- 17.7. Context
- 18. Synchronization
❱
- 18.1. When to Use Synchronization
- 18.2. Mutexes
- 18.3. Read-Write Locks
- 18.4. Atomic Operations
- 18.5. The Race Detector
- 18.6. Immutability as Synchronization
- Part VII: Organizing Code
- 19. Modules and Packages
❱
- 19.1. Package Structure
- 19.2. Import Declarations
- 19.3. Export and Visibility
- 19.4. Package Initialization
- 19.5. Internal Packages
- 19.6. Versioning and Dependencies
- 20. Testing
❱
- 20.1. Writing Tests
- 20.2. Running Tests
- 20.3. Test Coverage
- 20.4. Benchmarks
- 20.5. Example Functions
- 20.6. Property-Based Testing
- 21. Documentation
❱
- 21.1. Doc Comments
- 21.2. Generating Documentation
- 21.3. Examples in Documentation
- 21.4. Package Documentation
- Part VIII: Advanced Features
- 22. Macros
❱
- 22.1. What Are Macros?
- 22.2. Defining Macros
- 22.3. Quoting and Unquoting
- 22.4. Hygiene and Symbol Capture
- 22.5. Common Macro Patterns
- 22.6. When to Use Macros
- 22.7. Macro Debugging
- 23. More Metaprogramming
❱
- 23.1. Code as Data, Data as Code
- 23.2. Compile-Time Evaluation
- 23.3. Reader Macros
- 23.4. Syntax Objects
- 23.5. Building DSLs
- 24. Reflection
❱
- 24.1. Type Reflection
- 24.2. Value Inspection
- 24.3. Struct Tags
- 24.4. Dynamic Invocation
- 24.5. When to Use Reflection
- Part IX: Interoperability and Performance
- 25. Go Interoperability
❱
- 25.1. Calling Go Functions
- 25.2. Using Go Packages
- 25.3. Wrapping Go Types
- 25.4. CGo Integration
- 25.5. Performance Considerations
- 26. Performance
❱
- 26.1. Profiling Zylisp Programs
- 26.2. Memory Management
- 26.3. Immutable Data Performance
- 26.4. Optimization Techniques
- 26.5. When to Drop to Go
- 27. Unsafe Operations
❱
- 27.1. The unsafe Package
- 27.2. Mutable Operations
- 27.3. Raw Pointers
- 27.4. When Unsafe is Justified
- Appendices
- 28. Appendix I: Syntax Reference
❱
- 28.1. S-Expression Grammar
- 28.2. Special Forms
- 28.3. Built-in Functions
- 28.4. Reserved Words
- 29. Appendix II: Standard Library Overview
❱
- 29.1. Core Functions
- 29.2. Data Structure Libraries
- 29.3. I/O and File System
- 29.4. Networking
- 29.5. Concurrency Utilities
- 29.6. Testing Utilities
- 30. Appendix III: Pattern Matching Reference
❱
- 30.1. Pattern Syntax
- 30.2. Pattern Types
- 30.3. Match Expression Forms
- 30.4. Implementation Details
- 31. Appendix IV: Type System Reference
❱
- 31.1. Type Syntax
- 31.2. Type Inference Rules
- 31.3. Subtyping Relations
- 31.4. Generic Type Parameters
- 32. Appendix V: Comparison with Other Lisps
❱
- 32.1. From Common Lisp
- 32.2. From Scheme/Racket
- 32.3. From Clojure
- 32.4. From LFE
- 33. Appendix VI: Comparison with Go
❱
- 33.1. Syntax Mapping
- 33.2. Idiom Translation
- 33.3. What's Different
- 33.4. What's the Same