Re:Crema: A Sub-Turing Programming Language
by Ono-Sendai on Wednesday August 05, 2015 @03:18PM
(#10012160)
Hi,
I'm writing a total functional language as well. I think that garbage collection is still useful however, as it can collect garbage as the program runs, not just at the end.
[ Parent
| on HN ]
Re:Crema: A Sub-Turing Programming Language
by otabdeveloper on Thursday August 06, 2015 @02:33AM
(#10014895)
I've managed to make it so my memory use is completely deterministic -- no garbage at all.
Re:Crema: A Sub-Turing Programming Language
by Ono-Sendai on Thursday August 06, 2015 @06:51AM
(#10015657)
That sounds interesting. Any references or notes on that I can read? (or source code :) )
I would say that just because your memory use is deterministic, doesn't mean you don't get garbage. Garbage is just memory that isn't needed any more.
for example, in
let
a = f(x)
b = g(y)
in
a + b
If there is working memory used in the body of f(), it will be garbage when f() has finished executing, because it won't be referred to any more.
So it could be freed after f is executed and before g is executed, which may reduce the maximum amount of memory required by the program.