3 ms·
Do others agree with you? Let me quote [1]: "An array language is a programming language that supports the manipulation of entire arrays – or portions of array
by thesz 3y ago
Do others agree with you?
Let me quote [1]: "An array language is a programming language that supports the manipulation of entire arrays – or portions of arrays – as a basic unit of operation."
[1] https://link.springer.com/referenceworkentry/10.1007/978-0-387-09766-4_25 https://link.springer.com/referenceworkentry/10.1007/978-0-3...
Let us look at Wikipedia [2], where Ada is considered an array language.
[2] https://en.wikipedia.org/wiki/Array_programming#Ada https://en.wikipedia.org/wiki/Array_programming#Ada
I may cautiously conclude that your view is not common and Haskell is, indeed, an array language. As is Python, by itself and (faster) through numpy.
- taeric 3y agoDoes Haskel support broadcast things without libraries/extensions? That you can abstract broadcasting operations seems a silly argument. Of course you can write a program that will do the same things in both. But in neither Haskel nor Python is `[1, 2, 3] * 4` a valid statement without a lot of work. (Well, to be fair, it is valid in Python, but not in the expected sense for what we are discussing here...)
- thesz 3y agoDefine "a lot of work." In Haskell you need to define a type and implement two classes (IsList and Num). Then you will have the ability to use [1,2,3] * 4 and get your [4,8,12]. Is it a lot of work? It does not seem like that for me.
- bradrn 3y ago> "An array language is a programming language that supports the manipulation of entire arrays – or portions of arrays – as a basic unit of operation." I agree with this definition. In neither Haskell nor Python does this count as a ‘basic unit of operation’. As the sibling comment mentions, it requires a lot of extra work in both languages — hardly ‘basic’! > Let us look at Wikipedia [2], where Ada is considered an array language. As for this, it appears from the manual that arithmetic operators are overloaded only for 1D vectors and 2D matrices. So in this regard Ada is much more limited than ‘real’ array languages. [manual link: https://www.adaic.org/resources/add_content/standards/05rm/html/RM-G-3-1.html https://www.adaic.org/resources/add_content/standards/05rm/h...]
- thesz 3y ago>As for this, it appears from the manual that arithmetic operators are overloaded only for 1D vectors and 2D matrices. So in this regard Ada is much more limited than ‘real’ array languages. Yes, yet it is included into list. Whereas Haskell, which can have operators for arbitrary tensors, is not. In fact, even NESL [1] is not included and I bet you will also resist to include it as an array language. [1] https://en.wikipedia.org/wiki/NESL https://en.wikipedia.org/wiki/NESL But in case you will consider NESL an array language, please consider that Haskell has nested data parallelism (in language), inspired by NESL.