Re: Staged Computation in Qi
I skimmed this paper rather quickly. Hope this is of some use.
QUOTE
MetaML has three staging annotations: Brackets h i, Escape ~ and Run
run . An expression hei defers the computation of e; ....and run e
evaluates e to obtain a deferred expression, and
then evaluates it.
UNQUOTE
p 2.
This, or something like it, is already in Qi II
http://www.lambdassociates.org/Book/page153.htm
As regards eval, eval is in Qi, but has no type theory for it.
http://www.lambdassociates.org/Book/page131.htm
However it is possible to program Qi to typecheck eval.
eg.
Qi II 2008, Copyright (C) 2001-2008 Mark Tarver
www.lambdassociates.org
version 1.05
(0-) (tc +)
true
(1+)
(datatype metaQi
F : (A --> B);
X : A;
__________________
(eval [F X]) : B;)
metaQi : symbol
(2+) (eval [sqrt 6])
2.4494898 : number
That is a demo, you do need more sequent rules to capture the type
theory of eval. But you see the idea.
In general Qi has implicitly 'meta' built in to it by dint of its
programmability.
Mark
On 6 May, 20:27, Marc Coram <marc.co...@...> wrote:
> I'm writing because I want to understand how expressive Qi is for
> describing staged computations. For example, an elegant theoretical
> system is described in the paper "An Idealized MetaML: Simpler and
> More Expressive" by Moggi, Taha, Benaissa, Sheard (see, for example,
> section 3.2 which gives an interactive session). It provides operators
> bracket, escape, and run which are formal analogues of back-quote,
> comma, and eval in scheme along with others like box, unbox, compile,
> etc....
>
> Is Qi capable of expressing the same operational semantics? Is there a
> more native Qi idiom for similar ideas?
>
> References:
> "An Idealized MetaML: Simpler and More Expressive":http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.42.6938
> "Macros as Multistage Computations":http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.110.7706
>
> --
> You received this message because you are subscribed to the Google Groups "Qilang" group.
> To post to this group, send email to qilang@...
> To unsubscribe from this group, send email to qilang+unsubscribe <at> googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/qilang?hl=en.
--
--
You received this message because you are subscribed to the Google Groups "Qilang" group.
To post to this group, send email to qilang@...
To unsubscribe from this group, send email to qilang+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/qilang?hl=en.