Questions tagged [meta-programming]

Meta-programming is the writing of programs with the ability to treat programs as their data.

1
vote
3answers
92 views

Meta-computational complexity?

Computational complexity asks the following question: Given a problem $P$, what is the time-cost of the lowest time-cost machine $M^*$ that solves $P$? But this misses a certain aspect of the ...
0
votes
1answer
19 views

Is it possible to define a pairwise function that can either append to a tuple or make a tuple, potentially with nested tuples?

I lack the vocabulary to appropriately express the question succinctly, so I apologize if the title question is confusing. Suppose you can define a binary infix operator that produces tuples, and you ...
5
votes
1answer
152 views

Implementing a Compiler with Macros

I've been thinking about embedded languages (domain-specific or otherwise), and in particular the approach where we define a datatype to represent terms of the embedded language, e.g. (in Haskell): <...
1
vote
3answers
111 views

Is it possible to define branches which, once taken once, will become the default forever?

Assuming I have a very simple branching: switch on var: 1 => branch1 2 => branch2 default => branch3 And I wish to implement a program that will ...
1
vote
1answer
106 views

Metaprogramming taken to an unnecessarily high level- how can a program write not just other programs, but a programming language? [closed]

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 ...
3
votes
2answers
1k views

Is Terra the only system programming language able to compile code at runtime? [closed]

I stumbled across Terra last year, and the most similar language I can think of is Julia. Terra is inspired by and uses Lua for templating/metaprogramming instead of being derived from e.g. the Lisp ...
5
votes
4answers
108 views

Reviews of work in the field of partial evaluation (post 1993)

I'm looking for relatively new reviews of research work on partial evaluation. The most recent work I've found is "Tutorial notes on partial evaluation" by Charles Consel and Olivier Danvy (1993). The ...
22
votes
3answers
3k views

What are staged functions (conceptually)?

In a recent CACM article [1], the authors present an implementation for staged functions. They use the term as if it was well-known, and none of the references looks like an obvious introduction. ...