Programming Language Alignment Chart?

Please compose all posts in Emacs.

Moderators: phlip, Moderators General, Prelates

zachbarnett
Posts: 17
Joined: Mon Feb 28, 2011 6:16 am UTC

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

User avatar
Xanthir
My HERO!!!
Posts: 5215
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

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)))

++$_
Mo' Money
Posts: 2370
Joined: Thu Nov 01, 2007 4:06 am UTC

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.

User avatar
Mat
Posts: 414
Joined: Fri Apr 21, 2006 8:19 pm UTC
Location: London

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
scarecrovv
It's pronounced 'double u'
Posts: 674
Joined: Wed Jul 30, 2008 4:09 pm UTC
Location: California

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.

squareroot
Posts: 546
Joined: Tue Jan 12, 2010 1:04 am UTC
Contact:

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 />

User avatar
enk
Posts: 754
Joined: Mon Sep 10, 2007 12:20 am UTC
Location: Aalborg, Denmark
Contact:

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
MHD
Posts: 630
Joined: Fri Mar 20, 2009 8:21 pm UTC
Location: 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"

User avatar
Mat
Posts: 414
Joined: Fri Apr 21, 2006 8:19 pm UTC
Location: London

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
TNorthover
Posts: 191
Joined: Wed May 06, 2009 7:11 am UTC
Location: Cambridge, UK

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
enk
Posts: 754
Joined: Mon Sep 10, 2007 12:20 am UTC
Location: Aalborg, Denmark
Contact:

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.

exotica
Posts: 3
Joined: Fri Dec 26, 2008 3:52 pm UTC

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."

devdog
Posts: 0
Joined: Thu Feb 14, 2013 7:20 am 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

EvanED
Posts: 4324
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

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.

KnightExemplar
Posts: 5489
Joined: Sun Dec 26, 2010 1:58 pm UTC

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.

confuciusdragon
Posts: 0
Joined: Wed Feb 20, 2013 8:51 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.

Derek
Posts: 2152
Joined: Wed Aug 18, 2010 4:15 am 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.

EvanED
Posts: 4324
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

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.

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

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.

dii
Posts: 164
Joined: Fri Feb 22, 2013 2:42 am UTC
Location: 60.17°N 24.94°E

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

lorb
Posts: 404
Joined: Wed Nov 10, 2010 10:34 am UTC
Location: Austria

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.)
http://decodedarfur.org/

Derek
Posts: 2152
Joined: Wed Aug 18, 2010 4:15 am UTC

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.

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

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".

dii
Posts: 164
Joined: Fri Feb 22, 2013 2:42 am UTC
Location: 60.17°N 24.94°E

Re: Programming Language Alignment Chart?

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

The strong/weak distinction is largely meaningless anyway.

rawshark
Posts: 5
Joined: Wed Dec 24, 2008 4:40 pm UTC

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             |
|                |              |                 |
|                |              |                 |

zenten
Posts: 3799
Joined: Fri Jun 22, 2007 7:42 am UTC
Location: Ottawa, Canada

Re: Programming Language Alignment Chart?

Postby zenten » Sat Aug 17, 2013 4:25 pm UTC

Good should be languages taught a lot in university and thought of as "elegant" but not used much in the real world, like Prolog or Scheme.

Neutral (on the good/evil scale) should be languages used a lot in the real world, like Java or C#.

Evil should be languages that people shudder to use (and not just because they were designed to be horrible as a joke, although those would be here too), like COBOL or Fortran.

DrZiro
Posts: 132
Joined: Mon Feb 09, 2009 3:51 pm UTC

Re: Programming Language Alignment Chart?

Postby DrZiro » Wed Dec 21, 2016 1:34 pm UTC

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

Definitely. Basically, are you allowed to write dirty hacks, or do you have to follow strict rules? That's pretty much an exact parallel to D&D - is it okay to break the rules for the greater good?

Mat wrote: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

I'd hardly call C lawful. It may be strongly typed, but clear and straightforward it isn't. C being chaos is the whole point of Java. Similarly, Perl being chaos is kind of the point of Python, so I'd be inclined to call Python at least neutral. It has some flexibility, but philosophy-wise, it's decidedly lawful.

