general introduction and outline of the study
TRANSCRIPT
![Page 1: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/1.jpg)
Perl 6 DesignPhilosophy
Allison RandalThe Perl Foundation &
Onyx Neon Consulting
![Page 2: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/2.jpg)
Design Philosophy
• Every language is unique
• Design philosophy drives the shape ofthe language
• Better understand Perl 6
• Better understand all languages
• "Code smells"
• "Language smells"
![Page 3: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/3.jpg)
Simplicity
• Simple is better
• Simple is easier– to teach
– to learn
– to remember
– to use
– to read
– to parse
![Page 4: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/4.jpg)
Simplicity
• Not all problems are simple
• "The Unlanguage"
• Choose your complexity
![Page 5: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/5.jpg)
The Waterbed Theory
![Page 6: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/6.jpg)
The Waterbed Theory
![Page 7: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/7.jpg)
The Waterbed Theory
• Push it down...
![Page 8: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/8.jpg)
The Waterbed Theory
• Push it down...
![Page 9: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/9.jpg)
The Waterbed Theory
• Push it down...
• ...it rises on the other side
![Page 10: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/10.jpg)
The Waterbed Theory
• Conservation of complexity
• Many operators:^%+ !@== ?/ **~* -_-$
• Few operators:assign(a, add(multiply(3,4), 5))
• Find the balance
![Page 11: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/11.jpg)
Reuse
• Repeated structures while (true) {
# do something}
if (true) then# do something
end if
• Provides consistency
• Syntactic conventions
![Page 12: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/12.jpg)
Distinction
• Small differences disappear
• If "cats" were "togs"
• Visual clues– eval and try– for and loop– sub and method
• Distinction vs. Reuse
![Page 13: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/13.jpg)
Freedom
• Programmer freedom
• Customs, not laws
• Perl isn't a training bike
• Some things should be hard
• Freedom demands flexibility
![Page 14: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/14.jpg)
Adaptability
• Change is natural
• Adjust to need
• Stay relevant
• Dead languages don't change
• Plan for change
• Features like:– modifiable parsing
– core vs. user-defined
– user-defined operators
![Page 15: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/15.jpg)
Prominence
• All syntax is not created equal• Some things stick out• Use to your advantage• BEGIN blocks (NAMED blocks)• Modifier forms of if, unless, etc.
if ($blue) {print "True Blue.";
}
print "True Blue." if $blue;
![Page 16: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/16.jpg)
End Weight
• Lengthy bits at the end "I gave Mary the book" "I gave the book to Mary" "I gave the book about the history of the
development of peanut-based products inIndonesia to Mary."
• Easier to read, easier to parse$line =~ m/^phone\s*
(\d{3})-?(\d{3})-?(\d{4})$/ix;
![Page 17: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/17.jpg)
End Weight
• Lengthy bits at the end "I gave Mary the book" "I gave the book to Mary" "I gave the book about the history of the
development of peanut-based products inIndonesia to Mary."
• Easier to read, easier to parse$line ~~ m:i/^phone\s*
(\d<3>)-?(\d<3>)-?(\d<4>)$/;
![Page 18: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/18.jpg)
DWIM
• Do What I Mean
• DWIM not always DWYM
• Use the DWIM, Luke
• Targets– Perl programmers
– English speakers
1st, 2nd, 3rd also 1th, 2th, 3th
![Page 19: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/19.jpg)
Borrowing
• Like "camouflage"
• Features for the taking
• Mutual respect
• Open thought
• Adoption with Adaptation
![Page 20: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/20.jpg)
Perl Should Stay Perl
• What makes it Perl?
• True to designer's purpose
• Familiar
• Translatable
![Page 21: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/21.jpg)
Long-Term Usability
• Not 2 years
• 20+ years
• Not fads or cute tricks
• Strong, dependable tools
• Not perfect, just a step
![Page 22: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/22.jpg)
Summary
• Adaptable
• Freeing
• Simple...
• ...but complex
• Distinct...
• ...but consistent
• Borrow...
• ...but Perl-ishly
![Page 23: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/23.jpg)
Summary
• Relevant now...
• ...and relevant then
• Programmer friendly
• More Perl
![Page 24: GENERAL INTRODUCTION AND OUTLINE OF THE STUDY](https://reader036.vdocuments.mx/reader036/viewer/2022071602/613d6d91736caf36b75d3689/html5/thumbnails/24.jpg)
Questions?