Re:Rewriting Fortran Software in Rust
by xioxox on Wednesday July 15, 2020 @02:18PM
(#23849353)
What? Where is this good string support in Fortran 2003, 2008 and 2018? I must have missed it in the manual. Now you can allocate a string of a non fixed size - simply amazing technology! Actually, one of my compiler crashes was trying to use this revolutionary feature.
[ Parent
| on HN ]
Re:Rewriting Fortran Software in Rust
by pantalaimon on Wednesday July 15, 2020 @05:30PM
(#23852175)
> Now you can allocate a string of a non fixed size - simply amazing technology!
That’s more than what C gives you out of the box ;)
Many languages forbid mutable strings. They aren't really a very good idea, imo. Even less of a good idea are extensible strings. More complex data structures are required for efficient extensible strings, and this complexity shouldn't be hidden in a simple interface. Better to have a Buffer type or something that is distinct from the String type so programmers are made aware of the performance/allocation characteristics.
Though, this is kind of ridiculous to even talk about, since the CPU and compiler itself are responsible for the greatest sins of hiding something unimaginably complex behind a simple interface.
Ah, the joys of the 6502 and the Commodore 64!
Delphi had mutable xor aliased strings. That is really great. Each function can change the string as fast as a mutable string, but once it shared with other functions, they can be certain that it will not be changed randomly