We as a community should be more understanding of Julia's flaws

i might do the wrong example here and pseudocode, because i have not written julia code in years and didn’t really run into a ‘you allocate too much’ problem.

let’s loop over a long list of indexes, calculate something, and copy the results into an available array
for k = 1:1e6
value = function(constant parameters, k, some data)
% do something else
% do something else
result_array[k] = value
end

isn’t this allocating a bunch of values? If yes, the compiler should reduce to result[k] = function(etc.)

And for heap/stack allocations: Sorry, if i want to differentiate this, i go to a low level programming language (aka C - a form of macro assembler). In a high level language with memory management (aka GC) i don’t even want to think about managing this.

1 Like