http://qs321.pair.com?node_id=182003


in reply to What do you know about source filters?

I hate source filters, it reeks preprocessing. Preprocessors usually don't know much of the language they generates and that leads to defensive programing:

#define ADD(a,b) a+b /* I should have writen (a+b) */ ADD(1,2)*3 /* gives 7 instead of 9 */

If you are not convinced of preprocessor horrors, looks at the source of perl5. Yes, the C preprocessor gets us around the limitation of the language and it is one of the reason why C is still well alive. See the GNU macros that allows the same include files to be both K&R and ANSI-C. It works but it is not pretty. Parrot is indded written in C.

But, I like TheDamian source filters because it gets me the perl6 flavor. So, I can get over my dislike of source filters. But they are still a hack.

But really with perl6, I hope we will be able to deal with any input without pipelining processors.

But there is more indeed to source filters than filters that translate a language in a lesser language. Your examples show that source filters can be useful _and_ lovable.

-- stefp -- check out TeXmacs wiki