A compiler framework for managed code.
Flame is a collection of C# libraries for building tools that read, analyze, optimize and write managed languages. Things you can build with Flame include optimizing compilers, IL optimizers, static analyzers and more.
Key features include:
For an introduction to Flame's main concepts see A brief introduction to Flame.
At its core, Flame is a set of libraries designed to support tools that read, analyze, optimize and write managed languages. Additionally, Flame includes a number of projects that use Flame in a fairly straightforward way.
ilopt
ilopt
is an ahead-of-time optimizer for CIL assemblies, that is, ilopt
is a fairly simple command-line tool that reads CIL assemblies, optimizes them and writes the optimized version back to disk.
ilopt
currently understands most if not all of the CIL opcodes generated by the C# compiler. Other opcodes may not be supported yet. For an overview of single-file C# programs that ilopt
can definitely optimize, take a look at the ilopt
test programs.
Flame is a C# project that targets .NET 4.5 implementations, like Mono and the .NET framework. .NET Core is not supported yet because Flame relies on NuGet packages that don't yet support .NET Core.
Additionally, Flame uses EC# macros to convert Flame IR rewrite rule DSL to C# code.
Building Flame is easy if you're on Linux or Mac OS X. Just spell
$ make nuget
$ make
That's it. The above will grab NuGet dependencies, compile EC# macros down to regular C# and build the project.
To run the unit tests, type
$ make test
Building Flame is somewhat more challenging on Windows. If at all possible, use a GNU Make implementation to run the Makefile, same as for Linux and Mac OS X.
Otherwise, you will need to do the following:
nuget restore
).msbuild /p:Configuration=Release FlameMacros/FlameMacros.csproj
).make dsl
in the Makefile, otherwise FlameMacros/bin/Release/LeMP.exe --macros FlameMacros/bin/Release/FlameMacros.dll --outext=.out.cs file.ecs
for all .ecs
files).msbuild /p:Configuration=Release Flame.sln
).Run the unit tests by spelling
UnitTests\bin\Release\UnitTests.exe all
Windows workflow enhancements welcome!