Oh My Glob

My recent posts on the inner workings of perl have made me reflect on some of the more advanced, lesser-known parts of the Perl language. One of these features that I'd like to talk about today is the typeglob.

Read More…
Posted on 2013-11-18

Perl 5 Internals - Part Four

The first three installments of this series covered Perl's core data types: scalars, arrays, and hashes. This final installment will cover something a bit different: the optree. Those of you who are familiar with compiler concepts are no doubt familiar with the notion of an abstract syntax tree (known as an AST for short). The optree is perl's take on the AST: it's something similar to, but not entirely the same as, an AST. Before we begin looking at the optree, I recommend reviewing the “Subroutines” and “Compiled code” sections of perlguts, as well as looking at perlcall. It is by no means required, but it might make digesting this content a little easier.

Read More…
Posted on 2013-10-02

Perl 5 Internals - Part Three

In the previous post, we talked about some of the optimizations that perl performs when conducting string and array operations. This time, we'll be diving into how perl implements hashes. But first, a brief clarification…

Read More…
Posted on 2013-09-11

Perl 5 Internals - Part Two

Welcome back for another exciting episode on the inner workings of the perl interpreter! Last time we covered some of the basic optimizations perl performs on SVs, as well as the consequences of those optimizations. This time, we'll be going over some of the optimizations specific to strings and arrays. I know I said we'd be covering hashes too, but this article is already quite lengthy, and I have enough material on hashes to merit its own article, so look for that information in the upcoming third part of this series!

Read More…
Posted on 2013-09-05

Perl 5 Internals - Part One

Last week I completed a two-part training at work on perl's internals, led by Yves Orton and Steffen Mueller. We covered some of data structures used by the interpreter, as well as some of the optimizations it uses and the consequences of how those optimizations are implemented. Someone on Twitter asked me if there were any slides available, and unfortunately, the talk was conducted in a very ad-hoc fashion (which actually probably contributed to its success, as the audience was able to propose new areas to cover). However, I did end up taking some notes, so I'm going to summarize those here along with what I remember. A lot was covered in the two sessions, so in the interest of actually getting this information out (I tend not to publish things that I can't write in one sitting), as well as keeping your attention, I'll be publishing them in a series of posts.

Read More…
Posted on 2013-08-28