You're looking at Less Wrong's discussion board. This includes all posts, including those that haven't been promoted to the front page yet. For more information, see About Less Wrong.

RolfAndreassen comments on Open Thread, October 13 - 19, 2013 - Less Wrong Discussion

4 Post author: Coscott 14 October 2013 01:57AM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (247)

You are viewing a single comment's thread.

Comment author: RolfAndreassen 15 October 2013 08:51:44AM 1 point [-]

I had a random-ish thought about programming languages, which I'd like comments on: It seems to me that every successful programming language has a data structure that it specialises in and does better than other languages. Exaggerating somewhat, every language "is" a data structure. My suggestions:

  • C is pointers
  • Lisp is lists (no, really?)
  • Ruby is closures
  • Python is dicts
  • Perl is regexps

Now this list is missing some languages, for lack of my familiarity with them, and also some structures. For example, is there a language which "is" strings? And on this model, what is Java?

Comment author: Lumifer 15 October 2013 09:15:04PM 3 points [-]

I don't think this idea works.

Pointers in C aren't data structures -- they are a low-level tool for constructing data structures. Neither closures nor regexps are "data structures". And Perl was historically well-known for relying on hashes which you assigned to Python as dicts.

Certainly each programming language has a "native" programming style that it usually does better than other languages -- but that's a different thing.

Comment author: cousin_it 15 October 2013 01:24:57PM *  3 points [-]

Well, different languages are based on different ideas. Some languages explore the computational usefulness of a single data structure, like APL with arrays or Forth with stacks. Lisp is pretty big, but yes you could say it emphasizes lists. (If you're looking for a language that emphasizes strings, try SNOBOL or maybe Tcl?) Other languages explore other ideas, like Haskell with purity, Prolog with unification, or Smalltalk with message passing. And there are general-purpose languages that don't try to make any particular point about computation, like C, Java, JavaScript, Perl, Python, Ruby, PHP, etc.

Comment author: Viliam_Bur 15 October 2013 08:48:55PM *  1 point [-]

And on this model, what is Java?

Java is classes -- a huge set of standardized classes, so for most things you want to do, you choose one of those standard classes instead of deciding "which one of the hundred libraries made for this purpose should I use in this project?".

At least this was until the set of standardized classes became so huge that it often contains two or three different ways to do the same thing, and for web development external libraries are used anyway. (So we have AWT, Swing and JavaFX; java.io and java.nio; but we are still waiting for the lambda functions.)

Comment author: Cyan 15 October 2013 09:30:56AM 0 points [-]

I'm not sure R fits this metaphor -- the closest I can get is "R is CRAN", but the C?AN concept is not unique to R. Hmm... maybe R is data.frames. Java is prepare your anus for objects.