Reflective Language for Symbolical Computations

109 Views Asked by At

I'm seeking for a language that operates on programs, written in that very language. That is a language whose programs are the primary (possibly the only) objects of that language.

Something like self-program transformation language, made solely with this point of view in mind.

Motivation is the following:

Having a program P1 meant to compute Real -> Real I want to have a program P2 which would take P1 and transform it to a symbolical derivative (or an antiderivative) of P1. Obviously P2 might fail to do a proper work on most of the inputs.

One might view it as a pattern matching against lambdas. But a very convenient pattern matching.

2

There are 2 best solutions below

0
On

I think C# Expression Trees (or F# quotations) could be used for this. They are by far not the primary (or the only) objects of those languages but I they should let you do this nicely.

0
On

lisp/scheme/racket. or are you looking for something else?