You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an HttpConnection is opened, it should be closed when the Babel-17 program stops at the latest. An HttpConnection should also be closed, when it is garbage collected. There should be better guarantees for when something is garbage collected.
For example:
val stream = lang.io.curl "http://www.spiegel.de"
for line in stream.lines do
#print line
end
## from here on stream is not mentioned anymore
The stream should be garbage collected and closed after the for loop. Maybe some sort of reference counting can help here.
The text was updated successfully, but these errors were encountered:
Building reference counting into the current Babel-17 implementation would be very error prone because there is no single place where memory is allocated / deallocated, but memory is implicitly allocated by creating values all over the place. Furthermore, the current implementation has memory leaks where an experienced functional programmer would not expect them, so resource management would inherit these leaks. For now, it must be enough that resources can be explicitly closed and should be. As a safety net, the resource is closed when its memory is reclaimed via garbage collection. But for future implementations, that are needed for performance reasons anyway, this point needs to be revisited.
When an HttpConnection is opened, it should be closed when the Babel-17 program stops at the latest. An HttpConnection should also be closed, when it is garbage collected. There should be better guarantees for when something is garbage collected.
For example:
The stream should be garbage collected and closed after the for loop. Maybe some sort of reference counting can help here.
The text was updated successfully, but these errors were encountered: