Array Languages Rock
williamtpayne.blogspot.com
williamtpayne.blogspot.com
I would argue that the more important thing that makes something an "array language" is that scatter/gather operations on arrays have syntactic support, as described here:
http://prog21.dadgum.com/141.html
As a personal anecdote: In my thesis work I switched most of my data analysis workflow from MATLAB to R. In terms of paradigms I'd say R is a slightly worse array-language (although it does have builtin syntax for things that require messing with sub2ind() in MATLAB) but a much better functional language than MATLAB. The empirical result is that I finished my first analysis project -- including the time it took to learn R -- faster than it had taken me to do a similar task in MATLAB, using 1/3 the code. Add to that that there is presently more active development of open graphics and statistical analysis libraries in R, and I haven't really looked back, though I occasionally think of picking up an APL-derivative like J to play with.
You really should -- it provides a nice counterexample to the "downside" you worry about. Having mapping over arrays (even with mismatched dimensionality) built into the mechanics of function application means that any function the programmer writes is automatically supported by the array mapping.
I can't see why this should hold for all array languages in general.
If the language has some mechanism to let you add new operation that are on the same "class / level" as the built-ins, then the above does not hold.
Calling Prolog "declarative" or "logical" is just marketing. Prolog is really built around two concepts: unification and backtracking. This produces a system that can be used as a general-purpose language, but you will probably get more mileage thinking about it as a database engine, capable of expressing non-finite relations. Compare it to SQL, which only supports finite relations (finite number of rows in each table). Indeed, optimizing Prolog compilers will remind you more of SQL engines -- optimizing Prolog compilers produce indexes, does that sound familiar?
The latter - almost never works. Be it Oracle, MSSQL, DB2 or PostgreSQL.
And even when it works - it's unacceptable.
We had a query in Oracle that executed several hours. Our Oracle DBA found a way to tweak Oracle that shrinked it to 30 minutes. It was interesting, but impossible to use in practice - we could not guarantee that other queries will go fine with this server settings. (Our DBA was the first who was against using in production)
"Datomic embeds Datalog, a subset of Prolog, to move queries into the application." (http://www.infoq.com/news/2012/03/clojure-west)
Basically it boils down to integration of array programming and objects through the concept of "messaging patterns", which change the behaviour of a message/method call so that it multiplexes over self/arguments via syntactic magic
So you have stuff like
# at aggregate level
[[0,1],["a"]] count #=> 2
# content level, looping left
[[0,1],["a"]] @count #=> [2, 1]
# content level, looping right
2 greatherThan@ [1,3] #=> [true, false]
you can combine these things for multiple levels of nesting, and there are other messaging pattern for indexing, reduction etc.This feels more declarative than performing explicit loops or using map/fold&co for some things, but also a fair bit mor obscure
(Perl6 also has something similar via hyperoperators and metaoperators, I think)
[1] http://www.fscript.org/documentation/OOPAL.pdf [2] http://www.fscript.org
I think this sounds reasonable, especially considering the pseudo-oop of todays languages.
By comparison, J's lifting permits mismatched dimensionality ("rank"), e.g. using a scalar operator on a list and a matrix, though the dimensions of the particular axes ("shapes" of the arrays) must still match (one must be a prefix of the other). This generalizes to operators written for higher-rank arrays too.
A trivial example is if you know jQuery - $(".myclass").addClass("myclass2") ...the selector returns zero or more objects. You dont need to iterate over each and manually add myclass2.
Reference: http://stackoverflow.com/questions/10496932/is-jquery-a-mona...
I'd recommend Google for "Maybe monad in {insert favorite language here}" to at least grok the idea that monads are a more general concept.
Other examples include lists and functions. (Anything which satisfies the monad laws can be called a monad, there isn't any restriction or definition other than that.)