Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Ted Leung on the air: Open Source, Java, Python, and ...
Sat, 06 Sep 2003
Macros vs byte code manipulation
Jason Marshal thinks that we should be using byte code manipulation to achieve generative programming. I think that's an interesting idea. Certainly libraries like BCEL,
jclasslib,
Javassist,
JOIE, and
serp could use improvement.
What's more interesting to me is that Jason is advocating this API based approach to code generation, but thinks that macros are more trouble than they are worth. Yet macros would give you much of the same functionality as a byte code library, although not all of it, and do it in a structured, disciplined way. So what am I missing here?
[01:21] |
[computers/programming] |
# |
TB |
F |
G |
2 Comments |
Macros allow for code reuse, certainly, but they have a tendency to muck with the language grammar, which I'm not fond of. We've had macros for quite some time, and they haven't fixed the sort of problems that people are trying to solve with Aspects, like separation of concerns.
Posted by Jason Marshall at Sat Sep 6 11:33:55 2003
Posted by Jason Marshall at Sat Sep 6 11:33:55 2003
Ok, I think I understand your perspective now. I was looking at the table of contents for Generative Programming, which I haven't read yet, and was noticing a lot of chapters on various template voodoo, which is basically just macrology.
Posted by Ted Leung at Sun Sep 7 01:10:53 2003
Posted by Ted Leung at Sun Sep 7 01:10:53 2003
You can subscribe to an RSS feed of the comments for this blog:
Add a comment here:
You can use some HTML tags in the comment text:
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
<a href>
, <em>
, <i>
, <b>
, <blockquote>
, <br/>
, <p>
, <code>
, <pre>
, <cite>
, <sub>
and <sup>
.You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk