Live data from Hacker News

Swift's Abstract Syntax Tree

ankit.im

1–10 of 36 posts

Re: Swift's Abstract Syntax Tree

#7
It would be useful to add a command line tool with a linq/jquery-like syntax over that.

I've discovered few weeks ago the same feature (a bit hidden) in GCC:

    gcc -fdump-translation-unit=ast.txt file.c
It gives the AST in a flat map (parent/child with ids).

Re: Swift's Abstract Syntax Tree

#8
post #4

After learning lisp, I just feel like every other language is a weird set of macros. Looking at this AST confirms that. Wish I could live the rest of my life in Sexp-land.

There is other interesting homoiconic languages like Rebol (brackets instead of parens and more whitespaces).

I could add a stack-based language like Factor too.

Re: Swift's Abstract Syntax Tree

#9
post #4

After learning lisp, I just feel like every other language is a weird set of macros. Looking at this AST confirms that. Wish I could live the rest of my life in Sexp-land.

Boy do I know how you feel. So many things that used to seem interesting and deep to me (often involving syntax or parsing or data formats) now feel like busywork and noise. Or like I'm visiting a land where everyone wears extra layers of heavy, stiff clothing and speaks in long circumlocutions. I feel claustrophobic and can't wait to get back to Sexp-land where I can breathe.

Some of it's just habit, of course, but the lightness and simplicity also seem objective to me. It becomes hard to understand why everyone else keeps jumping through all those pointless hoops, you get ever more impatient and irritable with it all, and one day you fall prey to full smugweeniness.

Re: Swift's Abstract Syntax Tree

#10
post #6
post #2

That looks like lisp?

You are right! Lisp is homoiconic which basically means that the language mirrors the AST https://en.wikipedia.org/wiki/Homoiconicity

Hmmm, I am learning a lisp now I've been reluctant to dive in but this makes me all the more willing
Post reply on HN