As for good/evil, that's tricky. We could just label obfuscated languages as evil, but that would leave an awful lot of good ones. It's also tempting to just label the ones you like as good, but that would hardly lead to any consensus. Maybe the best option is to equate "good" with "easy". So good languages would include modern kid-friendly things like Python and Ruby, as well as older languages made for beginners, such as Pascal and Basic, whereas evil languages would be those that typically takes longer to learn, like C, and of course Assembly.

commodorejohn
Posts: 958
Joined: Thu Dec 10, 2009 6:21 pm UTC
Location: Placerville, CA
Contact:

Re: Programming Language Alignment Chart?

Postby commodorejohn » Wed Dec 21, 2016 3:08 pm UTC

C is transcendent and cannot be circumscribed by your petty morality.
"'Legacy code' often differs from its suggested alternative by actually working and scaling."
- Bjarne Stroustrup
www.commodorejohn.com - in case you were wondering, which you probably weren't.

User avatar
markfiend
Posts: 482
Joined: Fri Jul 06, 2007 9:59 am UTC
Location: UK (Leeds)

Re: Programming Language Alignment Chart?

Postby markfiend » Thu Jan 05, 2017 1:15 pm UTC

php:
Any language that contains both array_search($needle, $haystack) for array search and strpos($haystack, $needle) for string search must be chaotic evil.
Attoc dna Sublab evol eht teews secoiv fo eht slrug
pronouns: he/him/his

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: Programming Language Alignment Chart?

Postby ahammel » Thu Jan 05, 2017 5:28 pm UTC

Here's my attempt at a scale without reference to type systems:

Law/Chaos
Lawful: has very strong opinions about how programs should be structured. Single-paradigm. File structure is enforced either by the compiler or by very strong convention. The answer to "how do I do things this other way?" is "you don't, do it the 'right' way". All codebases in the language have the same look-and-feel.
Neutral: has no strong opinions about how programs should be structured. Programming-in-the-large features can be built from programming-in-the-small features in several different ways. File structure is ad-lib. Lots of "frameworks".
Chaotic: program structure is completely up to the programmer. Aggressively multi-paradigm. "There's more than one way to do it". Look-and-feel varies widely across projects.

Good/Evil
Good: wants to help the programmer. Goes out of its way to make wrong code look wrong. Well-specified, good documentation. Helpful static analysis tools. Design philosophy is centred on developer experience above other considerations.
Neutral: beyond good and evil. Design philosophy is centred on some "higher" goal than developer experience (functional purity, code aesthetics, a novel programming paradigm, etc.). The design philosophy is consistent, even when it means sacrificing dev experience.
Evil: wants to hurt the programmer. Lots of inconsistencies and pitfalls. Poorly-specified. Static analysis is very difficult. Design philosophy is inconsistent and often sacrifices developer experience for ease of implementation.

Lawful Good: Clojure, Elm
Lawful Neutral: Java, Haskell, Erlang, Prolog, Rust
Lawful Evil: COBOL

Neutral Good: Python, Scheme, Lua
True Neutral: C(++)
Neutral Evil: PHP, Javascript, the sh family

Chaotic Good: Mozart/Oz
Chaotic Neutral: Scala, Ruby, Common Lisp
Chaotic Evil: Perl
He/Him/His/Alex
God damn these electric sex pants!

shieldforyoureyes
Posts: 339
Joined: Sat Apr 19, 2008 9:00 am UTC
Contact:

Re: Programming Language Alignment Chart?

Postby shieldforyoureyes » Thu Jan 12, 2017 9:32 am UTC

Image

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 2489
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Programming Language Alignment Chart?

Postby Soupspoon » Thu Jan 12, 2017 12:14 pm UTC


commodorejohn
Posts: 958
Joined: Thu Dec 10, 2009 6:21 pm UTC
Location: Placerville, CA
Contact:

Re: Programming Language Alignment Chart?

Postby commodorejohn » Fri Jan 13, 2017 1:41 am UTC

shieldforyoureyes wrote:Image

Yes, that.
"'Legacy code' often differs from its suggested alternative by actually working and scaling."
- Bjarne Stroustrup
www.commodorejohn.com - in case you were wondering, which you probably weren't.


Return to “Religious Wars”

Who is online

Users browsing this forum: No registered users and 2 guests