D not considered memory safe
Martyn
martyn.developer at googlemail.com
Mon Jul 8 08:48:56 UTC 2024
On Monday, 8 July 2024 at 07:23:44 UTC, aberba wrote:
> On Saturday, 6 July 2024 at 23:39:54 UTC, Sebastian Nibisz
> wrote:
>> On Saturday, 6 July 2024 at 23:10:02 UTC, Walter Bright wrote:
>>> On 7/6/2024 4:07 AM, Sebastian Nibisz wrote:
>>>> Seriously? Any language is safe in this case, you just need
>>>> to write safe code.
>>>
>>> Enabling the checks is quite different from writing code with
>>> no bugs in it.
>>
>> But you have to remember to enable it. Inexperienced
>> programmer usually won't do this and will build unsafe code
>> unconsciously.
>
> I've heard this argument about the "inexperienced programmer"
> many times. Folks assume inexperienced programmers are writing
> some kernel code or deploying to some mission critical system.
> I see an inexperienced programmer writing any such code anytime
> soon. They could care less about these things you're talking
> about and they'd be using the GC (not that GC is a beginner
> target feature). Many of the traditional languages suggested to
> beginners such as C, C++, Python, JavaScript, PHP don't work
> like rust.
>
> I'm not arguing writing memory unsafe code should be
> encouraged, I'm saying in reality, it's not a problem for the
> beginner. You can still write bugs causing vulnerabilities in
> any language.
>
> Have you considered the cons of dealing with @safe code?
I generally agree.
If any Company **MUST** write memory-safe code then there should
be rules/standards to follow whether starting a new programming
project, to having code reviews and deployment, or other
variations.
For example, code reviews should be completed by senior/lead
programmers, especially if there has been commits from
junor-level programmers... though it should be reviewed
**REGARDLESS** of who and their level of experience.
I do not see Dlang being any different in comparison to other,
memory-safe languages. Even if the Company was using Rust, there
**should** still be rules and guidelines to follow! Just because
a language is safe by default does not mean un-safe code cannot
creep in!
I personally am not bothered if a language is or isn't
memory-safe by default. However, the reality is memory-safe by
default will get a big green tick beside it when it comes to
research papers... and they are the only ones that will get
copied-pasted into media/blog articles moving forward.
Rust is all the buzz at the moment and, no doubt, will be the top
talking point for these sites whether the writer has any
programming knowledge or not.
I guess if Dlang: -
* goes memory-safe by default, will break existing code.
* continues as is, will not get recognition for those articles.
For every new DMD release, should there be a SafeDMD alongside
it, forcing @safe by default? Would this satisfy both points?
More information about the Digitalmars-d
mailing list