in reply to Re^2: Perl 5 Optimizing Compiler, Part 15: RPerl v1.2 Kickstarter Now Live
in thread Perl 5 Optimizing Compiler, Part 15: RPerl v1.2 Kickstarter Now Live
For me, personally, the "Low-Magic Perl Commandements" do not really read like a technical list of things that are supported or unsupported. I think it would fare better with a preamble of "These are the features that you will need to write your code to such that RPerl can support it". But reinterpreting them as a technical list of things that are supported or unsupported, there are some commandements that will hinder RPerl to become ever usable for me:
17. THOU SHALT NOT:Use Dynamic-Type Data, Auto-Vivification, Or Tied Variables
This means that DBI and DBD::* are right out of the window without major retooling of DBI and all related code not to rely on tie'd hashes.
19. THOU SHALT NOT: Use Private Dynamic-Scope (“local”), Private Persistent Lexical-Scope (“state”), Global, Or Package Variables (“our”)
Of course, global variables have their place and are highly useful, for example as global defaults. Whenever there is a lexical variable in global scope, that lexical variable should be a global variable in case somebody really wants to override it. Maybe some arguments as to why avoiding local and global variables would be good. For example, such variables make reasoning about value escape much, much harder and preclude some optimizations. But taken as an absolute, they are not good recommendations.
21. THOU SHALT NOT: Use Typeglobs, Code References, Weak References, Or Magic Lvalues (Builtins, Non-Variables, Non-Slices, etc)
I'm not sure what the technical gain here is. But without code references every dispatch table flies out of the window. Without weak references you can't really implement trees or doubly-linked lists or other data structures in a way that enables the reference-counted memory management to clean up such structures automatically.
23. THOU SHALT NOT: Use Aliased, Non-Descriptive, Special ($1, $a, %ENV, %SIG, etc), Or Punctuation Variables ($_, @_, %!, $@, $$, etc)
What is the technical reason for RPerl to not allow access to those variables?
35. THOU SHALT NOT: Use Taint Mode
This is a WTF as written. Taint mode relies heavily on magic, so I understand the technical reason for this but it needs some more elaboration. The corresponding "THOU SHALT" of "34. Use Secure Platforms & Trusted Data" moves this recommendation into rainbow unicorn country. If we're able to make wishes come true, why doesn't rule 34 say "THOU SHALT WRITE FAST,SHORT,CORRECT AND EASILY UNDERSTOOD PROGRAMS" and replace all preceding and following rules instead?
I find the reliance on PBP and Perl::Critic makes it an instant turn-off because much of PBP isn't that great a practice without further review and adaption to the situation at hand. This is recommended on the first pages of PBP, but I found people referring to PBP always took PBP as literal gospel instead of reviewing the recommendations before applying them.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl 5 Optimizing Compiler, Part 15: RPerl v1.2 Kickstarter Now Live
by LanX (Saint) on Sep 27, 2015 at 22:23 UTC | |
by Corion (Patriarch) on Sep 28, 2015 at 08:04 UTC | |
by LanX (Saint) on Sep 28, 2015 at 12:48 UTC | |
by Anonymous Monk on Sep 27, 2015 at 23:39 UTC | |
|
Re^4: Perl 5 Optimizing Compiler, Part 15: RPerl v1.2 Kickstarter Now Live
by stevieb (Canon) on Sep 27, 2015 at 13:22 UTC |