Periodic Table of the Operators
mAsterdam writes "At his code blog Mark Lentcner writes:
"A while back, I saw Larry Wall give a short talk about the current design of Perl 6. At some point he put up a list of all the operators - well over a hundred of them! I had a sudden inspiration, but it took a few months to get around to drawing it..."
You might want to take a look at this and think about which operators are yet to be discovered."
http://www.ozonehouse.com/mark/blog/code/PeriodicT able.pdf
I the only one who saw the adobe acrobat plugin for firefox on his knees loading this?
This cannot mean good things for Perl. Look at all of those operators!!!! Correct me if I'm wrong, but isn't that pretty onerous to have a huge chart of possible operators for a language? I'd quite prefer simplifying over adding multiple combinations of ways to doing things. That code is gonna be NASTY.
All the more reason for me (IMO) to avoid Perl like the plague.
Zed's dead baby. Zed's dead.
The /. operator is the one that causes your system to grind to a halt.
- Thomas;
___ This sig is in boldface to emphasize its importance!
Courtesy of Google:
e %3Ahttp%3A%2F%2Fwww.ozonehouse.com%2Fmark%2Fblog%2 Fcode%2FPeriodicTable.pdf&btnG=Zoeken
http://www.google.nl/search?hl=nl&ie=UTF-8&q=cach
user@host$ diff
A mirror location for the PDF of the periodic table: http://condor.madoka.be/various/PeriodicTable.pdf
Where is the WTF operator?
Free Firefox news reader.
Code written with them becomes illegible after that.
Perl 6 is going to be the best thing that ever happened to Python.
The sentance reminded me of the Elements song.... No doubt someone has already started rewriting it for Perl !
TONSIL A (1)
The Official INTERCAL Character Set
Tabulated on page XX are all the characters used in INTERCAL, excepting
letters and digits, along with their names and interpretations. Also
included are several characters not used in INTERCAL, which are presented
for completeness and to allow for future expansion.
Character Name Use (if any)
. spot identify 16-bit variable
: two-spot identify 32-bit variable
, tail identify 16-bit array
; hybrid identify 32-bit array
# mesh identify constant
= half-mesh
' spark grouper
` backspark
! wow equivalent to spark-spot
? what unary exlusive OR (ASCII)
" rabbit-ears grouper
". rabbit equivalent to ears-spot
| spike
% double-oh-seven percentage qualifier
- worm used with angles
< angle used with worms
> right angle
( wax precedes line label
) wane follows line label
[ U turn
] U turn back
{ embrace
} bracelet
* splat flags invalid statements
& ampersand[5] unary logical AND
V V unary logical OR
(or book)
V- bookworm unary exclusive OR
(or universal qualifier)
$ big money unary exclusive OR (ASCII)
c| change binary mingle
~ sqiggle binary select
_ flat worm
overline indicates "times 1000"
+ intersection separates list items
/ slat
\ backslat
@ whirlpool
-' hookworm
^ shark
(or simply sharkfin)
#|[] blotch
Table 2 (top view). INTERCAL character set.
(1) Since all other reference manuals have Appendices, it was decided that
the INTERCAL manual should contain some other type of removable organ.
(2) This footnote intentionally unreferenced.
Irritable, left-wing and possibly humorous bumper stickers and t-shirts
I'm also hosting the PDF directly, here:
PeriodicTable.pdf
user@host$ diff
Take a look at this, then take a look at a real periodic table. Yup, that's right, a list of the operators of perl are more complicated than a list of all the atoms that make up everything around you. Mirror (Bittorrent so I wont get myself /. ed)
http://www.raiden.se/download/1541/PeriodicTable.p df.torrent
Mirror mirror on the (Larry) Wall...
.Mac
Bandwidth courtesy of
_______
2B1ASK1
You might want to take a look at this and think about which operators are yet to be discovered
Yet to be discovered? means... Yet to be thought of... or yet to be documented. I am sure that I could find all of them by spending a few minutes looking through the code.
Sorry, I am just puzzled by what I am discovering.
We may have to wait for Perl 7 for that one. However, if you look under "Quasi Variables/Templars", you will find there is a "yadda, yadda, yadda" operator.
Irritable, left-wing and possibly humorous bumper stickers and t-shirts
I'll be the first to admit that Perl can be ugly--it's driven me to an interest in Ruby--but when you really think about it, it's not that many operators.
Alot of them, for example, are numeric operators that should be familar to most programmers: !=,==,=,&,&&,, and so forth. About a third of them are regex operators. And among those that are left, many are either common Perl operators, or are not that difficult to figure out if you don't know what they are--e.g., "eq".
I could make up a similar list for almost any other language, and it would appear pretty large.
Perl has more operators than other languages, but if you include some of the things this individual is including, I'm not sure it's that much more.
My reaction, too, was something like "whoa! what are all those!" But then when I saw what they were, it didn't seem so overwhelming.
And just to be pedantic, shouldn't all the "op=" operators be described as molecules formed from "op" and "="?
Am I part of the core demographic for Swedish Fish?
To people who don't deal with the Periodic Table of Elements on a regular basis (i.e. it isn't part of the job or hobbies), this is overwhelming. I find this interesting because I can see how the brain of a fellow human works.
Why go this trouble if they will be presented in the index of a book or an order of operations table? He's forced the information into his way of understanding. He's taken the operators and organized them in a manner that he feels they are easy to deal with.
A chemist can make everything look like chemistry. Or for the programmers, a C programmer can program C in any language.
-fragbaitHere it is.
You can't judge a book by the way it wears its hair.
One of the underlying philosophies about perl is to give the user as many options for doing things as is concievably possible. However, there's certainly no reason you have to take these options or, generally, to know those options are there. I repeat: you do not have to know these operators to use perl 6. There is almost nothing on this entire graph for which you could not get the same functionality in a more clean and readable manner by just doing it a different way.
/(.)/g or the first thing that comes to their mind and moves on.
There is no doubt that a cleaner and more consistent language would arise from putting all the language functionality into clear and well-organized paths that everyone would use and recognize in exactly the same way. However the thing is, that is not what many people want. And I would posit that the popularity of perl proves that that is not what people want. While this chart may horrify many programmers, the simple fact is that one of the main reasons for the popularity of perl is the freedom offered by all of its shortcuts and bizarre little unnecessary operatorss. Someone programming in, say, Java, will find themselves often having to stop, scratch their heads, and try to remember or look up the method or class in the standard library used to do some trivial thing, or write a trivial function to do it themselves. While the perl programmer just scribbles out &$g =~
Perl 6's one big problem, from my perspective, is that the language is *so* big that it's unlikely or impossible any one person will be familiar with all of its features. However one of these features-- which is either horrible or very attractive depending on how you look at it-- is that it offers you the opportunity to redefine the syntax. My personal theory is that many organizations which decide to adopt perl 6 internally will use this to just cut out large swaths of the language, cutting perl 6 down to something more streamlined and manageable. That is, in order to ensure everyone can read each other's code, they will be able to just set certain coding standards-- for example, "don't use hyper operators" or "don't alter the perl grammar"-- and then enforce this by requiring everyone to include a lib that simply removes these features from the language. Do something like this, and you're left with a language which is readable yet still perfectly functional and still more attractive in many ways than many other languages.
This doesn't help though with the reason this is a big problem, though: code reuse. Perl 6 offers so many options that code written by another person or another organization, when it falls in your hands may sometimes appear to have been written in a different language than the one you are used to. And if people have been taking advantage of the syntax-redefinition features, it will literally be in a different language. However, I suspect this will not be an intractable problem for one reason. Perl 6 offers a very robust object system; it is likely that most of the code reuse in perl 6 will be done through modularity and incorporation of objects, rather than simple cut and paste code reuse. This is in fact generally the way that things work in perl 5; people just modularize everything, and learn not to poke too closely at the internals of any class they're given to work with, looking only at the perldocs. Weirdly, despite the illegible code (or perhaps because of it), the perl culture, or at least the perl module community, seems to have developed a tendency to write very exhaustive documentation. Anyhow, we shall see what happens.
One last thing. This chart is not as bad as it seems. Most of the size of this chart stems from the explosion of "operators" caused by the addition into perl 6 of APL-style "adverbial operators". (I believe the user may define their own adverbs, but I am not sure.) This means that many of the operators on this list are actually compound operators-- for example, the "add the contents of two lists" oper
Irritable, left-wing and possibly humorous bumper stickers and t-shirts
But most stuff are quite logical and easy to pick up for a Perl 5 programmer like ... (yada yada yada), etc.
boolean operators,
Lots are straight Perl 5, like .. list ..), { }-use, []-use, \, etc.
eq, ne, (
quite a few are pure C (and Perl 5), like
--, ++, +=, ==, !=, &&, ||, |=, [array access], etc.
In short, it's not that different from Perl 5. An indication on the periodic table for what is different from Perl 5 would have been very useful.
Author, please?
Karma: Excellent (My Karma? I wish...:-( )
...remember that unlike Perl operators, you can't overload the chemical elements. Imagine if He meant helium, unless some chemist changed its definition to mean Mercury, or Ununtrium, or anything else!
Mmm, a bottle of good old H2O! Glug glug. What's this small print? "The oxygen in this molecule has been overloaded to be radioactive, caustic, and-" ack!
Thud.
The amazing properties of the periodic table was that you could predict properties of elements that had not yet been discovered, and this amazing property is of use today. For example, we can predict that, chemically, strontium makes a good calcium analog because they are in the same column, and we are right! Strontium is often found in bones where calcium normally is. (this was important when there was a lot of radioactive strontium in fallout and when it decayed it didn't hold the bone together as well.)
Anyway way, for other properties, next-to relationships are importantand also allows for predictions to be made.
Just one nitpick:
That is, as far as I know, true for all but lisp macros. (Perl 6 changes that situation?)Lisp is the only language I'd rather use than Perl -- for most tasks.
Karma: Excellent (My Karma? I wish...:-( )
Excellent antialiasing, excellent fonts with good kerning, great drop shadows, lots of repititive work assembled pretty much flawlessly... This chart gets an A+ for style (which is pretty rare in the non-Mac Unix world).
Does anybody know the tool Mark Lentcner used to make it? Illustrator? Could I be so bold as to hope that Sodipodi or Inkscape are now capable of something like this?
Unfortunately, you still have know these operators in order to READ Perl code written by other programmers.
Perl 5 is already conceptually too large to use. Perl 6 just takes things completely over the top.
Mike
"Not an actor, but he plays one on TV."
It's a PDF v1.4 document. You need Acrobat 5 or higher (or the equivalent) to view it properly. It looks black because the transparent images are not supported in PDF v1.3 and earlier. It could be considered a flaw that Acrobat 4 does not recognize that it's a newer PDF than the application knows how to render.
The author probably built the chart in Illustrator, which outputs its PDF documents as v1.4 by default.
The problem with large languages is not that they are large but that it is very difficult to arrive at a consistent useful description. Our modern languages have evolved over a very long time. A modern theory is that the capacity for language is hardwired into our genes and is the primary differentiator of humans from animals.
Programming lanaguages on the other hand are small. While Turing completeness may imply that all languages are equivalent, it is easier to interface with languages that most closely match the domain being modelled and are closer to the way we humans think.
For all this the large number of operators in Perl are not bad as long as they are internally consistent and consistent with the way we think.
Using a relatively obscure subset of Perl is akin to using jargon in a paper. Noone but those "in the know" would fully understand what on earth you're on about. When you want to make yourself understandable to a wider audience it is at times (unfortunately) necessary to lower your vocabulary to the lowest common denominator. But with most programmers being less than adept at social interaction, this concept doesn't get applied to writing code very often.
Which brings us back to this periodic table. It's use is to create a common vocabulary. Chemists use the periodic table as a common framework, so people can understand eachother when they're talking about materials. Sodium (English) = Natrium(dutch) = Na. Most chemistry specialists would identify Na. Not many dutch chemists would easily identify "Sodium". If you had to make sure someone understood you, what would you use? I hope that this table gets wider recognition.
click-clack, front and back. I'm not moving this car otherwise.