Page 1 of 1

Finishing string support: reference counting

Posted: Thu Dec 30, 2021 11:31 am
by frank
Finishing string support takes longer due to the implementation of a reference count system, which will use the ownership model similar to what is proposed for the Lobster language. The advantage of this system is that the reference counting is mainly done during compile time, which should take away around 95% of the traditional runtime reference count operations. Another reason for implementing an ownership model is to prevent unexpected changes to string references, such as:

Code: Select all

x = "hello";
s(x);

sub s(y: str)
do
  x = "world";
  print(y);       ' should print "hello" as being the new owner
end;
This is going to take some time...