Programming Language Alignment Chart?

Please compose all posts in Emacs.

Moderators: phlip, Moderators General, Prelates

Programming Language Alignment Chart?

Postby zachbarnett » Tue Mar 01, 2011 2:45 am UTC

In my CS class, the topic of creating an alignment chart (lawful good, lawful neutral, etc.) for programming languages came up. Let's decide in this thread how it would look, and once we have some consensus, I (or someone else) will post the result.

Possible Languages:
Ajax
Basic
C
C#
C++
Haskell
Java
Pascal
Perl
PHP
Python
Visual Basic
XML
zachbarnett
 
Posts: 18
Joined: Mon Feb 28, 2011 6:16 am UTC

Re: Programming Language Alignment Chart?

Postby Xanthir » Tue Mar 01, 2011 4:00 am UTC

Well, there's the clear mapping between static/dynamic typing and law/chaos. I would suggest that strict/loose typing maps to good/evil, but that's perhaps too much typing-related stuff.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 3989
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Programming Language Alignment Chart?

Postby ++$_ » Tue Mar 01, 2011 8:59 am UTC

I agree that static/dynamic typing makes sense for the law/chaos axis.

I don't think a good/evil axis can be defined without a full-scale war breaking out. For example, I think loose typing is good; Xanthir thinks it's evil.

However, I do think it is important that any definition puts Brainfuck squarely on the "evil" side, so I'd suggest "readability" as a possibility. Of course, the question of "how readable is X" is a full-scale war in and of itself.
++$_
Mo' Money
 
Posts: 2370
Joined: Thu Nov 01, 2007 4:06 am UTC

Re: Programming Language Alignment Chart?

Postby Mat » Tue Mar 01, 2011 9:52 am UTC

Well XML itself isn't a programming language and there's not much you can say about it except for its syntax. Ajax is more a technique, so doesn't count either.

If you exclude that I'd go with

lawful characteristics = strongly typed, straightforward syntax, language follows one paradigm instead of allowing many
chaotic characteristics = perl

good = expressive
evil = lots of code to do one thing

So I'd place them something like this (but I haven't actually used all these languages)
Basic = chaotic evil
C = lawful evil
C# = lawful neutral
C++ = chaotic neutral
Haskell = lawful good
Java = lawful neutral
Javascript = chaotic good
Pascal = lawful evil
Perl = chaotic good
PHP = chaotic neutral
Python = chaotic awesome
User avatar
Mat
 
Posts: 395
Joined: Fri Apr 21, 2006 8:19 pm UTC
Location: London

Re: Programming Language Alignment Chart?

Postby scarecrovv » Tue Mar 01, 2011 5:09 pm UTC

procedural -> chaotic
functional -> lawful

long programs -> evil
short programs -> good

These are the extremes:

lawful evil -> Unlambda
chaotic evil -> Brainfuck
lawful good -> Haskell
chaotic good -> I don't know of anything at this extreme. Perl seems closest though. Not a strong opinion. Open for debate.

Everything else falls between these corners. This being religious wars, I am of course, exactly correct.
User avatar
scarecrovv
 
Posts: 583
Joined: Wed Jul 30, 2008 4:09 pm UTC
Location: Massachusetts

Re: Programming Language Alignment Chart?

Postby squareroot » Wed Mar 02, 2011 12:39 am UTC

According to the above post, maybe Chaotic Good = J? I have hard time reconciling that as "good" though. It seems like anything of that ... esotericness is just bad.

I don't understand why you're saying functional = lawful. Something like functional -> readable -> straightforward -> lawful?
<signature content="" style="tag:html;" overused meta />
squareroot
 
Posts: 543
Joined: Tue Jan 12, 2010 1:04 am UTC

Re: Programming Language Alignment Chart?

Postby enk » Wed Mar 02, 2011 4:07 pm UTC

Mat wrote:lawful characteristics = strongly typed, straightforward syntax, language follows one paradigm instead of allowing many
chaotic characteristics = perl

I dig your characterization of Python, but according to the above, maybe it should be lawful since it is strongly typed and has straightforward syntax.
phlip wrote:Ha HA! Recycled emacs jokes.
User avatar
enk
 
Posts: 754
Joined: Mon Sep 10, 2007 12:20 am UTC
Location: Aalborg, Denmark

Re: Programming Language Alignment Chart?

Postby MHD » Wed Mar 02, 2011 5:56 pm UTC

