News for hackers. Stuff that matters.
Re:Elixir RAM and the Template of Doom by nomacrospls on Sunday August 09, 2020 @02:31AM (#24097741)
Macros are not really necessary and you don’t have to know the inner workings of everything for doing well with strings in Elixir.

The secret for working with strings in functional languages (or in languages with immutable strings) is to realize most operations, such as concatenation, end up copying the strings. So instead of saying “string1 concat string2 concat ...”, it is better to collect a list of strings and build one final string only at the end. Here is an Elixir specific article that goes more in-depth into this: https://www.bignerdranch.com/blog/elixir-and-io-lists-part-1...

Other languages may provide specific data-structures for this purpose, such as ropes, but in a nutshell that’s all there is to it.

Re:Elixir RAM and the Template of Doom by nickjj on Sunday August 09, 2020 @05:25AM (#24098377)
> Other languages may provide specific data-structures for this purpose, such as ropes, but in a nutshell that’s all there is to it.

I never had to think of anything like this in Python. The intuitive / easiest to read code usually ended up being efficient enough that I didn't need to even think about improving the performance.

Re:Elixir RAM and the Template of Doom by nomacrospls on Sunday August 09, 2020 @07:17AM (#24098844)
Sure, my comment was specific to functional languages, and Python isn’t one.