1
1
---
2
2
layout : doc-page
3
- title : " Symmetric Meta Programming"
3
+ title : " Principled Meta Programming"
4
4
---
5
5
6
- # Symmetric Meta Programming
6
+ # Principled Meta Programming
7
7
8
- Symmetric meta programming is a new framework for staging and for some
8
+ Principled meta programming is a new framework for staging and for some
9
9
forms of macros. It is expressed as strongly and statically typed
10
10
code using two fundamental operations: quotations and splicing. A
11
11
novel aspect of the approach is that these two operations are
@@ -16,7 +16,7 @@ splices in exactly the same way.
16
16
17
17
### Quotes and Splices
18
18
19
- Symmetric meta programming is built on two well-known fundamental
19
+ Principled meta programming is built on two well-known fundamental
20
20
operations: quotation and splicing. Quotation is expressed as
21
21
` '(...) ` or ` '{...} ` for expressions (both forms are equivalent) and
22
22
as ` '[...] ` for types. Splicing is expressed as a prefix ` ~ ` operator.
@@ -113,13 +113,13 @@ create nor remove quotes or splices individually. So the PCP ensures
113
113
that program elaboration will lead to neither of the two unwanted
114
114
situations described above.
115
115
116
- In what concerns the range of features it covers, symmetric meta programming is
116
+ In what concerns the range of features it covers, principled meta programming is
117
117
quite close to the MetaML family of languages. One difference is that MetaML does
118
118
not have an equivalent of the PCP - quoted code in MetaML _ can_ access
119
119
variables in its immediately enclosing environment, with some
120
120
restrictions and caveats since such accesses involve serialization.
121
121
However, this does not constitute a fundamental gain in
122
- expressiveness. Symmetric meta programming allows to define a ` Liftable `
122
+ expressiveness. Principled meta programming allows to define a ` Liftable `
123
123
type-class which can implement such accesses within the confines of the
124
124
PCP. This is explained further in a later section.
125
125
@@ -307,7 +307,7 @@ Here’s an application of `map` and how it rewrites to optimized code:
307
307
308
308
### Relationship with Inline and Macros
309
309
310
- Seen by itself, symmetric meta-programming looks more like a
310
+ Seen by itself, principled meta-programming looks more like a
311
311
framework for staging than one for compile-time meta programming with
312
312
macros. But combined with Dotty’s ` inline ` it can be turned into a
313
313
compile-time system. The idea is that macro elaboration can be
0 commit comments