Module - PowerPoint PPT Presentation

About This Presentation
Title:

Module

Description:

Writing (almost) sequential streams of data, with some portions to be filled in ... because Perl confuses typeglobs and filehandles) ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 16
Provided by: Sd186
Category:

less

Transcript and Presenter's Notes

Title: Module


1
Module DataLocations
  • What on earth are DataLocations?!
  • Steffen Beyer
  • YAPCEurope, London, UK,
  • ICA, September 22-24 2000

2
Agenda
  • What is it good for?
  • Example
  • How does it work?
  • Gory Details
  • History
  • Questions Answers, Suggestions

3
What is it good for?
  • Writing (almost) sequential streams of data, with
    some portions to be filled in later, after most
    or all of the stream has already been written -
    without using temporary files
  • Web Content Management
  • Generating code in large IT projects
  • Mailings to multiple recipients
  • ...

4
Example
  • Software Development Environment (Code
    Generators)
  • Customer Zeppelin-Caterpillar
  • Development Platform Unix
  • Tool Language Perl
  • Production Platform Mainframe MVS/CICS
  • Production Language PL/I
  • Costs (just the tools!) approx. 4 man-years

5
Example
  • See
  • file "in.txt"
  • file "out.txt"

6
How does it work? (1/2)

sdm
6
7
How does it work? (2/2)
  • DataLocations are implemented so that they
    behave as if they were an integral part of the
    Perl language
  • you can send data to DataLocations with
  • "print" like to any other filehandle
  • you can read from DataLocations with the
  • "ltgt" operator as usual
  • DataLocations go out of scope as any other
  • Perl object
  • DataLocations are fully suited for binary data
  • DataLocations can be automatically dumped to
  • a file, a pipe, a command etc. when program ends

8
Cookie
  • You can teach people with your head
  • You can kill people with an overhead
  • You can overkill people with two overheads

9
Gory Details
  • See
  • file "struct0.pl"
  • file "struct1.pl"
  • file "struct1.txt"

10
  • DataLocations are typeglobs, filehandles and
    objects
  • at the same time
  • The typeglob is blessed into the DataLocations
    class
  • The filehandle is tied to the object (i.e., to
    itself,
  • because Perl confuses typeglobs and filehandles)
  • The typeglob's slots (, _at_, ) contain the
    object's data
  • (the "_at_" slot actually contains the user's data)
  • Symbolic references are used as "weak references"
  • for internal interconnections
  • The reference count is adjusted so that the
    Location will
  • be destroyed when user's last reference goes out
    of scope
  • The symbol table DataLocations is used as
    index
  • (for "weak reference" lookups and global
    destruction)

11
History
  • 80s
  • 1988/1989
  • July 1997
  • Delta macro processor (Delta GmbH)
  • ProMAC macro processor (sdm GmbH)
  • Perl module DataLocations (Free Software)

12
DELTA macro processor
  • Product of Delta GmbH
  • Macro preprocessor to extend the capabilities of
    COBOL and PL/I
  • extendable with the help of a PDL macro
    generator
  • very cryptic
  • poor performance
  • hard-coded memory limits

13
ProMAC macro processor
  • String interpolation reminding of C preprocessor
  • built-in functions comparable to Perl
  • Regular expressions (similar to egrep)
  • Module concept every subroutine is a separate
    file
  • Disastrous performance 100 interpreted (even in
    loops)
  • Conceptual weaknesses

14
Questions Answers, Suggestions
  • Please feel free to ask!
  • Suggestions are welcome.

15
Another Example
  • Web Content Management
  • Customer Pentium GCC Group
  • (http//www.goof.com/pcg/)
  • Contact Marc Lehmann ltpcg_at_goof.comgt
  • Application Generating status pages with bug
  • reports for different releases and
  • branches of development
Write a Comment
User Comments (0)
About PowerShow.com