Jump to content

FreeDelphiPascal

Members
  • Content Count

    51
  • Joined

  • Last visited

Community Reputation

11 Good

Technical Information

  • Delphi-Version
    Delphi 10.4 Sydney

Recent Profile Visitors

1472 profile views
  1. FreeDelphiPascal

    Compiler option Reference Info / Definitions only

    Sometimes Ctrl+Click simply won't work. It is probably related to this setting.
  2. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    A solid question! I don't know all the languages out there, but Java and C# (which are more memory safe than Delphi because of their GC), loose quite a bit of speed because they have to spend some time to check the GC and decide what to clean up (release). EVEN if they would spend very little on this task, they have to "stop the world" from time to time. There is no way to use such a language in time-critical systems (I worked on such a system in the past). Therefore, these safer languages, have to pay a price for their safety. I am curious if there is any language out there that is as fast as Delphi and more memory safe. From what I heard, Rust is not using a GC, while still being fast and safe. I would like to see some speed comparison between Delphi and Rust. I heard that its speed is only slightly smaller than C++'s speed (and from here we can extrapolate to Delphi's speed). But its compilation time is even higher than C++ compilation time, which compared to Delphi... well... we all know how ridiculous C++ is at this chapter. 🙂 Also, Rust cannot do GUI natively, like Delphi. So, you cannot even compare Delphi and Rust at this chapter. In Rust, you must opt for GTK, QT (ha ha ha) or do some web-based GUIs - with all their known drawbacks. So, I would say, Rust is more oriented towards "systems" (DB, servers, automations, embedded systems, robots, etc.) not towards desktop apps. So, as you Lars said, I would like to see a language that is memory safe and executes fast, and compiles fast and comes with 500 visual components out of the box. __________ Note: Note: When I say Delphi is safe, I assume that the programmer played safe and didn't abuse the pointers and didn’t override Delphi’s strong typing system. I worked on a system that look like it was written by a C programmer. Procedures like DoSomething(var P); all over the place, and half of the parameters passed are raw pointers. But as somebody said above, give a bold programmer a safe language, and it would find a way to abuse it. It would take a bit more creativity than in Delphi which puts the pointers (almost directly) on the table, but sure you can screw up in the end.
  3. FreeDelphiPascal

    Any example bitmap to grayscale?

    But aren't you supposed in the end to put the PixelFormat to pf8???? I need the final image as pf8. But if I set its PixelFormat to pf8, some wavy patterns appear in it (like when you convert a high color image to 256 color GIF)
  4. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    I have seen nasty sh*t in my life. So, I am totally for this!
  5. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    Yes. I totally understand and agree with that. Because of this, I went in my post above, and I changed the word "error" with "issue", to eliminate any interpretation. I like to be pedantic 🙂
  6. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    LLVM is not quite a programming language. So, you are right in a way: you could recover at the hardware level, but LLVM fails to do so. But then, let's not blame Delphi language itself for this. So, I would correct myself and say that the issue is between the hardware and the language, in the LLVM. Do you agree with this "technicality"? 🙂
  7. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    I don't think you read Dalija's article. It clearly states that it is hardware related, not language related.
  8. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    Nice post David S! I had recently to fix a bug in a program that was sending wrong financial reports to a governmental financial institution (equivalent to RSI in America) for 18 years. After 18 years, somebody observed the problem. It ended up that there was not only one bug, like 15. Nobody ever observed the other 14 instances where data was wrong. I was told to shut up and move on. Also, nobody cared that my new program was running 100x faster than the previous one. I told them that probably there were another 100 bugs in there (pascal-like code, no objects, thousands of warnings and hints - at least, there were no pointers!). They wouldn't let me rewrite the program. They said, it now it works, let it as it is. So people, don't blame Delphi for not being totally memory-safe. It is mostly the programmer that dictates the safety of a language. I guess the programmer that wrote that program in Delphi would be able to sneak in some calamities like this also in a language like Rust. __________ Also, many people complained about buffer overflow here. Turn on the damn Range and Overflow checking. It will catch a good bunch of those overflows - unless the devil thought you to use pointers all over the place.
  9. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    When have you ever called one of those constructors?
  10. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    Too much useless talk about this topic. But this guy (Kas Ob) came with real ideas/solutions. Great job Kas!
  11. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    obj := TObject.Create; FreeAndNil(obj); FreeAndNil(obj); ------------------------------ On SO somebody wrote an example like this to prove how unsafe Delphi is: s: String; i: Integer; begin s:= 'four'; for i:= 1 to 1138 do begin write( s[i] ); // What will it access after i=4? end; end; At one point, we should stop talking about how safe the programming language is and start talking about how "unsafe" is the programmer 🙂 🙂
  12. FreeDelphiPascal

    Delphi TOIOBE index lifted in May 2022?

    Delphi is again on position 11 in tiobe. I wonder which pretext will they use this time when they will kick it down to position 17 like the last year.
  13. FreeDelphiPascal

    Edits not saved??

    It is odd because background compilation worked until I reinstall Delphi (the same version!)
  14. FreeDelphiPascal

    Design of client/server application

    I had some time to investigate more about this, and it looks like WebSockets provides what I need.
  15. FreeDelphiPascal

    Edits not saved??

    But it worked for me since ever, until recently when I installed Delphi fresh. Looks like there is some good dose of randomness in that installer 🙂
Ă—