Hacker News new | ask | show | jobs
by vphantom 2312 days ago
FYI strings are now immutable in OCaml. It was a compiler option starting with 4.02 and it has become enabled by default since 4.06.
1 comments

That's nice to know. On the flip side, that's not nice for interaction between older code that wants to mutate and newer code that wants to "copy". If the "copy" code is actually copying all the time behind the scenes (something it has to do if you are compiling with mutable strings for backward compatibility with the rest of your codebase), that's a huge performance hit.