next up previous
Next: Related Work Up: Discussions Previous: Discussions

Runtime Performance:

Since reflective languages use meta-circular interpreters as their execution model, naively implemented reflective systems suffer from the interpretation overhead. Reducing this overhead is necessary to make reflection feasible for practical parallel programming. To solve this problem, we have already proposed a compilation framework using partial evaluation[6]. This framework essentially removes the interpretation of the meta-level interpreter, and generates a program that includes the effect of user's modification at the meta-level. For example, from the definition of product with {replicate ...} annotation in Figure 8 and the extended meta-interpreter shown in Figure 9, our compiler can generate the following code, which does not involve interpretation:
(defun product (v1 v2)
(let ((sum 0.0) (size (size-of v1)))
(if (< 20 size)
(let ((t001 (denotation
(copy-object (meta v2)))))
(dotimes (i size)
(setf sum
(+ sum (* (nth-element v1 i)
(nth-element t001 i)))))
(copy-back (meta t001))
sum)
(progn
(dotimes (i size)
(setf sum
(+ sum (* (nth-element v1 i)
(nth-element v2 i)))))
sum))))


This code is nearly as same as the optimal code that the user would
manually write in order to implement replication requests.

The problem of this compilation technique is that the partial
evaluation is not ultimate; a partial evaluator might generate an
inefficient code for some meta-programs. In addition, our current
compilation framework handles only evaluator objects. Making
customized meta-objects efficient is a subject of future research.

(defun product (v1 v2) (let ((sum 0.0) (size (size-of v1))) (if (< 20 size) (let ((t001 (denotation (copy-object (meta v2))))) (dotimes (i size) (setf sum (+ sum (* (nth-element v1 i) (nth-element t001 i))))) (copy-back (meta t001)) sum) (progn (dotimes (i size) (setf sum (+ sum (* (nth-element v1 i) (nth-element v2 i))))) sum)))) This code is nearly as same as the optimal code that the user would manually write in order to implement replication requests. The problem of this compilation technique is that the partial evaluation is not ultimate; a partial evaluator might generate an inefficient code for some meta-programs. In addition, our current compilation framework handles only evaluator objects. Making customized meta-objects efficient is a subject of future research.
next up previous
Next: Related Work Up: Discussions Previous: Discussions
Matt Hurlbut
1998-07-14