by mumblemumble · 5y ago · 0 comments
The way to get around that is by sticking the actual string on the heap somewhere and only storing a pointer to it in the array. This isn't a unique problem to Fortran; it's how basically every programming language does it. The difference is that Fortan doesn't automatically heap allocate them for you - you've got to manually box them with a derived type - and that most other languages don't even give you the option of strings without pointer chasing.
I would argue that, while this characteristic is certainly going to seem weird to anyone who's used to a higher-level language, in a language like Fortran where the primary use case is high performance computing, putting the programmer in charge of these sorts of decisions is neither a bug nor a wart; it's a huge feature.