AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Delphi-PRAXiS - Lounge Delphi-News aus aller Welt More on Delphi, C++, and Memory safety
Thema durchsuchen
Ansicht
Themen-Optionen

More on Delphi, C++, and Memory safety

Ein Thema von DP News-Robot · begonnen am 22. Mär 2024
Antwort Antwort
Benutzerbild von DP News-Robot
DP News-Robot

Registriert seit: 4. Jun 2010
15.473 Beiträge
 
#1

More on Delphi, C++, and Memory safety

  Alt 22. Mär 2024, 12:00
A couple of weeks*ago I wrote a blog post, available on Embarcadero blog site at https://blogs.embarcadero.com/is-del...safe-language/, to follow up on the online discussion started by a US government paper you can read about in many articles, such as*https://www.tomshardware.com/softwar...ming-languages

Here I want to add a couple more links.

The first very nice article by Craig Chapman, titled "Memory Safety and Object Pascal" (see*https://chapmanworld.com/memory-safe...object-pascal/). I agree with what Craig writes. C++ can be used in a safe way, but it's more difficult to do it compared to other languages like Delphi and Rust. This is to point out that memory safety doesn't necessarily implies garbage collection. If you read the original document from the US government, there is a clear indication that some software requires a high degree of stability and reliability and much more memory control than a GC offers. Delphi is there, extremly fast runtime, and consistent results and performance (no change a GC kicks in at a bad time). This does require some discipline as a developer, but the language and its RTL helps a lot.

There is also a significant rebuttal of the argument in that document by the C++ community, starting with C++ creator,a s you can read in "C++ creator rebuts White House warning" at*https://www.infoworld.com/article/37...e-warning.html. The main argument here is that modern C++ can be safe, but the same article highlights that very little C++ code out there qualifies as modern C++. The plan to introduce new solutions would also imply a significant rewrite of existing C++ applications.

One element I mentioned already and I want to underline, and that is present in the research and documents behind the recent US government paper, is*that memory safely in terms of allocations and references is only one of many elements. Type safely is mentioned a lot. While Delphi has pointers, Pascal has typed pointers from day one. Having a pointer to Integer and increasing it by 1 to move to the next element of a data structure is arguably much safe than using a generic pointer and increasing it by 4 or 8 depending on the pointer size.*

Also consider the use of strings in Delphi, compared to C and C++. Or dynamic arrays. Or the fact core types like integers and characters or Boolean*are not all equivalents. A stronger type system implies more compile time checks and fewer runtime checks and runtime errors.



Weiterlesen...
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:58 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz