Extending Perl with functional macros
By Rolf Langsdorf (LanX) from Darmstadt.pm
Date: Monday, 15 August 2011 16:10
Duration: 40 minutes
Target audience: Intermediate
Language: English
Tags: extension language
You can find more information on the speaker's site:
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
are:
- 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,
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.
====================
Post-talk-update:
Discussion board: The "Abstract-URL" leads to nabbles.
Talksheets: To be published soon.
Articles covering and extending the subject with full code:
1. $foo-Magazine IV/2010 (German)
http://www.perl-magazin.de/index.cgi?action=issue;sub=show;issue=21
2. $foo-Magazine II/2011 (German)
http://www.perl-magazin.de/index.cgi?action=issue;sub=show;issue=23;
- Rolf Langsdorf (LanX)
- Damian Conway (damian)
- Leon Brocard (acme)
- Leon Timmermans (leont)
- H.Merijn Brand (Tux)
- Dietrich Raisin
- Zefram
- Aliaksandr Zahatski (zag)
- Alexey Surikov (ksurent)
- Lars Dɪᴇᴄᴋᴏᴡ (daxim)
- Martin Kjeldsen (baest)
- Florian Ragwitz (rafl)
- Tudor Constantin
- Gligan Calin Horea
- Daniel Blom
- roger blom
- Sorin Pop (finger)
- marc chantreux (eiro)
- Matthias Zeichmann
- Dave Sherohman (dsheroh)
- Olle Johansson (ollej)
- Iulia Bublea
- Marko Kind
- Roman Baumer (rba)
- Mårten Svantesson
- Alexander Orlovsky (nordicdyno)
- Trond Michelsen (trondmm)
- Emil Dragu
- Heinz Knutzen
- Markus Pinkert (Bedivere)
- Brian McCauley (Nobull)
- Reini Urban (rurban)
- Sergei Kirjanov
- Gabriele Hack (gabimuc)
- Moritz Onken (mo)
- Michael Lang (langmic)
- Maciej Czekay (Bruno)
- Karsten Silkenbaeumer (ksi)
- Jesse Vincent
- Grzegorz Dzięgielewski (Jabbas)
- Lars Holgaard
- Magnus Zeisig (magnuz)
- David Faux
- Sue Mynott (virtualsue)
- Dagfinn Ilmari Mannsåker (ilmari)
- Steffen Schwigon (renormalist)
- Nikolay Morev