Where does prolog fit?
EvanED wrote:be aware that when most people say "regular expression" they really mean "something that is almost, but not quite, entirely unlike a regular expression"

language blag
User avatar
MHD
 
Posts: 630
Joined: Fri Mar 20, 2009 8:21 pm UTC
Location: Denmark

Re: Programming Language Alignment Chart?

Postby Mat » Wed Mar 02, 2011 7:19 pm UTC

enk wrote:
Mat wrote:lawful characteristics = strongly typed, straightforward syntax, language follows one paradigm instead of allowing many
chaotic characteristics = perl

I dig your characterization of Python, but according to the above, maybe it should be lawful since it is strongly typed and has straightforward syntax.

Hmm.. I'm probably using terminology wrong, but I didn't consider python/duck typing strongly typed as you can use objects however you want and any type problems won't become apparent until runtime. That seems enough for a chaotic rating, but maybe less so than some other scripting languages. Also there's a bunch of weirdness in the language just due to its history, e.g. http://docs.python.org/faq/design.html#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list which seems kinda chaotic as well.
User avatar
Mat
 
Posts: 395
Joined: Fri Apr 21, 2006 8:19 pm UTC
Location: London

Re: Programming Language Alignment Chart?

Postby TNorthover » Wed Mar 02, 2011 7:42 pm UTC

Xanthir wrote:Well, there's the clear mapping between static/dynamic typing and law/chaos. I would suggest that strict/loose typing maps to good/evil, but that's perhaps too much typing-related stuff.

I don't know, it puts perl at chaotic evil. Any categorization which doesn't do that is intrinsically flawed in my view, so it's as good a place as any to start.</troll>
User avatar
TNorthover
 
Posts: 191
Joined: Wed May 06, 2009 7:11 am UTC
Location: Cambridge, UK

Re: Programming Language Alignment Chart?

Postby enk » Wed Mar 02, 2011 9:07 pm UTC

Mat wrote:Hmm.. I'm probably using terminology wrong, but I didn't consider python/duck typing strongly typed as you can use objects however you want and any type problems won't become apparent until runtime. That seems enough for a chaotic rating, but maybe less so than some other scripting languages.

Yes, Python is dynamically/duck typed, but it's also strongly typed. You can't add a string and an int, for example. That kind of thing is possible to different extents, in PHP, Perl and Javascript.
phlip wrote:Ha HA! Recycled emacs jokes.
User avatar
enk
 
Posts: 754
Joined: Mon Sep 10, 2007 12:20 am UTC
Location: Aalborg, Denmark

Re: Programming Language Alignment Chart?

Postby exotica » Tue Oct 11, 2011 11:24 am UTC

I don't see how to map languages into two dimensions without so much loss of information, that languages not at all alike end up being labelled the same.

I'd use:
more traditional (typically procedural or mixed style) -> lawful
functional and/or strongly typed, mostly esoteric or new languages -> chaotic

C/C++: lawful neutral
Perl: neutral evil
Java: lawful evil
Ruby: neutral good
Python: neutral
Clojure: chaotic neutral
common lisp [sbcl]: chaotic neutral
Scheme: chaotic neutral
OCaml: chaotic neutral
Haskell: chaotic good
javascript: chaotic neutral
C#: neutral evil
F#: chaotic evil
PHP: neutral evil
Erlang: neutral
Scala: neutral good

"There's nothing either good or bad, but thinking makes it so."
exotica
 
Posts: 2
Joined: Fri Dec 26, 2008 3:52 pm UTC

Re: Programming Language Alignment Chart?

Postby devdog » Thu Feb 14, 2013 7:49 am UTC

I think Law/Chaos is amount of structure (Lawful is strict, chaotic lacks rules), and Good/Evil should be user-friendliness
From my limited coding experience:

