CacheGen 1.0.0.5

dotnet add package CacheGen --version 1.0.0.5                
NuGet\Install-Package CacheGen -Version 1.0.0.5                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CacheGen" Version="1.0.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CacheGen --version 1.0.0.5                
#r "nuget: CacheGen, 1.0.0.5"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CacheGen as a Cake Addin
#addin nuget:?package=CacheGen&version=1.0.0.5

// Install CacheGen as a Cake Tool
#tool nuget:?package=CacheGen&version=1.0.0.5                

CacheGen

A python inspired libary for DotNet to auto implement a Cache function for given method with Source Generator at compile Time.<br> python code looks like

@lru_cache
def fibbo(x):
   if x==0 or x==1:
       return x
   return fibbo(x-2)+fibbo(x-1)

now C# code equivalent to it will look like

[LruCache]
int Fibbo(int x)
{
   if (x == 1 || x == 0)
       return x;

   return FibboCached(x - 1) + FibboCached(x - 2);
}

notice all recursive call of Fibbo need to be replaced with FibboCached which is auto generated by compiler in following namespaces, make sure to add these on top of file

global using static LibCache.Gen;
using LibCache;
More Examples
string X = "AGGTAB";
string Y = "GXTXAYB";

Console.Write("Length of LCS is "
              + Lcs(X, Y, X.Length, Y.Length));


[LruCache(10000)]
static int Lcs(string X, string Y, int m, int n)
{
    if (m == 0 || n == 0)
        return 0;
    if (X[m - 1] == Y[n - 1])
        return 1 + LcsCached(X, Y, m - 1, n - 1);
    else
        return Math.Max(LcsCached(X, Y, m, n - 1),
                   LcsCached(X, Y, m - 1, n));
}

Recursion print backward

[LruCache]
static void Dfs(int y)
{
    if (y < 0)
        return;

    Console.WriteLine(y);

    DfsCached(y-1);
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0.5 264 10/31/2021
1.0.0.4 213 10/31/2021
1.0.0.3 212 10/31/2021
1.0.0.2 290 10/31/2021
1.0.0.1 303 10/31/2021