[<<][staapl][>>][..]
Sun Sep 28 07:57:56 CEST 2008

typed vs. untyped metaprog

I'm not really convinced about the benefits of typed metaprogramming.
The important issues are hygiene and the use of algebraic datatypes
for code transformations.  The fact that type errors get cought at
generator compile time instead of generator execution time hower seems
a bit moot.  This only makes sense when one writes generators that are
not used and so not tested.

MetaOcaml is a nice system though.  It does what it's supposed to do,
and the offshoring to C is particularly interesting: in that setting
typed metaprogramming does make sense.  Generating C code from Scheme
requires one deals with types in some way, which is not entirely
trivial.

However, Staapl has proper hygiene and models generators as closures.
The fact that it can generate ill-typed _generators_ doesn't seem to
be such a problem since this is still detected at generator execution
time.

Note however that Staapl isn't completely untyped.  On the ADT level
(the machine instruction opcodes) some static checking is definitely
possible: Coma primitives and composition mechanism are both
accessible and are _already_ compile-time computations.

Typing the Scheme->Coma unquote operation could be replaced by
cross-stage persistance only: require functions to always use a
let-macro form such that type info can travel at compile time using
local syntax bindings, and always interpolate Scheme lexical values as
[qw ...] generators, or provide a let-constant form.



[Reply][About]
[<<][staapl][>>][..]