So basically, automated language-oriented programming. I've tried finding info on this concept, but have had some trouble, probably because my brain is having a bit of trouble grasping the subject while thinking about it. It could be better defined as metaprogramming going to a deeper level- rewriting the programming language it is written in as well as or instead of the program itself.

Theoretically, through this a program would be able to operate on an infinite number of levels. I think this should be a key part of artificial intelligence, as we humans have written numerous programming languages all on top of each other and from scratch, so our programs should be able to as well.

How or why someone would ever do this is not the question. The better question is, "why not?"

If you are able to answer this question, don't worry because I have more to back it up. What programming languages would be best for this kind of thing, and what are some terms I can use in the future to better describe and grasp this concept?

  • 3
    $\begingroup$ "would be best" is inherently opinionated. Hard to tell. Anyway, I guess it's hard for us to answer this, since there is no clearly formulated question. I'm not sure if CS.SE is appropriate for this, since, AFAICS, you seek comments and opinions rather than answers and facts. It's also probably too broad. $\endgroup$ – chi Feb 16 '17 at 18:28
  • 3
    $\begingroup$ Welcome to CS.SE! I don't understand what your question is. What specifically is your question? It sounds like you are trying to tee up a general topic area for discussion, but I don't see a specific answerable question. We aren't like other sites you might be familiar with, and we aren't a discussion forum. Rather, this site is for specific questions, where you have a single answerable technical question about computer science. Please make sure you articulate a single question in your post (if you have others, post them separately). $\endgroup$ – D.W. Feb 16 '17 at 18:45
  • 1
    $\begingroup$ What do you mean by write a programming language? What sort of result do you imagine? For a program that writes C (the programming language), what is its output? C programs? Or a C compiler or interpreter? In that case, does a compiler compiler qualify? $\endgroup$ – reinierpost Feb 16 '17 at 22:47
  • 1
    $\begingroup$ The notion of a meta-program that can "reprogram" the language in which the meta-program is written is (or is closely related to) a notion called (behavioral) reflection. I wrote a fairly technically detailed blog post about this here: hedonisticlearning.com/posts/behavioral-reflection.html $\endgroup$ – Derek Elkins left SE Feb 17 '17 at 1:41

Of course we could in principle auto-generate a full programming language. First we'd have to say what being a full programming language actually entails. Here is my attempt:

  • Syntax of programs.
  • A notion of value (programs that have no further reductions, but are not stuck).
  • A reduction relation giving the operational semantic.
  • A notion of program equality.

All of this can be specified syntactically and generated by a computer. There are tools for part of this purpose, e.g. Ott, but specifying the whole operational semantics of a realistic PL is extremely hard work. One could argue that for example the C used in programming the Linux kernel is only specified by the official GCC version used for compilation of the kernel.

As specifying all of this is such a pain, nobody has so far produced a full-spectrum meta-programming tool. At this point it is not clear how it would look like and how it would help.

| cite | improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.