# Fortran: Array Language (video)

**URL:** <https://fortran-lang.discourse.group/t/fortran-array-language-video/7313>\
**Category:** Advocacy\
**Created:** [February 2, 2024, 1:29am UTC](https://fortran-lang.discourse.group/t/fortran-array-language-video/7313 "2024-02-02T01:29:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![zaikunzhang](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/zaikunzhang/32/785_2.png) [@zaikunzhang](https://fortran-lang.discourse.group/u/zaikunzhang)\
**Post date:** [February 2, 2024, 1:51am UTC](https://fortran-lang.discourse.group/t/fortran-array-language-video/7313/2 "2024-02-02T01:51:57Z")

</div>

Array Language — a very precise and good name.

I do believe that **one of the core strengths of Fortran is its native support for matrices and matrix/vector operations**. This strength is super important and advantageous for a computing-oriented language, because most numerical algorithms are essentially a sequence of matrix/vector operations.

However, unfortunately, the Fortran community seems to be indifferent to the performance of Fortran’s intrinsic matrix/vector operations and even their occasional **failures** under **default** compiler settings. This is bizarre. See the following for example.

> [@Automatic arrays and intrinsic array operations: to use or not to use?](https://fortran-lang.discourse.group/t/automatic-arrays-and-intrinsic-array-operations-to-use-or-not-to-use/4070):
>
> Question: Is it considered a good practice to use automatic arrays and intrinsic array operations (matmul, transpose, etc)? The reasonable answer, I guess and I hope, is yes, it is a good practice. For automatic arrays, let us focus on their usage as local variables. I do not intend to discuss what kind of arrays should be used as dummy variables. You may see [Fortran Best Practices](https://fortran-lang.org/learn/best_practices/arrays) for such discussions. Now let me explain why I have this question. For me, one of the core strengths of Fortran…

> [@Testing the performance of \`matmul\` under default compiler settings](https://fortran-lang.discourse.group/t/testing-the-performance-of-matmul-under-default-compiler-settings/4096):
>
> Further to the discussion under [Automatic arrays and intrinsic array operations: to use or not to use?](https://fortran-lang.discourse.group/t/automatic-arrays-and-intrinsic-array-operations-to-use-or-not-to-use), I did some more tests on the performance of matmul under the default settings of the compilers. Here, matmul is only an example of Fortran’s intrinsic matrix/vector operation. There are many others. They are core strengths of Fortran, and I hope they are robust and performant by default. (Or, how to argue that we want these intrinsic functions to perform poorly by default? How to explain suc…

It seems quite “fashionable” in Fortran to code in loops instead of matrix/vector operations, while other computing-oriented languages like MATLAB/Python are all promoting the latter. Surely, this is partially because these scripting languages are inefficient with loops, but the good news is that their matrix/vector operations are as efficient as Fortran loops (thanks to the underlying C / Fortran libraries). The question is, why Fortran couldn’t / shouldn’t do the same? It would make the code much more understandable, maintainable, and expressive, and make the language much more accessible and usable to common users.

[PRIMA](http://www.libprima.net) uses matrix/vector operations as much as possible. No loop appears unless it is the only solution. When proposing to [integrate PRIMA to SciPy](https://github.com/scipy/scipy/issues/18118), a [comment](https://github.com/scipy/scipy/issues/18367#issuecomment-1555353463) I received from the SciPy community about the source code of PRIMA was as follows.

> The _syntax_ is clear, it uses vectorized assignments and Python-style (“modern”) slices when passing subarrays to a subroutine and so on

I am glad that my choice and effort are appreciated.

---

_[View the full topic](https://fortran-lang.discourse.group/t/fortran-array-language-video/7313)._
