Perl 5 mit Makros erweitern

By Rolf Langsdorf (‎LanX‎) from
Date: Thursday, 20 October 2011 15:30
Duration: 40 minutes
Language: Deutsch

You can find more information on the speaker's site:

Da einige Leute bei meinem diesjährigen YAPC-Vortrag über die "Erweiterung von Perl mit funktionalen Macros" abgehängt wurden, habe ich mich entschlossen den Vortrag in 2 ausführlichere Teile aufzugliedern.

Dieser 2. Teil erläutert die nötigen Grundlagen zur Umsetzung eines Macro-Mechanismus mittels B::Deparse insbesondere genauer was LISP-artige Macros eigentlich genau sind.

Wir werden auf Pro und Con dieses Ansatzes eingehen, die Zuverlässigkeit von B::Deparse, Hygiene von Macros und Vorteile zu reinen Codefiltern diskutieren.

Außerdem versuche ich dem Input und neuen Anregungen der YAPC gerecht zu werden, und mehr Anwendungsbeispiele zu zeigen. (Haskell, LINQ)

Im folgenden der Abstract meines diesjährigen YAPC-Vortrages erstmal original in Englisch.


A multitude of extension were invented for Perl5, using "source filters" and various "XS" add-ons or even darker magic.

Unfortunately mostly without wide acceptance within the community!

The complexity of Perl's syntax limits most approaches severely, they
- not reliable enough,
- too complex to install, use, maintain ...
- incompatible with established development tools
- too delicate in edge cases, hence limited to narrow use cases

We are trying to analyze the nature of these problems and and will discuss
design principles to avoid them systematically.

In consequence we will show a functional approach to elegantly provide a wide variety of new idioms, including operators and
control structures, just by using

a) The syntactic sugar of chaining functions with special prototypes
b) A LISP like macro system which expands functions to inlined code.

A working proof of concept is presented, realized in pure Perl, only
by using (and patching) CORE modules like B::Deparse.

The prototype is simple to install, backward compatible to previous
Perl versions and easy to adapt w/o knowledge of any perlguts.

We will demonstrate how to extend Perl5 like this with idioms like

- List Comprehensions,
- Co-Routines and Gather-Take,
- Hyper-Operators.

Aim of this presentation is to discuss pro and cons of this strategy
within a proficient audience. No C or XS knowledge will be needed to
follow, we'll develop step by step on the basis of core perldocs.

Attended by: Gregor Goldbach (‎glauschwuffel‎), Jan Hartung (‎Egga‎), Herbert Breunung (‎lichtkind‎), Steffen Ullrich, Patrick Ringl (‎pari‎), Benedikt Heller, Gabriele Hack (‎gabimuc‎), Ulrike J. Schepp (‎Roana‎), Sören M. Laird Sörries, Paul Boldra, Jochen Hayek,