Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Overv/lambda

Compile anonymous functions based on C# lambda expressions at runtime.
https://github.com/Overv/lambda

Last synced: 3 months ago
JSON representation

Compile anonymous functions based on C# lambda expressions at runtime.

Awesome Lists containing this project

README

        

# lambda

This is an experimental library for compiling anonymous functions based on C#'s lambda expressions at runtime. It serves as a minimal example of runtime code generation and not necessarily something useful in practice. The library only supports the x86 instruction set as of this time.

## Sample

```c
#include
#include

int main()
{
int x;

lambda_func f = lambda_compile("3xx+5x-9");

for (x = 1; x <= 10; x++) {
printf("%d squared = %d\n", x, f(x));
}

lambda_cleanup(f);

return 0;
}
```

## Todo

* Floating point numbers
* Bracket support

## License

MIT