Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror

Comment Re:Holy syntax overload batman! (Score 2, Insightful) 234

Ok, I must clarify a few things:

(though Perl 6 comes as close as a truely compiled language reasonably can)

I can't believe I even read that. Perhaps you are just trolling, but for the sake of those who do not know better, lisp is actually more of a truly compiled language than perl. Perl is interpretted by the perl interpreter (aptly named perl). Lisp is compiled down to machine code.

Secondly, this Exegesis covered Perl6's macro capabilities. It works very much like lisps, actually. Granted, my personal feeling is that it is easier to have a program write a program that is written in s-exps than in Perl 6, but Perl 6 does provide the capability.

The options mentioned in this Exegesis point out that macros in Perl 6 can return either blocks or strings. If a block is returned, its syntax tree is injected into the place occupied by the call to the macro. If a string is returned, it replaces the macro call, and then the resulting expression is parsed and compiled. All of this is done at compile-time, of course.

Secondly, and very interestingly, macros can define their own syntax using Rules (regexps) to pull parameters from free-form program text, rather than relying in the comma-separated Perl6 expression default.

All in all, if this can be implemented as they have described, in an efficient manner, I will be impressed. It seems very lispy to me, they've just moved the parsing code from the programmer's brain (since you are effectively writing parse trees rather than syntax when programming in lisp) to a parsing module within the code.

Remember though folks, if you don't want to deal with this complexity, you don't need to. But if you do need to, its good to know that its there.

Slashdot Top Deals

Recursion is the root of computation since it trades description for time.

Working...