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


In reply to Re: What do you know about source filters? by stefp
in thread What do you know about source filters? by Beatnik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.