On Borrow Checking

Timon Gehr timon.gehr at gmx.ch
Fri May 2 19:25:53 UTC 2025


On 5/2/25 16:53, Guillaume Piolat wrote:
> On Tuesday, 29 April 2025 at 17:12:41 UTC, Walter Bright wrote:
>>
>> It reminds me of OOP. OOP was sold as the answer to every programming 
>> problem. Many OOP languages appeared. But, eventually, things died 
>> down and OOP became just another tool in the toolbox. D and C++ 
>> support OOP, too.
> 
> My issue with all the talk about how some features could our savior is 
> that they are nowhere to be found in our direct competitors.
> 
> There is no surge of competitors boosted or enabled by memory-safety, 

(`@live` does not give you memory safety guarantees.)

> borrow-checking, lack of data races or even advanced types. There is 
> very little Rust competitors, to the point I'd argue people self-select 
> out of the market by spending time on expensive features like those that 
> bring no bread on the table. For example we have zero Haskell, Clojure, 
> or Elm competitors, or even Ocaml in the audio space (that one could 
> work there probably).
> 
> But there is a very real threat of competitors being faster with lower 
> iteration times.
> 
> 
Well, beyond the competitive edge that D affords you, to some extent 
users get what they pay/wait for and I think/hope users will be 
increasingly conscious of the possibility that someone might take over 
their computer by e.g. sending them an mp3 file that is invalid in a 
peculiar way.

The point of memory safety features is not really to help you write 
faster unsafe code with lower iteration times (though they sometimes do).

The goal is to help you write faster safe code with lower iteration 
times. In some domains, safety is, or will be, a requirement on the 
functionality of the software.

Some businesses don't care about cybersecurity until they or their users 
get hacked (regularly). Of course, memory corruption is only one way 
attackers can succeed, so advanced type system features can help. (More 
advanced than what you cite though, so we'll see how quickly those can 
be transferred to industry. It seems that usually the type system tech 
in popular languages is on the order of 40 years old.)

`@live` however does not give you additional hard guarantees, so I also 
think a priori it is not a feature on whose implementation I would spend 
time personally. Perhaps the work put into it can be reused for 
something more useful in the future.


More information about the Digitalmars-d mailing list