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:
| Sample | Content |
|---|---|
| Playground in the browser | samples/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 API | samples/MinimalApi: a web API with routes, JSON bodies, dependency injection and an async handler. It runs as a project or with typhon run. |
| Blazor apps | samples/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 browser | samples/WasmLife: Conway’s Game of Life, written in plain Python, running in the browser on the .NET WebAssembly runtime. |
| Desktop apps | samples/Desktop: the same to-do app in Windows Forms, WPF and WinUI 3. |
| Godot | samples/GodotBench: a Godot project that runs the same GDScript file in Godot’s GDScript VM and compiled by Typhon. |
Further samples
| Sample | Content | Explained in |
|---|---|---|
samples/HelloTyphon | A console application whose sources are .ty files only. | Quick start |
samples/TyphonLib, samples/CSharpApp | A 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/XunitTests | xUnit tests written in Typhon, run with dotnet test. | Quick start |
samples/scripts | tour.ty, a tour of the language, and features.ty, which prints a checkable line per feature. Both run with the typhon command. | Quick start |