0

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.

Yrogirg
  • 2,301
  • 3
  • 22
  • 33
  • What languages does your research suggest? What languages have you found that don't quite fit the bill, and why? – Marcin Apr 09 '12 at 09:23
  • @Marcin I've tried pure, but it's representation for reflection is clumsy. For example if-then-else and guards are represented distinctly. – Yrogirg Apr 09 '12 at 09:39
  • So, update your answer accordingly. – Marcin Apr 09 '12 at 09:42

2 Answers2

5

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

alvin
  • 1,176
  • 8
  • 15
0

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.

svick
  • 236,525
  • 50
  • 385
  • 514