John K. Reid の講演より
19 分からの発言 https://youtu.be/Frz_AF46a04?t=1138
Allocatables
When we were working with fortran90, the proposer for pointers tried to convince us that once we've got pointers in the language, we did't need allocatable arrays. But the argument was made that all these old-fashioned people who are using old FORTRAN would never understand pointers, never be able to use them successfully. What was needed was memory that was just dynamic, so what we put in the language was simply, the simplest case of all, allocatable arrays that could be allocated anew????? 云々
ということで、昔気質のおじちゃん達にはポインタは難しくてちゃんと使えなかろうから、極言すれば欲しいのは実行時の動的メモリー確保なのだから、動的メモリー確保機能のみに特化してメモリーリークが起きにくいように制限をきつくした allocatable 型を用意したようです。
Fortran90 の時点では、allocatable 型はサブルーチンを出る時などに自動解放されなかったので、return 前に手動で解放しなければ メモリーリークした上でその先使用不能になるという、pointer と大して変わらない厄介さでしたが、Fortran95 以降では自動解放機能がついて安全性が高まってゆきました。move_alloc と合わせて、最近のスマート・ポインタを先取りしていたとほざいておきましょう。
Modern Fortran, with emphasis on coarrays (John Reid, JKR Associates/Rutherford Appleton Laboratory)
講演の前後の司会のいい声は Damian Rouson ではないかと思われます。
なお JK Reid ですが、女子高生 Reid と妄想するとはかどります。
- 作者: Michael Metcalf,John Reid,Malcolm Cohen
- 出版社/メーカー: Oxford Univ Pr
- 発売日: 2018/11/06
- メディア: ハードカバー
- この商品を含むブログを見る
Introduction to Programming with Fortran
- 作者: Ian Chivers,Jane Sleightholme
- 出版社/メーカー: Springer
- 発売日: 2018/08/31
- メディア: ハードカバー
- この商品を含むブログを見る