Skip to main content
Version: Next

A Tour of G#

Welcome to a quick tour of G#. Each chapter introduces one small part of the language with short, compiler-checked examples.

G# is a modern .NET language with Go-, Kotlin-, and Swift-style ergonomics. You will see packages, imports, func, structs, classes, arrays, slices, maps, collection initializers, nullable flow, structured concurrency with scope, and direct calls into CLR libraries.

Chapters

  1. Basics — variables, constants, functions, printing, primitive types, and ??.
  2. Types and values — structs, data structs, data classes, classes, arrays, slices, maps, collection initializers, and anonymous objects.
  3. Control flowif, switch, for, while, if let/guard let, ranges, throw expressions, ++/--, labels, and goto.
  4. Concurrencyscope, async/await, and async sequence[T].
  5. .NET interop — imports, CLR types, static imports, aliases, extension functions, LINQ, events, native interop, and unsafe pointers.

If you have not installed the tools yet, start with Install G#. If you want the shortest possible first program, use Quickstart: Hello, G#.

Next: Tour: Basics.