https://github.com/falko-code/languages-foundry
Zero-allocation Code Generation for Source Generators as Speed of Light
https://github.com/falko-code/languages-foundry
csharp dotnet source-generator
Last synced: about 1 month ago
JSON representation
Zero-allocation Code Generation for Source Generators as Speed of Light
- Host: GitHub
- URL: https://github.com/falko-code/languages-foundry
- Owner: falko-code
- License: gpl-3.0
- Created: 2026-05-03T12:55:10.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-21T15:58:09.000Z (about 1 month ago)
- Last Synced: 2026-05-22T00:40:22.222Z (about 1 month ago)
- Topics: csharp, dotnet, source-generator
- Language: C#
- Homepage:
- Size: 367 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: ReadMe.md
- License: License.md
Awesome Lists containing this project
README
> [!WARNING]
> This project is under active development. The underlying C# libraries are subject to change.
#
### **LANGUAGES FOUNDRY**

#
[](https://www.nuget.org/packages?q=Falko.Foundry&prerel=false)
[](https://www.nuget.org/packages?q=Falko.Foundry&prerel=true)
[](https://dotnet.microsoft.com/en-us/download)
[](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-version-history)
[](License.md)
Fluent and Zero-Allocation Code Generation for Source Generators.
#
Example
Create `foundry.cs` file with the following content and run with `dotnet run foundry.cs`:
```csharp
#:property TargetFramework=net10.0
#:property PublishAot=true
#:package Falko.Foundry.CSharp@0.1.0
using Falko.Foundry.Compilers;
using Falko.Foundry.CSharp.Compilers;
using Falko.Foundry.CSharp.Elements;
var compiler = CSharpLanguageCompiler.Instance;
var intType = new TypeElement { Name = "Int32"u8, Namespace = "System"u8 };
var intVar = new TypeIdentifierElement { Name = "myInt"u8, Type = intType };
Console.WriteLine(compiler.CompileElement(intVar.AsLine()));
```
This simple example will output the following code:
```csharp
System.Int32 myInt;
```
For how use the library in modern ways, see the [Wiki](https://github.com/falko-code/languages-foundry/wiki) and the [Examples](Examples/) folder.
#
License
This project is licensed under the **[GNU General Public License v3.0](License.md)**.
**© 2026, Falko**