3 ms·
Very close from what I gather from the web. It has macros similar to Lisp. They take an AST and return an AST. http://perlcabal.org/syn/S06.html#Macros http://p
by jules 17y ago
Very close from what I gather from the web. It has macros similar to Lisp. They take an AST and return an AST. http://perlcabal.org/syn/S06.html#Macros http://perlcabal.org/syn/S06.html#Macros
Do you think that Lisp style languages with sexps are the end in language design, or do you think that something better will be invented? (or has been invented)
- pg 17y agoI would never say never, but I haven't been able to think of a better way to represent programs than s-expressions despite many years of thinking about the problem. I wouldn't be surprised if sexprs are the end in the sense that the integers are. I.e. you might go on to discover new things but they'd ultimately reduce to sexprs. Is there a textual representation for ASTs? Could you write programs directly in ASTs?
- jules 17y agoTo your question: yes, the Perl syntax (the macro system supports quasiquotation). This is exactly the same as in Lisp. The difference is that Lisp syntax looks more like how the data structures are represented in memory. I think you can also build up your programs with data constructors (i.e. like doing (list 'lambda (list 'x) (list '+ 'x 1)) in Lisp). But note that I haven't used Perl6, this is information from the web.
- jey 17y ago"AST" is actually just compiler lingo for "tree representation of s-expr representation of parsed code". In other words: sure, you can write code directly in {ASTs, s-exprs}; it's called "Lisp". ;-)