Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Ok, I dont diasgree with your general points here. And I wasnt using VB as an example of good macro system. Just pointing out that it isn't a indication that a language is FSP. :-)

One issue I have however is that I dont think many people would consider parse tree access a necessary feature of a macro langauge. Yes of course it makes a lot of sense, but I dont think that many people would instantly think of parse tree access if you mentioned macros to them. And to a certain extent I think that macros that do have this type of power arent really macros any more, but rather some part of the language that provides some behaviour (and more no doubt) that traditionally was left to a macro preprocessor. For instance, would you consider an inline sub to be a macro? Howabout a Template Class?

My point here is that the use of macros for language extension is indiciative that the language is missing needed features at an integrated level. If LW and co want to provide a general solution that involves very macro like things that have oodles of power and flexibility then fine, but I think the term "macro" is a loaded one and using it when you really mean "macro like subroutines with introspective features such as parse tree access" is inclined to lead towards confusion.

I think also that in general that macros arent used for language extension. I think more often than not they are used for inlining and conditional compilation. Consider Aristotle made some points about Assert(). This example however is only a combination of inlining and conditional compilation, and as far as a source filter goes wouldnt be that hard to write (with a few minor constraints). As for Templating Ala C++ Template Classes, this also isnt particularly difficult to do in perl (albeit a touch klunky).

Granted that real language extension like Switch and try{}catch{}, is hard. But to me the issue with these is that they are missing at all, not that Perl is missing a sufficiently powerful mechanism to write them ourselves. While I personally think that providing a general extend the language mechanism with macro like features to be a powerful approach, I can only wonder what the result will be. For instance with(). I think that because LW for some reason doesnt like it (no doubt for good reasons), we will end up with a number of modules providing it with slightly different syntax. Likewise for other features the language is missing. Eventually we could find that this langauge extension facility actually undermines the cohesion of the overall codebase. (I have 5 Perl6 programs, and I need 40 different syntax extensions installed for them to compile because each one uses a different set.) I look forward to seeing what happens.


---
demerphq

<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...

In reply to Re: Re: Re: Macros, LFSPs and LFMs by demerphq
in thread Macros, LFSPs and LFMs by stefp

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-03-19 05:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found