From Beginner to Expert : A Complete Guide to Modern .NET Development with Go, Kotlin, and Swift Ergonomics
Introduction : Why Another Language?
Chapter 1: What Is G#? : A Modern Language for the .NET Era
- The Problem G# Solves : Too Many Languages, Too Much Ceremony
- Origins and Vision : David Obando, CSharp Meets Go
- Design Principles : Small Surface, Full Power
- Where G# Fits : Compared to C#, F#, Go, Kotlin, Swift
- Current Status and Ecosystem : Version 0.4, Tooling Landscape
- Who Should Read This Book : Prerequisites and Roadmap
Chapter 2: Getting Started : Installation, Tooling, and Your First Program
- Prerequisites : .NET SDK Versions and Verification
- Installing the MSBuild SDK and Templates
- Setting Up Visual Studio Code with the G# Extension
- The gsc Compiler : Direct Compilation Without Projects
- The gsi REPL : Interactive Exploration and Scripting
- Your First Program : Hello, World and Beyond
Chapter 3: Language Foundations : Syntax, Packages, and Basic Structure
- Source Files and the Compilation Unit
- Package Declarations and Organization
- Imports : Bringing Namespaces into Scope
- Comments : Line, Block, and Documentation Comments
- Visibility and Access Modifiers
- Coding Conventions and Style Guidelines
Chapter 4: Variables, Constants, Types, and Values
- Declarations : var, let, const and When to Use Each
- Primitive Types : Numbers, Booleans, Characters, Strings
- Numeric Widths and Aliases : int32 vs int and Why It Matters
- Nullability : nil, T?, and Safe Access Patterns
- Operators and Precedence : Arithmetic, Comparison, Logical, Bitwise
- Expressions and Statement Semantics
Chapter 5: Control Flow : Branching, Looping, and Pattern Matching
- Conditional Statements and Expressions : if/else Rules and Patterns
- Nullable Unwrapping : if let, guard let, while let
- Loops : for, while, do-while, range Iteration
- Switch Statements and Expressions : No Fallthrough Design
- Pattern Matching : Types, Lists, Properties, Relational, Combinators
- Smart Casts and Type Narrowing
Chapter 6: Functions : The Building Blocks of Behavior
- Function Declarations : func Syntax and Signatures
- Parameters : Named, Positional, Variadic, and Default Values
- Return Values and Expression Bodies
- Closures and Captured Variables
- Lambdas and Arrow Functions
- Higher-Order Functions and Functional Patterns
Chapter 7: Data Structures : Structs, Classes, and Collections
- Structs : Value Types with Instance Methods
- Classes : Reference Types, Identity, and Inheritance
- Data Types : Structural Equality, Deconstruction, with-Copy
- Interfaces : Contracts, Default Methods, Generic Constraints
- Arrays, Slices, and Rectangular Arrays
- Maps, Sequences, and CLR Collections
Chapter 8: Error Handling and Resource Management
- Exceptions in G# : CLR Model and throw as Expression
- Try/Catch/Finally : Catching Specific Types
- Custom Exception Types : When and How to Define Them
- Defer Statements : Guaranteed Scope Cleanup
- Using Declarations : RAII for Disposable Resources
- Error Handling Patterns : When to Throw vs Return nil
Chapter 9: Generics, Type Parameters, and the Advanced Type System
- Generic Functions and Types : Syntax and Instantiation
- Constraints : any, comparable, Interface Bounds, Base Classes
- Variance : in/out Covariance and Contravariance
- Inline Structs : Single-Field Value Wrappers
- Discriminated Unions via Payload-Bearing Enums
- Advanced Patterns : Type Tests, Conditional Logic
Chapter 10: Concurrency : From Async/Await to Structured Concurrency
- Asynchronous Functions : async func and Task[T]
- Await Expressions and Suspension Semantics
- Structured Concurrency with scope
- Async Streams : async sequence[T] and await for
- Go-Flavored Concurrency : go, chan T, select (Opt-In)
- Concurrency Safety : Shared State, SyncMap, Locks
Chapter 11: .NET Interoperability : Using the Full Ecosystem
- Calling CLR APIs : Types, Constructors, Properties, Methods
- Static Imports and Namespace Aliases
- Extension Functions : Go-Style Receivers and LINQ
- Events and Delegates : +=/-= Wiring Patterns
- Attributes : Kotlin-Style Syntax and Targets
- Native Interop : P/Invoke, LibraryImport, Function Pointers
Chapter 12: Development Workflow : Building, Testing, Debugging, and Refactoring
- Project Structure and .gsproj Configuration
- Build Options : Targets, TFMs, References, Deterministic Builds
- Testing with xUnit/NUnit/MSTest from G#
- Debugging : Breakpoints, Watch Expressions, PDBs
- Profiling and Performance Analysis
- The cs2gs Migration Tool : Moving C# to G#
Chapter 13: Architecture, Idioms, and Production Engineering
- Effective G# : Idiomatic Patterns from the Official Guide
- Package Design : Small Packages, Explicit APIs
- Design Patterns in G# : Repository, Factory, Observer, Strategy
- Performance Characteristics : JIT, GC, IL Generation, Profiling
- Security Considerations : Sandboxing, Input Validation, AOT
- Deployment : Single-File Publishing, WebAssembly, Containerization
Conclusion : The Future of G# and Your Next Steps
- What We Have Covered : Key Takeaways
- G# Today vs Tomorrow : Honest Assessment of Maturity
- When to Choose G# : Decision Framework
- Contributing and Community Engagement
- Where to Go From Here : Resources and Next Steps
