How reference semantics was born
Reference semantics is typically implemented via pointers. Some languages like C make them explicit, others like JavaScript make them implicit. Either way, both languages provide reference semantics for certain types and they both use pointers under the hood.
So why were pointers introduced?
- Variable sized memory. We know that a 64bit number will use 64bits of memory. For other types, like strings, we don't know their size in advance, hence we are forced to dynamically allocate their memory at runtime and reference them using a pointer. For this reason, language designers were forced to use pointers.
- Speed, memory usage. When passing around large objects within a program, making a new copy every time would be prohibitively slow and one would quickly run out of memory. Instead, we pass around a pointer to the underlying data, which solves both problems.
Unfortunately, while introducing pointers solves the above problems, it introduces a new one: shared mutable state. Now developers can't tell if a piece of code owns a particular object. This means that modifying (mutating) it may have unexpected side effects, alas bugs. These bugs tend to be hard to reproduce, find and debug.
As a result, modern languages set out to solve the problem of shared mutable state. We believe Boomla has a unique solution that is simple to learn, simple to use and also has great performance.