Climbing the Abstract Syntax Tree

James Titcumb (30.Jun.2017 at 11:45, 45 min)
Talk at Dutch PHP Conference 2017 (English - UK)

Rating: 4 of 5

The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.

To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.

After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.

(*actual magic or time-warp not guaranteed)

Who are you?

Claim talk

Talk claims have been moved to the new Joind.in site.

Please login to the new site to claim your talk

Want to comment on this talk? Log in or create a new account or comment anonymously

Write a comment

 
Please note: you are not logged in and will be posting anonymously!
= nine minus seven

Comments

Rating: 4 of 5

30.Jun.2017 at 13:07 by Shopware AG (4 comments) via joind.in Android app

Well presented!

Rating: 5 of 5

30.Jun.2017 at 13:31 by Jeroen Sen (3 comments) via Web2 LIVE

Probably the best talk I've ever attended irl. James really succeeded in making complex matter (looking) super simple!

Rating: 5 of 5

30.Jun.2017 at 13:37 by Mairsil (36 comments) via Web2 LIVE

A nice insight into the inner workings of php, very good job making an arcane subject easy to understand. The bits about monkey patching could perhaps use a little more intro and context (examples), but it did not bother understanding.

Rating: 4 of 5

30.Jun.2017 at 14:47 by Martijn Smit (4 comments) via Web2 LIVE

Made me understand the AST very easy.
Very good talk.

Rating: 2 of 5

30.Jun.2017 at 21:42 by Erik de Bos (19 comments) via Web2 LIVE

Interesting subject, but I would have wanted a more complete view of the process, or more focus on applicability. Instead it was a bit of both without satisfying either.

Rating: 5 of 5

01.Jul.2017 at 13:05 by Liam Wiltshire (83 comments) via joind.in Android app

Well delivered and interesting talk on a subject that perhaps doesn't have a huge amount of day-to-day application. Looking forward to monkey-patching production sometime soon!! :p

Rating: 4 of 5

01.Jul.2017 at 20:36 by Deniz Zoeteman (8 comments) via Web2 LIVE

Pretty good talk! Got to learn quite a lot about the PHP lexer, parser and compiler!

Rating: 4 of 5

02.Jul.2017 at 12:08 by Peter Bouwdewijn (10 comments)

A nice wel explained look under the hood. Great presentation skills

Rating: 3 of 5

03.Jul.2017 at 11:46 by Christopher Pitt (68 comments) via Web2 LIVE

I really enjoy this topic, and speak about it every now and then. I went in thinking it might be a little boring because of that (given the abstract), but I was pleasantly surprised. I'd definitely sit through this talk about, but in case you're looking for something to improve before then...

I found the Polish Notation section _very_ dry. I understand why you needed to explain it, since the grammar you defined was easier to execute when polish notation was used, but I think there are other avenues you could try, which would remove the need to explain Polish Notation at all.

To contrast, Christopher Hoult also spoke about Polish Notation (in his graphs talk) and it was far more digestible. Perhaps it was because he was approaching it via an introduction to graph traversal. Perhaps it was because his visual aids were better. In any case, I much preferred his description of Polish Notation.

If you explained your parser via state machines and then lightly touched on prefix/postfix, I think you'd avoid needing to demonstrate Polish Notation at all. You'd also have more time to expand on the grammar (for things like parenthetical associativity).

© Joind.in 2017