Jump to content

FreeDelphiPascal

Members
  • Content Count

    51
  • Joined

  • Last visited

Everything posted by FreeDelphiPascal

  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. I want to create a client/server application. The server has multiple binary files in one folder on the server. There can be folders within folders. Basically, I simulate some kind of file system with per-file and per-folder permissions. I want the client to be able to send a command to the server, to retrieve the file/folder tree and then request a specific file (by ID) for editing. In return, the server will read that binary file from disk and send it to the client as a binary stream. The client modifies the stream and presses 'Save' which will send the file back to the server, which will store it back on disk. TFolder= class private procedure load(Stream: TBuffStream); procedure save(Stream: TBuffStream); public Users : TPermissions; // Users participating in this folder (users that can see the list of files in this folder) FolderType : TFolderType; ParentList : TFolders; SubFolders : TFolders; Files: TFiles; class function CreateNew(CONST aName: string; aOwner: TUser; ParentLst: TFolders; aCore: TObject; aFolderType: TFolderType): TFolder; static; constructor Create (CONST aName: string; aOwner: TUser; ParentLst: TFolders; aCore: TObject; aFolderType: TFolderType); property ID: Integer read FID; property Name: string read FName; function GetFolder: string; end; TFolders= class(TObjectList<TFolder>) I also need support for file synchronization. I want the server to be able to transmit some kind of flag to indicate to other clients that a certain file is already open (in use) by a client and tell which client (ID) has locked the file. If the file is locked, other clients can still read it but cannot write to it and send it back to the server. In other words, the first client that requests the file, gets read-write access. The rest of the clients only get read access. I want to allow the clients that have read-only permissions to send a text message to the client that locked the file to ask for the file's liberation. The server should create a list of records in which it keeps track of the status of each file. TPermissions = class(TDictionary<TUser, TAccPermissionSet>) TUserLock = Record Read: boolean; Write: boolean; Changed: boolean; // The user changed the file end; TFileStatus = Record FileName: string; ByUser: TList<TUserLock>; end; Of course, security needs to be considered. Maybe something like this: SSLHandler := TIdServerIOHandlerSSLOpenSSL.Create(TCPServer); NTFS-like user permissions In theory, all the users of a top folder can see down on lower folders. BUT could be also the case that each file/folder has a VERY SPECIFIC list of users that can read/write the documents. So, you could prevent "top users" from seeing lower files. Additionally, to that list of users, I need a "master" user that "owns" the folder and its documents. It is pretty much like the permissions of the NTFS. File-centric I won't allow users to move files around. The work will be mostly done inside the files (RTF). I am thinking about splitting the document in multiple RTF sections and locking only one section. This way, I could get something like "Google Documents" where multiple users edit the same doc in parallel. I could give to each folder/document (even document section) a unique ID. The client could use these IDs to ask for a specific document (or document section) from the server. WebDev as solution? I have yet to see if WebDev allows this kind of user access. I also see a problem with the speed if you have thousands of files and folders. I don't know how much is webdev like ftp, but navigating via FTP through a dense structure of files/folders can be quite slow. Folder tree Now, I store the information about files and folders in individual binary files. But this could create a lot of I/O activity. It seems more reasonable now to send the file/folder structure as a whole to the clients (but not the file contents, since the files are big). I am considering sending the whole folder tree to the clients. Fortunately, the users are split to groups (a group is like a "root" but I can have multiple of these groups/roots). I only have to send them the folder structure of a single group. Existing code Actually, I have the program above, but it is for single-user. No server side whatsoever. So, I want to convert it to multi-user. I intend to use Indy, but I only have a tiny amount of experience with it. Other requirements The server should work with multiple clients. The program should work over the Internet. The user should be able to work offline (this could be implemented at a later date, but must be implemented at one point). -------------------- If you ever designed such a system, please share your thoughts, before I go in 🙂 Maybe there is already some template application like this....
  15. FreeDelphiPascal

    Design of client/server application

    I had some time to investigate more about this, and it looks like WebSockets provides what I need.
  16. 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 🙂
  17. FreeDelphiPascal

    Delphi 12 is available

    I did a test - Julia vs Delphi. Julia beats the crap out of Delphi. Some code executes 7 times faster! But on the other hand, it is true: You cannot deliver a Julia monolithic app to a customer - unless that customer installs Julia and some other stuff first.
  18. FreeDelphiPascal

    Edits not saved??

    I did some investigation and the background compilation was the culprit.
  19. FreeDelphiPascal

    Edits not saved??

    I have somethimes a somehow similar error. The compiler won't see my source code changes in the IDE until I press Save.
  20. FreeDelphiPascal

    Delphi 12 is available

    Other proposals then? If we cannot do anything, then Embarcadero owns us.
  21. FreeDelphiPascal

    Delphi 12 is available

    You are right, we are going through dark ages (I would also call them sad ages). So, when are we all going to sign a petition to Embarcadero and ask for a modern Delphi that does not crash every 10 minutes, it is not stuck in the 2000 and does not have the fart-smell of an 100 grandpa? We should all promise that we won't buy next version until they really really fix it. And we want a true road map. Embarcadero should understand that they don't own Delphi. They cannot do whatever they want and when they want. We are the customers. They cannot release 12 new tiny features and pretend it worth buying Delphi 12 just for that. I mean, come on! I would be ashamed to tell my users that in the next version they will be able to write text on two lines instead of one! This is not something even worth mentioning. Presenting this like a brand new shiny feature means "Hi Delphi guys, we full around last year, then we were busy to fix some bugs that were not supposed to be there, and improve the C++ which nobody uses anyway, so for you, we didn't have much time left, but at least we did this impressive feature that lets you split your string on two lines. PS: you have to pay for it. PSS: you have to pay also for the bug fixes!". Have you seen how fast are other languages advancing? Take a look at Julia! High level language BUT in some benchmarks it beats the craps out of grandpa Delphi. And its costs... nothing! Slap a nice IDE as VS Code on top of it, and you got a nice environment. Updates? Every few weeks. I am afraid to admit it, but I think I am (we all are) in love with what Delphi was in 95, when it was indeed cutting edge. Now we are all a bunch of gray beards and bold heads. No new blood to Delphi. I haven't heard of a single new startup company that uses Delphi. All the jobs around are offered by companies that started in 90-95 with pascal/delphi. All of them hove now 2 million lines of legacy code and a desperate need of Delphi developers. I know a few of them that never-ever take down the Delphi job position because it is never filled. Or if they find a good (and pretty old) programmer every 2-3 it is not enough to replenish the big number of old programmers that now are at the retiring age. For each new programmer they put their hands on, two retires. And as the "new" programmer is close to retiring age also, it only perpetuates the avalanche. Been there, seen that with my own eyes. I was the young one there, even though I am not that young anymore. You also see the lack of Delphi programmers when the job is announced as Delphi "slash" C++. They try to lure-in some C++ Builder programmers this way. Trick them into a Delphi position. I personally try to promote Delphi. But all my kids around me (nephews, friend's children, etc) are going with the cool wave. The old PHP is getting to be the new cool kid in the town now. Internet technologies. C#. I am not saying they are better. But they are definitively "cool". Embarcadero, with all its old guys there (good guys/programmers but not in touch with the new generation, with the new ways) and with its "get the money first - give the quality later" policy is not "cool". And cool is ******** important, because you don't lure in into the language old die-hard C or ASM gurus, you want to lure in kids. My kid is having more fun with Delphi than with Scratch. But I wouldn't put him on a Delphi-career path. Not with Delphi's featured being almost sealed. Embarcadero! The time to reverse the tide is running out! Delphi opportunity window is almost almost closed! I do see some efforts from Embarcadero (some blogs, some barely-voted youtube videos, some shy promotions), and in general Embarcadero is going into the right direction. But too slow. Waaay too slow. The biggest positive move was the Community Edition. I would have paid > 1000 euros to buy a license for my kid! (I still don't have words to say how dismayed I am that Emba didn't offer a free license until few years ago!!!!!!!!!!!!!!!!!!!!!!!!!!!) Wellllll..... In theory, I should shut up and relax, and fave fun with Delphi until my retiring age comes. I never ever had problems getting income with Delphi. But I love Delphi too much. It will be such a shame for Delphi to get retired the same day I retire! I do the same! I never use a new released feature in the first 3-4 years. I wait for it to get ripe and stable. 🙂Well, some things like "skins" (styles), 64 bit compiler, obviously took more than 3-4 years. FMX, still way to go... How many years ago they announced first time that Delphi has support for high DPI? Today, I can't still build decent high dpi apps in Delphi. I personally, won't buy a new license until I get a usable version to worth the price. It simply not fair to pay for bug fixes. My users will laugh at me if I would dare to ask money for a showstopper bug that was not supposed to be there. I always said (joking) that if Emba will release one-single-true-stable-version they will get out of business because everybody will buy that version (remember Delphi 7?) and lock into it. Nobody will upgrade to the next version for 8-12 years (unless the next version is as good as the other one). I am kinda doing that with 10.4.
  22. FreeDelphiPascal

    Delphi 12 is available

    Ok. This really made my day! The best replica on the whole forum. I should put it in my signature. _____ Maybe we should ALL skip buying Delphi 13 if it is still buggy. And the next versions....... Until they finally release something usable.
  23. FreeDelphiPascal

    Installing Delphi silently

    I tried to install Delphi 11.3 using the silent installer. I extracted the exe and the gof files from the ISO and put them in a folder. The problem is that the silent installer started to download all the stuff from the web (took a bit under 1 hour to finish). The documentation is very poor. It only says: "Silent Install is available for offline and online installation. In the offline installation, there is a GOF file and the setup executable. In the online installation, there is a setup executable and an automatic download of the required packages in the background." Issue: It installs EVERYTHING! This is my command line: radstudio_11_esd_113236a.exe /SILENT /NORESTART /LOG="Log.txt" /FEATURES=delphi_windows;samples;help;dunit;interbase_express;interbase_2020 For this command line, it also installed CBuilder, which, as you can see, is not in the list. I have a feeling that the order in which the parameters are listed is relevant! Update: I changed the parameter order. It still installs everything. Issue: It installs from the web In the "DOS" box, it says "downloading...". Maybe it is only saying that, and the installation is so long because it installs ALL possible packages and CBuilder? Has anyone seen the same behavior? Is the new silent installer (D11) broken? It worked for D10.4.
  24. FreeDelphiPascal

    Installing Delphi silently

    https://quality.embarcadero.com/browse/RSP-43460
  25. FreeDelphiPascal

    Delphi 12 is available

    Yes. That one. Sorry about the unclear statement.
×