Browse the documentation

All samples

The sample projects in the Typhon repository, from a console app and C# interoperability to web apps, a browser app, tests and scripts.

The samples folder of the Typhon repository contains projects that show Typhon in different kinds of .NET applications. Except for the scripts, every sample is an ordinary .NET project that dotnet run or dotnet test builds and starts.

Highlighted samples

These samples have pages of their own:

SampleContent
Playground in the browsersamples/Playground: an editor in the browser that compiles and runs Typhon code. The compiler, Roslyn and the program run in a Blazor WebAssembly app, without a server. This website hosts it at /playground/.
ASP.NET Core minimal APIsamples/MinimalApi: a web API with routes, JSON bodies, dependency injection and an async handler. It runs as a project or with typhon run.
Blazor appssamples/BlazorApp and samples/BlazorWasm: Blazor apps whose components keep their markup in .razor files and their logic in .ty files, one rendered on the server and one running in the browser.
WebAssembly in the browsersamples/WasmLife: Conway’s Game of Life, written in plain Python, running in the browser on the .NET WebAssembly runtime.
Desktop appssamples/Desktop: the same to-do app in Windows Forms, WPF and WinUI 3.
Godotsamples/GodotBench: a Godot project that runs the same GDScript file in Godot’s GDScript VM and compiled by Typhon.

Further samples

SampleContentExplained in
samples/HelloTyphonA console application whose sources are .ty files only.Quick start
samples/TyphonLib, samples/CSharpAppA class library written in Typhon, and a C# application that uses it and mixes .cs and .ty files in one project.Typhon in a C# project
samples/XunitTestsxUnit tests written in Typhon, run with dotnet test.Quick start
samples/scriptstour.ty, a tour of the language, and features.ty, which prints a checkable line per feature. Both run with the typhon command.Quick start