Different syntax. Familiar ground.
A fresh way to
build on .NET.
Expressive code. Explicit nullability. Concurrency with structure. All on the runtime you already know.
Open source. Built for .NET. Yours to explore.
package Website.Data
import System
data class Point(X int32, Y int32)
let origin = Point(0, 0)
let moved = origin with{X = 3}
Console.WriteLine("(${moved.X}, ${moved.Y})")
Console.WriteLine(origin == Point(0, 0))
(3, 0) True
From curious to compiling
Your first G# project.
Your usual terminal.
Install the .NET 10 SDK, then create a console app. No new build system to learn.
Installation and prerequisitesCommands use the published 0.4.591 release.
dotnet new install Gsharp.Templates::0.4.591
dotnet new gsharp-console -n MyApp
cd MyApp
dotnet runHello from GSharp!
The language, in practice
Less ceremony.
More of what you mean.
Ideas from Go, Kotlin, and Swift, shaped for .NET. See what that looks like in code.
- Structured concurrency
- Useful data
- Explicit nullability
- .NET libraries
Start together. Finish together.
Channels carry values between concurrent work. A scope joins its child tasks before control moves on, and observes their failures.
Explore channels and scopeComplete source. Verified output. No simulated execution.
package Website.Concurrency
import System
func send(value int32, results chan[int32]) {
results <- value
}
let results = chan[int32](2)
scope {
go send(10, results)
go send(32, results)
}
Console.WriteLine(<-results + <-results)
42
Model the idea. Skip the boilerplate.
A data class gives you structural equality and copy-with-update. Describe your data once, then work with values that say what they mean.
Explore data typesComplete source. Verified output. No simulated execution.
package Website.Data
import System
data class Point(X int32, Y int32)
let origin = Point(0, 0)
let moved = origin with{X = 3}
Console.WriteLine("(${moved.X}, ${moved.Y})")
Console.WriteLine(origin == Point(0, 0))
(3, 0) True
Make room for the missing case.
A nullable type makes absence visible. Use if let to work with a present value, or handle the alternative explicitly.
Learn nullable flowComplete source. Verified output. No simulated execution.
package Website.Nullable
import System
func greet(name string?) string {
if let person = name {
return "Hello, $person!"
}
return "Hello, world!"
}
Console.WriteLine(greet("Ada"))
Console.WriteLine(greet(nil))
Hello, Ada! Hello, world!
A new language. Familiar libraries.
Import .NET namespaces and use familiar collections and LINQ. G# produces ordinary managed assemblies, not a separate platform.
Explore .NET interopComplete source. Verified output. No simulated execution.
package Website.Interop
import System
import System.Collections.Generic
import System.Linq
let numbers = List[int32]{1, 2, 3, 4}
let total = numbers.Where((n int32) -> n % 2 == 0).Select((n int32) -> n * 10).Sum()
Console.WriteLine(total)
60

Build something real
A useful project.
Your familiar editor.
Trail turns local files into a JSON inventory using data classes, nullable filters, channels, and a bounded worker pool. Inspect real .NET APIs in your editor, then run the complete project with the published SDK.
Find your starting point
Bring what you know.
New to G#?
Start with small, complete programs. Get a feel for the language one idea at a time.
Take the tour 02 / ConnectComing from C#?
Keep your .NET knowledge. Learn the syntax, data shapes, and conventions that differ.
The C# developer's guide 03 / TranslateComing from Go?
Recognize packages and channels. Get oriented to nullable types, exceptions, and the CLR.
The Go developer's guide 04 / ReframeComing from Kotlin?
Bring your data-class and nullable-flow intuition. Learn the .NET runtime and the differences that matter.
The Kotlin developer's guide 05 / Connect runtimesComing from Swift?
Start with familiar optionals and value types. Learn where .NET lifetime, libraries, and concurrency differ.
The Swift developer's guideOpen by design
A work in progress.
Not a black box.
G# is pre-1.0 and evolving. Read the support matrix, inspect the compiler, and explore the tests behind the language before choosing it for your project.
Get to know the project