Code-as-data compiler for TypeScript.
To test out the examples, compile the project with:
tsc --target es5 src\compiler\compile.ts
Then run the compiler with:
node bin\cli examples\simple.q.ts
The input file simple.q.ts:
import{Expression,LambdaExpression,}from'../src/expressions/Expression';functionfoo<TFunctionextendsFunction>(f: LambdaExpression<TFunction>){console.log(f.compile()());}foo(<LambdaExpression<()=>number>>(()=>42));Will be converted to the output file simple.ts:
import{Expression,LambdaExpression,}from'../src/expressions/Expression';functionfoo<TFunctionextendsFunction>(f: LambdaExpression<TFunction>){console.log(f.compile()());}foo(Expression.lambda<()=>number>(Expression.constant(42),[]));