Akbura beta-6: 2.5x faster compiler and reactive C# expression bindings
Akbura 12.0.4-beta.6, an experimental declarative markup language and compiler for Avalonia, cuts cold code generation in the FeatureGallery project from 15.31s to 6.06s and reduces allocations by roughly 69%. The headline feature is ${x.bind ...}, which turns strongly typed C# expressions written in markup into one-way reactive bindings that track nested property changes.
Key points
- Cold code generation drops from 15.31s to 6.06s in FeatureGallery and from 2.38s to 1.78s in PurityUI.
- Allocations fall by roughly 68-69 percent in both projects, from 3327 MiB to 1040 MiB in FeatureGallery.
- The new ${x.bind ...} syntax evaluates C# expressions in markup and tracks nested property changes.
- Expression bindings are one-way and complement Avalonia's ${Binding ...} rather than replacing it.
- Hot Reload now preserves compatible component state and fixes command closure updates and styled control names.
- The compiler and Workspaces move to Roslyn 5.9.0; the package needs .NET SDK 10.0.400 and the extension VS 2026 18.9.
Akbura, an experimental declarative markup language and compiler for Avalonia, ships its sixth beta with compiler optimizations. The author pooled temporary collections, buffers and StringBuilder instances, dropped intermediate LINQ objects, cached Roslyn symbol strings and AKCSS metadata, and writes common fully qualified type names into the output. Benchmarks on .NET 10 in Release via RunGenerators cut cold generation in FeatureGallery from 15.31s to 6.06s and allocations from 3327 MiB to 1040 MiB.
The other addition is ${x.bind ...}, which lets strongly typed C# expressions live in markup and be validated by Roslyn. Bindings handle arithmetic, string interpolation, conditionals and collection indexers, and replacing an intermediate object rebuilds subscriptions without re-rendering the component. They are one-way and complement, not replace, Avalonia's ${Binding ...}. The package requires .NET SDK 10.0.400 or newer.
Real-world use
- An MVVM Avalonia desktop app deriving display text in markup from nested ViewModel objects such as a selected customer and its address.
- Driving element appearance entirely from state by binding AKCSS utility-style conditions to ViewModel properties.
- Reducing incremental source generator time and build-time memory pressure in large Avalonia solutions.
- Iterating on markup and styles with Hot Reload in Visual Studio without losing component state.
Why it matters
Source generator time and allocation cost directly shape build and editor experience in large Avalonia codebases, while reactive expression bindings remove the need to add throwaway properties to the ViewModel for simple derived values.