<%flags> inherit => undef Camel Lot #6
Camel Lot #6
Copyright 2000
There's More Than One Way To Do It









Camel Lot #6
The Once and Future Perl
Camel Lot #6 The Once and Future Perl
How It Was Back Then (Sort Of)
[split between C and shell]
Camel Lot #6 The Once and Future Perl
How It Really Was Back Then
[graph: shell scores high on whipuptitude, C on manipulexity]
Camel Lot #6 The Once and Future Perl
The Hatching of an Idea
[graph: perl going for manipulexity *and* whipuptitude!]
Camel Lot #6 The Once and Future Perl
The Inputs
[Perl Inputs: Comp Sci, Linguistics, Common Sense, Art]
Camel Lot #6 The Once and Future Perl
What to Take, What to Leave Behind
[figure: Perl takes only the *good bits* from C, sed, awk, sh]
Camel Lot #6 The Once and Future Perl
Question
Bastardization, or Hybrid Vigor?
Camel Lot #6 The Once and Future Perl
My Irrationalities

  • Syntax shouldn't dangle in the wind
  • Ordinary people like me hate abstraction
  • C is wonderful
  • C is awful
  • awk is neither
  • Language is an amoral medium
  • Ugly can be beautiful
  • Beautiful can get ugly real quick
  • Visual metaphors are for more than just poetry
  • I don't care what other people think
  • I care what other people think
  • I think God has free will
Camel Lot #6 The Once and Future Perl
Common Fallacies of Language Design

  • "We need to start over from scratch."
  • "If we put in English phrases, that makes it readable."
  • "Simple languages produce simple solutions."
  • "If I wanted it fast, I'd write it in C."
  • "I thought of a way to do it, so it must be right."
  • "This is a VHLL. Who cares about bits?"
  • "You can do anything with NAND gates."
  • "Users care about elegance."
  • "The specification is good enough."
  • "Abstraction equals Usability."
  • "The common core should be as small as possible."
  • "Let's make this easy for the computer."
  • "Most programs are designed top down."
  • "Text processing doesn't matter."
  • "People should never have been given free will."
