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?
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.
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.
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.)
Different languages are good at different things. For some languages it happens to be a data structure:
Lisp is lists
Tcl is strings
APL is arrays
Forth is stacks
SQL is tables
Other languages are good at something specific which isn’t a data structure (Haskell, Prolog, Smalltalk etc.) And others are general languages that don’t try to make any particular point about computation (C, Java, JavaScript, Perl, Python, Ruby etc.)
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.
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?
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.
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.
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.)
Different languages are good at different things. For some languages it happens to be a data structure:
Lisp is lists
Tcl is strings
APL is arrays
Forth is stacks
SQL is tables
Other languages are good at something specific which isn’t a data structure (Haskell, Prolog, Smalltalk etc.) And others are general languages that don’t try to make any particular point about computation (C, Java, JavaScript, Perl, Python, Ruby etc.)
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.