[nem-en] Metaphor, staging, typed reflection
Sandro Magi
smagi at higherlogics.com
Sat Jan 6 23:48:13 CET 2007
Kamil Skalski wrote:
> Quite interesting paper - it's nice to see that people are
> incorporating meta-programming concepts into commonly used frameworks
> and in addition in fairly clean way. :-)
Indeed. I found the typed reflection particularly interesting.
> [...]
> So, in short, there are two goals of Metaphor:
> - extend C# with meta-programming - it is very nice, we do the same
> but with different (IMHO more flexible, but less "scientific")
> approach
> - "In combination they enable a programmer to write statically-typed
> programs that dynamically generate code based on the structure of
> types." - I don't really see reason to dynamically (based on
> reflection) generate statically-typed programs...
Safety and efficiency are generally the driving reasons behind static
typing, and if the staged code passes Metaphor's type checker, then you
can be sure that the generated code will run not fail with a type error.
> if you are doing
> something dynamically, it is not really important that part of your
> job is a little bit statically checked. We do all this at
> compile-time, which allows you to inspect generated code and in
> contrast is more flexible than Metaphor approach.
Indeed, some safe dynamic programs will fail to type-check; it's the
trade off with any sort of static type safety.
Thanks for the overview of Nemerle! :-)
Sandro
More information about the devel-en
mailing list