Home > Archive > PERL Miscellaneous > May 2004 > Meaning of Orthogonality
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Meaning of Orthogonality
|
|
| Edward Wijaya 2004-05-18, 9:31 pm |
| Perl is said to be an "orthogonal" programming language.
What does it mean?
Regards
Edward WIJAYA
SINGAPORE
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
| |
| Gregory Toomey 2004-05-18, 10:31 pm |
| Edward Wijaya wrote:
> Perl is said to be an "orthogonal" programming language.
> What does it mean?
>
> Regards
> Edward WIJAYA
> SINGAPORE
>
The computer science meaning is derived from the matematical meaning.
The simplest meaning is "at right angles". Think of walking along and
throwing a ball in the air - you can do one, or either, or both.
One thing does not effect the other, and the two combinations are possible
at the same time.
http://en.wikipedia.org/wiki/Orthogonal
The computer science meaning is
- a set of basic constructs
- there are many combinations of the basic constructs allowed.
For example, many of Perl's functions work on both scalars and arrays.
gtoomey
| |
| Joachim Pense 2004-05-19, 2:31 am |
| Edward Wijaya wrote <opr78nubyeuj0cst@news.singnet.com.sg>:
> Perl is said to be an "orthogonal" programming language.
> What does it mean?
>
The meaning of "orthogonal" is explained by Gregory in this thread. But who
said Perl was an orthogonal language? It is non-orthogonal by design, which
is generally considered an advantage.
Joachim
| |
|
| "Gregory Toomey" <nospam@bigpond.com> wrote in message
news:6461687.pkFTbbq1S8@GMT-hosting-and-pickle-farming...
[about orthogonality]
> For example, many of Perl's functions work on both scalars and arrays.
but many times, the scalar functionality does something different
than the other one, so I am not sure 'orthogonal' applies to Perl
in fact all the DWIMmery sounds pretty non-orthogonal to me.
gnari
| |
| Edward Wijaya 2004-05-19, 11:31 am |
| Mr. Wall said so can be found in Camel Book.
On Wed, 19 May 2004 08:43:13 -0000, Edward Wijaya <ewijaya@singnet.com.sg>
wrote:
> Perl is said to be an "orthogonal" programming language.
> What does it mean?
>
> Regards
> Edward WIJAYA
> SINGAPORE
>
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
| |
| A. Sinan Unur 2004-05-19, 12:32 pm |
| Edward Wijaya <ewijaya@singnet.com.sg> wrote in
news:opr79qdvt4uj0cst@news.singnet.com.sg:
[ please do not top-post ]
> On Wed, 19 May 2004 08:43:13 -0000, Edward Wijaya
> <ewijaya@singnet.com.sg> wrote:
>
[color=darkred]
> Mr. Wall said so can be found in Camel Book.
Could you give a page number please? I would like to see the quotation in
context.
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
| |
| Thomas Kratz 2004-05-19, 12:32 pm |
| A. Sinan Unur wrote:
> Edward Wijaya <ewijaya@singnet.com.sg> wrote in
> news:opr79qdvt4uj0cst@news.singnet.com.sg:
>
> [ please do not top-post ]
>
>
>
>
>
>
> Could you give a page number please? I would like to see the quotation in
> context.
>
PP 3rd Ed, Page 28 footnote:
"Some folks feel that such redundancy is evil because it keeps a language
from being minimalistic, or orthogonal. But Perl isn't an orthogonal
language; it's a diagonal language"
Being able to read is an obvious advantage ;-)
Thomas
--
open STDIN,"<&DATA";$=+=14;$%=50;while($_=(s ( #J~.> a>n~>>e~.......>r.
STDIN,$:*$=+$,+$%,0),getc)){/\./&&last;/\w| /&&( #.u.t.^..oP..r.>h>a~.e..
print,$_=$~);/~/&&++$:;/\^/&&--$:;/>/&&++$,;/</ #.>s^~h<t< ..~. ...c.^..
&&--$,;$:%=4;$,%=23;$~=$_;++$i==1?++$,:_;}__END__#....>>e>r^..>l^...>k^..
| |
| Purl Gurl 2004-05-19, 1:31 pm |
| Thomas Kratz wrote:
> A. Sinan Unur wrote:
(snipped)
[color=darkred]
[color=darkred]
> PP 3rd Ed, Page 28 footnote:
> "Some folks feel that such redundancy is evil because it keeps a language
> from being minimalistic, or orthogonal. But Perl isn't an orthogonal
> language; it's a diagonal language"
I like to think of Perl as a matrix language.
My viewpoint is most functions, each perform different tasks
and travel along different outward paths to other functions,
which do the same. Function inward paths behave the same.
Paths can intersect, change directions, either outward or inward,
even loop around in circles, recurse or lead to an eventual exit.
Traditionally, data flow charts are basically linear in nature.
With Perl, some programs exhibit a matrix like pattern, especially
when a few modules are tossed in.
Purl Gurl
| |
| Edward Wijaya 2004-05-19, 1:31 pm |
| Yes my mistake....Thanks for correcting me.
On Wed, 19 May 2004 17:48:47 +0200, Thomas Kratz
<ThomasKratz@REMOVEwebCAPS.de> wrote:
> A. Sinan Unur wrote:
>
>
> PP 3rd Ed, Page 28 footnote:
>
> "Some folks feel that such redundancy is evil because it keeps a
> language from being minimalistic, or orthogonal. But Perl isn't an
> orthogonal language; it's a diagonal language"
>
> Being able to read is an obvious advantage ;-)
>
> Thomas
>
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
| |
| A. Sinan Unur 2004-05-19, 1:31 pm |
| Edward Wijaya <ewijaya@singnet.com.sg> wrote in
news:opr79u5vc9uj0cst@news.singnet.com.sg:
> Yes my mistake....Thanks for correcting me.
You are still top posting. Now we know why.
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
| |
| Jim Keenan 2004-05-19, 1:31 pm |
| Edward Wijaya <ewijaya@singnet.com.sg> wrote in message news:<opr78nubyeuj0cst@news.singnet.com.sg>...
> Perl is said to be an "orthogonal" programming language.
> What does it mean?
>
Says who?
Can you provide a link to a source so that we could evaluate the
statement/claim in context?
Thank you very much.
Jim Keenan
Brooklyn, NY
| |
| Xaonon 2004-05-19, 1:31 pm |
| Ned i bach <196cb7af.0405190822.5ec0391c@posting.google.com>, Jim Keenan
<jkeen_via_google@yahoo.com> teithant i thiw hin:
> Edward Wijaya <ewijaya@singnet.com.sg> wrote in message
> news:<opr78nubyeuj0cst@news.singnet.com.sg>...
>
>
> Says who?
>
> Can you provide a link to a source so that we could evaluate the
> statement/claim in context?
From perlhack, item 2:
-> Does concept match the general goals of Perl?
-> These haven't been written anywhere in stone, but one
-> approximation is:
->
-> 1. Keep it fast, simple, and useful.
-> 2. Keep features/concepts as orthogonal as possible.
-> 3. No arbitrary limits (platforms, data sizes, cultures).
-> 4. Keep it open and exciting to use/patch/advocate Perl everywhere.
-> 5. Either assimilate new technologies, or build bridges to them.
And implicitly from the Camel book, page 219:
-> Since @_ is just a regular array with an irregular name, you can do
-> anything to it you'd normally do to an array.*
->
-> * This is an area in where Perl is /more/ orthogonal than the typical
-> programming language.
--
Xaonon, EAC Chief of Mad Scientists and informal BAAWA, aa #1821, Kibo #: 1
http://xaonon.dyndns.org/ Guaranteed content-free since 1999. No refunds.
"Would someone please tackle Donald Rumsfeld and lock his ass up until our
`Countries-Destroyed-to-Countries-Rebuilt' ratio is closer to `1'?" -- GYWO
| |
| John Bokma 2004-05-19, 4:31 pm |
| Purl Gurl wrote:
> I like to think of Perl as a matrix language.
You watch too much movies.
> Paths can intersect, change directions, either outward or inward,
> even loop around in circles, recurse or lead to an eventual exit.
That's a graph. So Perl is a graph language :-D
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
| |
| Purl Gurl 2004-05-19, 4:31 pm |
| John Bokma wrote:
> Purl Gurl wrote:
[color=darkred]
> You watch too much movies.
Ok, ok, Perl is a Debbie Dallas language.
[color=darkred]
> That's a graph. So Perl is a graph language :-D
No, no, it is Debbie Dallas Graphical. Get it right.
* thinks of an Etch-A-Sketch *
Nah, the boys here probably wouldn't sucker for that one.
Purl Gurl
| |
| Greg Miller 2004-05-19, 8:31 pm |
| On Wed, 19 May 2004 08:43:13 -0000, Edward Wijaya
<ewijaya@singnet.com.sg> wrote:
>Perl is said to be an "orthogonal" programming language.
>What does it mean?
Means it has more than 8 sides. ;) Seriously, loosely
speaking it means all features in the language are created equally.
E.G. In perl you can return an integer from a function, but you can't
return an array from a function (a pointer to an array doesn't count).
So Perl is not orthogonal (like everyone else said). In an completely
orthogonal language, you should be able to have an array of functions.
Not that it's useful, but that's what it would have to do.
But, in general, when people refer to whether or not a
language is orthogonal, they're referring to whether or not all of the
language's data types can be used like any other. E.G. operator
overloading, returning an object from a function, arrays of arrays of
structs of objects.
I'm not sure how this word came to be associated with
programming languages. The mathematical definition says two things
are orthogonal if they are at 90 degrees to each other. If you try to
adapt that to programming language structures, you'd think an
orthogonal language is one that treats everything differently than
everything else. But in the programming languages context, it means
to treat everything the same.
Now that I've said that, I've noticed the mathematical
definition of orthogonal, and the programming language definition are
orthogonal to each other! Maybe it was a joke someone made that got
out of hand.
Oh, and here's a programming language which follows the
mathematical definition of orthogonal:
http://www.muppetlabs.com/~breadbox/orth/
I'm assuming (hoping) that really is a joke.
| |
| Ben Morrow 2004-05-19, 9:31 pm |
|
Quoth Greg Miller <gmiller@NOTforSPAM.gregmiller.net>:
> Means it has more than 8 sides. ;) Seriously, loosely
> speaking it means all features in the language are created equally.
> E.G. In perl you can return an integer from a function, but you can't
> return an array from a function (a pointer to an array doesn't count).
> So Perl is not orthogonal (like everyone else said). In an completely
> orthogonal language, you should be able to have an array of functions.
> Not that it's useful, but that's what it would have to do.
> I'm not sure how this word came to be associated with
> programming languages. The mathematical definition says two things
> are orthogonal if they are at 90 degrees to each other. If you try to
> adapt that to programming language structures, you'd think an
> orthogonal language is one that treats everything differently than
> everything else. But in the programming languages context, it means
> to treat everything the same.
> Now that I've said that, I've noticed the mathematical
> definition of orthogonal, and the programming language definition are
> orthogonal to each other! Maybe it was a joke someone made that got
> out of hand.
No, it does make sense. It means, to take you example, that the
definition of 'function return value' is orthogonal to the definition of
'data types': any function can return any data type. Think vectors: two
vectors are orthogonal iff any combination gives another unique vector.
Ben
--
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk
| |
| Anno Siegel 2004-05-20, 6:31 pm |
| Greg Miller <gmiller@NOTforSPAM.gregmiller.net> wrote in comp.lang.perl.misc:
> On Wed, 19 May 2004 08:43:13 -0000, Edward Wijaya
> <ewijaya@singnet.com.sg> wrote:
>
[...]
[color=darkred]
> I'm not sure how this word came to be associated with
> programming languages. The mathematical definition says two things
> are orthogonal if they are at 90 degrees to each other. If you try to
> adapt that to programming language structures, you'd think an
> orthogonal language is one that treats everything differently than
> everything else. But in the programming languages context, it means
> to treat everything the same.
The mathematical sense of "orthogonal" from which the usage in computer
languages derives isn't so much "90 degrees", but the concept of
orthogonal coordinates (or matrices), where the angles between any two
axes are 90 degrees. In such a coordinate system you can choose x, y,
and z independently. In an oblique system, the coordinates depend on
one another.
That idea carries over nicely to the usage in computer languages, where
you get to choose (say) an operator and the type of operands independently,
whereas in less orthogonal languages the choice of one may determine the
choices for the others. In mathematics, at least the dependency is linear,
in computer languages it can be arbitrary.
> Now that I've said that, I've noticed the mathematical
> definition of orthogonal, and the programming language definition are
> orthogonal to each other! Maybe it was a joke someone made that got
> out of hand.
I think it's a good metaphor, taken as above.
Anno
|
|
|
|
|