Greetings
My apologies for the possible long post, if anyone interested, I was stumbled across this and I feel like wanting to discuss this by now and get some opinions/insights.
maybe some of you good people have read the recent statement from the US Whitehouse couple of days ago issued by the US Office of the National Cyber Director (
ONCD), if interested you can read the official statement in this link:
https://www.whitehouse.gov/oncd/briefing-room/2024/02/26/memory-safety-fact-sheet/in short it's urging programmers to adopt memory safe programming languages (and it feels like an implicit preference toward
Rust and discouragement of using
C/C++), this made me a little intimidated given that C++ is my second favourite language after Object Pascal and my 1st language for daily usage bread an butter, now it's being discouraged on the highest official levels and I'm really REALLY not a fan of adopting a trendy reptilian based interpreter languages (Py#$% cough cough
) or other auto garbage collecting languages
but here is my personal take on this which I would like to get some opinions on:
- What makes a language really memory safe and is really a language fault or the programmers responsibility?
-
Object Pascal natively support memory safe managed types (correct me please if I'm wrong), along with that, it make the usage of stack based types such as advanced records and type helpers much easier and more efficient than other even the most modern languages which are considered mem-safe, additionally range checks, auto initializers/finalizers since the earliest days and now a better memory management for heap allocated types, and in my opinion it make the need for garbage collection unnecessary if not discomfortable.
- Modern
C++ and since the C++11 STL has implemented a hefty amount lot of memory safe libraries. auto initializers/finalizers (RAII, smart pointers vector etc..) so should it be really crucified now? let alone that it has produced most of the OS systems and software that we now use.
isn't it the lack of good practice and does it really matter which language?, what are the list of the languages and why would it be considered memory safe it seems a little subjective rather objective no? why suddenly this has to be an argument taken to the highest official acknowledgement
anyway the good news after further reading around this is that according to the NSA and US Department of defence,
Object Pascal (I guess they are referring to FPC) and
Delphi is considered one of the memory safe languages (read here in page [3]) :
https://media.defense.gov/2023/Apr/27/2003210083/-1/-1/0/CSI_SOFTWARE_MEMORY_SAFETY_V1.1.PDFmaybe this is a good opportunity to make Pascal great again.
what are the further practices that a pascal developer should consider for making a memory safe program
Cheers everyone