Java: Lawful Neutral (using Eclipse, because it's very helpful, but it doesn't let you finish typing before it starts yelling at you)
Python: Chaotic Good
Brainfuck: Chaotic Evil (I don't even think that is extreme enough)
Visual Basic: Chaotic Neutral
C++: Lawful Neutral
Javascript: Chaotic Good
devdog
 
Posts: 0
Joined: Thu Feb 14, 2013 7:20 am UTC

Re: Programming Language Alignment Chart?

Postby EvanED » Fri Feb 15, 2013 12:39 am UTC

devdog wrote:Javascript: Chaotic Good

I would not put Javascript above neutral. Probably not evil, but it's pushing the line.

It's also missing something like Haskell, which may the epitome of the "lawful" end of the scale; I'd definitely say lawful good. The ML family also holds that corner... I'd say less lawful, but also a little gooder.
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Programming Language Alignment Chart?

Postby KnightExemplar » Fri Feb 15, 2013 1:55 am UTC

Lawful Typeful language would be Haskell
Chaotic Typeful IMO, would be C / C++.
Lawful Typeless is Ruby or Python
Chaotic Typeless is Javascript, PHP, Perl...

"Lawful" languages stick with the principle of "There's only one way to do it" (Python's slogan).
"Chaotic" languages stick with the principle of "There is more than one way to do it" (Perl's slogan).

C/C++ are Chaotic because they have left so much of the standard up to interpretation. There can be massive differences between say... Keil C (embedded C), GCC, Visual C++, and Apple's Objective-C. All of these examples follow the C89 Standard, and yet code is not portable between them :-p. But thats the advantage of C / C++, they have so much of the language open for "undefined implementation details" that they are highly optimized for the platforms that they are designed for.

I'd make the argument that ARM Assembly is Chaotic Typeful, given all of the different implementations of ARM. But keeping track of dwords, floats, and Thumb code and so forth definitely shows that ARM assembly has "types" conceptually in its language.

Thanks to the principle of "More than one way to do it", there are a near infinite number of chaotic typeless programming languages. But its hard to think of Chaotic Typeful languages, because a type system almost innately restricts a language into doing things in a particular way.
First Strike +1/+1 and Indestructible.
KnightExemplar
 
Posts: 1589
Joined: Sun Dec 26, 2010 1:58 pm UTC

Re: Programming Language Alignment Chart?

Postby confuciusdragon » Wed Feb 20, 2013 8:55 pm UTC

I think C++ is more of a true neutral language.
confuciusdragon
 
Posts: 0
Joined: Wed Feb 20, 2013 8:51 pm UTC

Re: Programming Language Alignment Chart?

Postby Derek » Thu Feb 21, 2013 3:45 am UTC

confuciusdragon wrote:I think C++ is more of a true neutral language.

I would call C true neutral. C++ is definitely chaotic.
Derek
 
Posts: 962
Joined: Wed Aug 18, 2010 4:15 am UTC

Re: Programming Language Alignment Chart?

Postby EvanED » Thu Feb 21, 2013 4:28 am UTC

Derek wrote:
confuciusdragon wrote:I think C++ is more of a true neutral language.

I would call C true neutral. C++ is definitely chaotic.
I'd view typing as an important component (probably the most important component) of the lawful/chaotic scale, and C++ is a lot more strongly-typed than a lot of languages out there. (It's much weaker than others, but I'd say it tends to be around the median, and probably higher if you look at actual modern C++ usage.)

Furthermore, on similar grounds I would definitely argue that it's no more chaotic than C. C has several "chaotic" bits that are not in C++ (e.g. implicit conversions from void*), several more (e.g. casting) which have less-chaotic means to accomplish similar things, and few ways in which it's less chaotic. I think that implementation differences in templates in particular is about the one significant exception.

I see C++ as pretty firmly in the neutral category on the lawful/chaotic axis.
EvanED
 
Posts: 3765
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Programming Language Alignment Chart?

Postby troyp » Fri Feb 22, 2013 3:53 am UTC

I agree that law/chaos would mostly be typing - both static/dynamic and various notions of "typing strength" (occurrence of unchecked type errors at runtime, implicit casts, etc, would be chaotic).

I think good/evil must represent whether a programming language is benevolent (attempting to empower its users) or tyrannical (forcing the coder to code how it wants them to, persecuting or outlawing unapproved styles of programming). An archetypical expression of the latter is the omission of a goto construct from an imperative PL (the "final solution" to unsanctioned flow control)*. Low level languages (eg. assembly) tend to be neutral since they are neither empowering nor constraining. Languages with a balance of good/evil characteristics (eg. Python) are also classed as neutral on the good-evil axis.

Alignment reflects only attitude and outlook, of course. Some good-aligned languages with very low INT, WIS and/or DEX may wreak havoc in their kingdoms simply due to their ineptitude.

Examples:
LG: Haskell, Scala
NG: C++ (L tendencies), Lisp
CG: Perl**
LN: Java (E tendencies)
N: C (L tendencies), Python (G tendencies)
CN: Assembly
LE: Pascal
NE: MATLAB
CE: Brainfuck

* Despite the genocidal nature of the policy, it would only imply neutrality - rather than evil - due to its prevalence.
** The gorgon Perl is commonly believed to be evil but is, in truth, benign. Its negative reputation stems from its extremely low charisma and the fact that its readers are sometimes turned to stone.
troyp
 
Posts: 398
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: Programming Language Alignment Chart?

Postby dii » Fri Feb 22, 2013 6:20 pm UTC

C#: neutral evil
Java: chaotic evil
Python: chaotic good
C: neutral good
C++: lawful neutral
Vala: lawful good
D: lawful good
Lisp: chaotic neutral
dii
 
Posts: 50
Joined: Fri Feb 22, 2013 2:42 am UTC
Location: 60.17°N 24.94°E

Re: Programming Language Alignment Chart?

Postby lorb » Tue Mar 12, 2013 9:29 pm UTC

enk wrote:
Mat wrote:Hmm.. I'm probably using terminology wrong, but I didn't consider python/duck typing strongly typed as you can use objects however you want and any type problems won't become apparent until runtime. That seems enough for a chaotic rating, but maybe less so than some other scripting languages.

Yes, Python is dynamically/duck typed, but it's also strongly typed. You can't add a string and an int, for example. That kind of thing is possible to different extents, in PHP, Perl and Javascript.


You can't add them but you can multiply them. Makes it even more chaotic. Sometimes it's strongly typed and sometimes it isn't.
Code: Select all
>>> "string"*3
'stringstringstring'
Please be gracious in judging my english. (I am not a native speaker/writer.)
lorb
 
Posts: 134
Joined: Wed Nov 10, 2010 10:34 am UTC
Location: Austria

Re: Programming Language Alignment Chart?

Postby Derek » Wed Mar 13, 2013 5:37 am UTC

I really can't understand what criteria some people are using for these alignments.
Derek
 
Posts: 962
Joined: Wed Aug 18, 2010 4:15 am UTC

Re: Programming Language Alignment Chart?

Postby troyp » Wed Mar 13, 2013 11:01 am UTC

lorb wrote:
enk wrote:
Mat wrote:Hmm.. I'm probably using terminology wrong, but I didn't consider python/duck typing strongly typed as you can use objects however you want and any type problems won't become apparent until runtime. That seems enough for a chaotic rating, but maybe less so than some other scripting languages.

Yes, Python is dynamically/duck typed, but it's also strongly typed. You can't add a string and an int, for example. That kind of thing is possible to different extents, in PHP, Perl and Javascript.


You can't add them but you can multiply them. Makes it even more chaotic. Sometimes it's strongly typed and sometimes it isn't.
Code: Select all
>>> "string"*3
'stringstringstring'

That doesn't indicate weak typing. It just indicates operator overloading.

More generally, whether Python is strongly typed depends on which of the many definitions of "strongly typed" you're using. In almost all cases, it is weakly typed - the claim that it's strongly typed seems to be based on the colloquial use of "strong typing" to mean "no implicit type casting".
troyp
 
Posts: 398
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: Programming Language Alignment Chart?

Postby dii » Wed Mar 13, 2013 7:38 pm UTC

The strong/weak distinction is largely meaningless anyway.
dii
 
Posts: 50
Joined: Fri Feb 22, 2013 2:42 am UTC
Location: 60.17°N 24.94°E

Re: Programming Language Alignment Chart?

Postby rawshark » Thu Mar 28, 2013 1:18 am UTC

Code: Select all
|                |              |                 |
|                |              |                 |
| lawful good    | neutral good | chaotic good    |
|                |              |                 |
| python         | ruby         | javascript      |
|                |              |                 |
|----------------+--------------+-----------------|
|                |              |                 |
|                |              |                 |
| lawful neutral | true neutral | chaotic neutral |
|                |              |                 |
| java           | C            | perl            |
|                |              |                 |
|----------------+--------------+-----------------|
| lawful evil    | neutral evil | chaotic evil    |
|                |              |                 |
| Ada            | VB           | PHP             |
|                |              |                 |
|                |              |                 |
rawshark
 
Posts: 5
Joined: Wed Dec 24, 2008 4:40 pm UTC


Return to Religious Wars

Who is online

Users browsing this forum: No registered users and 3 guests