Camel Lot #6 The Once and Future Perl
Larry's Conjecture
For most people, the perceived usefulness of a computer language is inversely proportional to the number of theoretical axes that the language attempts to grind.
Camel Lot #6 The Once and Future Perl
Waterfall or Whirlpool?
[figure: whirlpool of specification, design, coding, testing]
Camel Lot #6 The Once and Future Perl
The UNIX Family Tree
[figure: complex tree from single root]
Camel Lot #6 The Once and Future Perl
The C Family Tree
[figure: well defined paths to C, squiggly path to C++]
Camel Lot #6 The Once and Future Perl
The C Family Tree, Cont.
[figure: adding squiggly path to Java]
Camel Lot #6 The Once and Future Perl
How Microsoft Sees It
[figure: adding another squiggly path to C#
Camel Lot #6 The Once and Future Perl
The Perl Family Tree
[figure: perl family tree -- a straight line!]
Camel Lot #6 The Once and Future Perl
The Other Perl Family Tree
[figure: the other perl family tree --- a wild tangle!
Camel Lot #6 The Once and Future Perl
Natural Language Concepts

  • Learn it once, use it many times
  • Learn as you go
  • Many acceptable levels of competence
  • Multiple ways to say the same thing
  • No shame in borrowing
  • Indeterminate dimensionality
  • Local ambiguity is okay
  • Punctuation by prosody and inflection
  • Disambiguation by number, case and word order
  • Topicalization
  • Discourse structure
  • Pronominalization
  • No theoretical axes to grind
  • Style not enforced except by peer pressure
  • Cooperative design
  • "Inevitable" Divergence
Camel Lot #6 The Once and Future Perl
Perl 5: The Big Nouns

  • Compatibility
  • Extensibility
  • Usability
  • Reusability
  • Readability
  • Scalability
  • Maintainability
  • Portability
  • Responsibility
  • Embeddability
  • Respectability?
Camel Lot #6 The Once and Future Perl
Constraints on Perl 5

  • The need for backward compatibility
  • My leisurely mental growth
  • Cultural model with too many bottlenecks
  • Lack of knowledge of the future
  • Lack of round tuition
  • Complexity of the core
  • Complacency
Camel Lot #6 The Once and Future Perl
The Summer of our Discontent

  • Two years between 5.005 and 5.006
  • Busy with new Camel book
  • Busy with Perl Whirl cruise
  • Busy with yapc 19100
  • Busy with TPC 4.0
  • The Constitutional Convention
  • The Perl Porters meeting
  • The big announcement
Camel Lot #6 The Once and Future Perl







If you can dream it, you can do it.
--Walt Disney
Camel Lot #6 The Once and Future Perl
Reinventing Everything

  • Lexer
  • Parser
  • Interpreter
  • Code generators
  • Internal APIs
  • External APIs
  • Language
  • Culture
Camel Lot #6 The Once and Future Perl
New Working Group Model
mail.perl6-announce            445
mail.perl6-language           5070
mail.perl6-internals          1614
mail.perl6-build                 6
mail.perl6-stdlib              128
mail.perl6-language-mlc         44
mail.perl6-language-subs       317
mail.perl6-language-strict      81
mail.perl6-language-flow       314
mail.perl6-language-unlink       0
mail.perl6-language-io         326
mail.perl6-licenses            246
mail.perl6-language-objects    596
mail.perl6-language-errors     281
mail.perl6-language-datetime    93
mail.perl6-language-data       468
mail.perl6-language-regex      491
mail.perl6-meta                391
mail.perl6-source-control       11
mail.perl6-announce-rfc        448
mail.perl-qa                   121
Camel Lot #6 The Once and Future Perl
The Constraints on Perl 6

  • Can Larry understand it?
  • Do people really need the new feature?
  • Can we implement it efficiently and robustly?
  • Does it preclude translation from Perl 5?
  • Does the utility grow faster than the complexity?
  • Does the size grow slower than Moore's Law
  • Must take time to maintain Perl 5
  • Must take time to design Perl 6 right
Camel Lot #6 The Once and Future Perl
The RFC process

  • Really does mean Request For Comment
  • Written in simple POD
  • Have to be well-formed to be accepted
  • Subject to revision/retraction/freezing
  • First one came in August 1
  • Open brainstorming till September 30
  • Two weeks. Hah!
Camel Lot #6 The Once and Future Perl
Handwaving Requirements

  • Perl must support higher level programming
  • Perl must support lower level programming
  • Perl must support more paradigms
  • Perl must support sane version control
  • Perl must support absolute flexibility
  • Perl must have a lean and mean core
  • Perl must not surprise people unnecessarily
  • Perl must be as simple as possible, but no simpler
  • Perl must remain Perl
Camel Lot #6 The Once and Future Perl
Simplifications

  • Non-critical built-ins move out to modules
  • All variables can be used as objects
  • All variables actually are objects internally (vtables)
  • Strange global variables become object attributes or lexicals
  • Filehandles become objects, use OO notation
  • Parsing rules simplified for indirect objects
  • Parsing rules simplified for subscripting, slicing, etc.
  • Confusing homonyms disentangled (do, eval, etc.)
  • Typeglobs go away
  • XS goes away; interfaces written in low-level Perl
  • Object attribute declaration standardized
  • Object attribute access standardized via accessors
  • Real garbage collection
  • Unified OO exception handling
  • Easier expression interpolation
  • Possible precedence simplification?
Camel Lot #6 The Once and Future Perl







How much complexity can we allow in exchange?
Camel Lot #6 The Once and Future Perl
A Tour of the RFCs

  • Dropouts
  • Grading the problem
  • Grading the solution
  • The good, the bad, and the ugly
  • Deference
Camel Lot #6 The Once and Future Perl
Perl as a Low-Level Language

  • Polymorphism is your enemy for low-level programming
  • Scalar type declarations

  • for my int $i (1..10000) {...
    my num $PI : constant = atan2(1,1) * 4;
    my str $delim = ":";
  • Homogenous array/hash type declarations

  • my int @codes;
    my num @coeff;
    my str %words;
  • Representation specifications

  • my int @codes :bits(4);
    my num @array :shape(4,4,4);
    my str %words :fixlen(20);
  • Non-homogenous arrays
  • Unsafe code
Camel Lot #6 The Once and Future Perl
Perl as a High-Level Language

  • Polymorphism is your friend for high-level programming
  • Abstraction is allowed but not required in Perl
  • More support for functional programming
  • More support for logic programming
  • More support for "little languages"
Camel Lot #6 The Once and Future Perl
Perl as a Metalanguage

  • History of little languages
  • Using a big language as a little language
  • How not to pay the price for generality
Camel Lot #6 The Once and Future Perl
The Perl 4 Approach to Metasyntax

  • The eval operator
Camel Lot #6 The Once and Future Perl
The Perl 5 Approach to Metasyntax

  • The eval operator
  • BEGIN blocks
  • Importation
  • Overriding/overloading certain builtins
  • Source filtering
Camel Lot #6 The Once and Future Perl
The Perl 6 Approach to Metasyntax

  • The eval operator
  • BEGIN blocks
  • Importation
  • Importation
  • Overriding/overloading certain builtins
  • Source filtering
  • Meta-use
  • Lexer/parser written in Perl
  • Ability to redefine any lexer or parser rule
  • Ability to add new lexer or parser rules
Camel Lot #6 The Once and Future Perl
Redefining Recognition

  • Numbers
  • Strings
  • Quoted constructs
  • Bracketed constructs
  • Operators
  • Functions
  • Expressions
  • Blocks
  • Block lists
  • Subroutine definitions
  • Complete compilation units
Camel Lot #6 The Once and Future Perl







Unicode operators?!?
Camel Lot #6 The Once and Future Perl
Is Malleable Syntax Such a Good Idea?

  • The mechanism will be abused--so what?
  • Unicode operators vs "swearing" operators
  • Allows for semantic delegation like Tcl
  • Metasyntactic warpage will be lexically scoped
  • All is fair if you predeclare
  • Must manage documentation
  • Must manage semantic warpage
Camel Lot #6 The Once and Future Perl
Other subjects

  • XML
  • Unicode
  • Threading
  • Safe signals
Camel Lot #6 The Once and Future Perl







Never promise to complete a project
within six months of the end of the
year--in either direction.
--Norman Augustine
Camel Lot #6 The Once and Future Perl