Jump to content

pyscripter

Members
  • Content Count

    1085
  • Joined

  • Last visited

  • Days Won

    72

Everything posted by pyscripter

  1. As per title. In fact P4D added support for python 3.14 back in January, when it was still in alpha stage.
  2. Not sure how you deduced this. All of my component libraries and many of the third-party ones I use do have $Auto. In fact I posted about it when it was first introduced with a bug which was later fixed. And I agree it is very useful. Again not sure why you say this. You don't have to compile everything every time. Not even when you switch platforms if you set a platform specific DCU output directory. And in any case my 1m line project builds in about 20 seconds.
  3. You don't. MultiIstaller can use existing library source code folders. You only clone git repos once. You then just pull the changes.
  4. It is worth looking at how python manages imports and see whether we can learn something about Delphi. Python installations typically contain hundreds of third party libraries (packages), but the search path (sys.path) contains only a small number of entries. This is achieved by implementing four features: 1. Virtual environments Isolated environments in which you can import dependencies and run python code without affecting other python installations. 2. A standard location for installing third-party libraries This is the lib\site-packages folder. There are two of those, one installation specific and one user specific. 3. Flagging subdirectories as packages (folders containing importable stuff). If a subdirectory contains a file __init.py__ it is considered a package that can be imported. For example, the python path contains a folder lib\site-packages. Say, a subdirectory of site-packages contains a foder called rpyc with a file rpyc\__init__.py. Then rpyc can be imported in python directly without the rpyc folder being in the search path. Packages may contain subpackages which can also be imported, 4. Relative imports A package may use internally other modules (units in delphi) which may be hierarchically structured. Inside the package you can import such modules using a relative import command. The -r Delphi command line flag mentioned above provides a way of emulating virtual environments, but it is quite laborious to use. Also Delphi does have the syntax: uses FileName in 'relative_path'; But this syntax is strictly reserved for dpr or dpk files. What if that syntax was allowed in units? You could then structure your library hierarchically with only the top level exposed via the library path. Units that are not meant to be imported directly would reside in subfolders that are not visible to users, and used internally with relative imports. Spring4d comes to mind as a library that would benefit from this. What do you think?
  5. What @Anders Melander is advocating is closer to how people work in python. For every project you create a self-contained virtual environment that includes all the dependences. Python has the tools to make this workable and fast. The equivalent in Delphi would be to have for every project a virtual machine with the required version of Delphi installed and just the dependencies you need. But this is not as practical, with Delphi. FWIW, what I do for projects of moderate size (about 1m lines including dependencies) is: Minimize the use of third party tools. For instance, although I know that the Spring4D collections are better than the RTL ones and that there are faster JSON libraries than System.JSON I stick to the RTL libraries. Having said that, PyScripter has 16 external dependencies, many of which I developed or maintain. Only use open source projects with available source code, preferably actively maintained. Try to use the latest versions of all dependencies and Delphi. This sometimes leads to incompatibilities and troubles, but I think that the benefit of getting the latest features and bug fixes outweighs the trouble. My library paths point to the source code (typically in cloned git repos) and not the compiled dcus. I know this will be frowned upon. However, in my case it saves me time. When a dependency gets updated, I just pull the latest updates from the git repo without having to install the components. When I upgrade to a new Delphi version, I use MultiInstaller to install all the dependencies in one step. MultiInstaller can install dependencies from git repos, zip files or existing folders. It can also install components in the 64 bit IDE of Delphi 13. The whole process takes minutes not hours.
  6. pyscripter

    JSON benchmarks

    hydrobyte/TestJSON: A simple project to test JSON libraries with Delphi and C++Builder. presents JSON library benchmarks comparing a large number of alternatives. One thing that strikes me, is that the System.JSON rtl library is doing relatively well compared to the competition, both in terms of performance and in terms of JSON validation. With the exception of Find, is very competitive in all other areas. I have seen many claims that System.JSON is very slow and that the xyz library is so many times faster. Do these benchmarks suck (like most benchmarks)? Or is it the case that System.JSON is not that bad? What is your experience?
  7. pyscripter

    JSON benchmarks

    But you are saying that System.JSON in Delphi 12 is 3x faster than in 11. Am I right?
  8. pyscripter

    JSON benchmarks

    @MarceloHByte Incidentally, which version of Delphi did you use for the benchmarks?
  9. pyscripter

    JSON benchmarks

    I was referring to Delphi's System.JSON and why it got faster in v12 vs v11. JSONDataObjects introduced faster checking for duplicates Performance: Use binary search for finding case sensitive names inste… · ahausladen/JsonDataObjects@4680dc9 that explains the improvement. It would be worth submitting an Issue regarding the memory leaks though.
  10. pyscripter

    JSON benchmarks

    The only obvious change in System.Json I noticed between Delphi 11 and 12, is the removal of Range and Overflow checking in some performance critical parts. Surprising it makes such a huge difference (3x faster). This may explain the perception about the slowness of System.JSON when using versions earlier than Delphi 12.
  11. pyscripter

    UIAutomation in Delphi 13

    Indeed. See also my own translation: https://github.com/pyscripter/SynEdit/blob/27b5d713b4806ccbf38412cd138d8ee7d4ccc499/Source/SynAccessibility.pas#L220 The weird thing is that GetIt includes the "Windows API from WinMD" package that has correct translations of the Automation API and many others. Why Embarcadero did not use these translations escapes me. Please submit a bug report.
  12. You can do it in (at least) three ways: 1. Use AddRawOptions RegEx.AddRawOptions(PCRE_UNGREEDY); With older versions you can use this code (see [RSP-21733] Compile PCRE with JIT enabled - Embarcadero Technologies) {$IF (CompilerVersion <= 35) and not Declared(RTLVersion112)} type TPerlRegExHelper = class helper for TPerlRegEx procedure AddRawOptions(PCREOptions: Integer); end; procedure TPerlRegExHelper.AddRawOptions(PCREOptions: Integer); begin with Self do FPCREOptions := FPCREOptions or PCREOptions; end; type TRegExHelper = record helper for TRegEx public procedure AddRawOptions(PCREOptions: Integer); end; procedure TRegExHelper.AddRawOptions(PCREOptions: Integer); begin with Self do FRegEx.AddRawOptions(PCREOptions); end; {$ENDIF} 2. Another use of a class helper type TRegExHelper = record helper for TRegEx public procedure AddPCREOptions(PCREOptions: TPerlRegExOptions); end; procedure TRegExHelper.AddPCREOptions(PCREOptions: TPerlRegExOptions); begin with Self do FRegEx.FOptions := FRegEx.FOptions + PCREOptions; end; and use it (not tested): RegEx.AddPCREOptions([preUnGreedy]); 3. Use the ungreedy ? Instead, you can use the ungreedy ? in your regular expressions. See How can I write a regex which matches non greedy? - Stack Overflow.
  13. System.RegularExpressions uses PCRE.
  14. pyscripter

    JSON benchmarks

    @MarceloHByte Have you also updated JSONDataObjects? There was a significant update after the first post in this topic.
  15. pyscripter

    UIAutomation in Delphi 13

    Have a look at SynEdit/Source/SynAccessibility.pas at master · pyscripter/SynEdit to see how UI.Automation can be used for accessibility support. SynEdit was one of the first Delphi controls to support UI Automation for this purpose.
  16. pyscripter

    UIAutomation in Delphi 13

    Indeed. At the moment all we got is some scaffolding. Had Embarcadero declared the UIAutomation functions as delayed no dll would be loaded. Maybe you could submit an issue to that effect. But you could try to do that with your project. Edit Winapi.UIAutomation to add the delayed attribute and include it in your project (not tested).
  17. This gives us some hope. Delphi users do need decent refactoring. Let us know if we can help. This could be a community effort.
  18. So does GExperts, but the MMX one is nicer :).
  19. pyscripter

    MCP server to catch windows debug messages

    Please.
  20. pyscripter

    New Delphi features in Delphi 13

    I must say, that an IDE without quality refactoring support does not sound good. The LSP protocol includes refactoring, and I think that the best way forward is to implement it via the LSP server, freeing the IDE itself from such tasks. But first existing LSP issues need to be ironed out.
  21. pyscripter

    RAD Studio 13 is available

    No. Who knows, maybe sometime.
  22. pyscripter

    New Hint in D13

    The following gives a hint in D13: H2077 Value assigned to Test never used: function Test(Value: Integer): Integer; begin Result := -1; if Value > 0 then Result := 0 else Assert(False); end; Is the hint justified? What if Assertions are turned off? Note that in earlier versions you would get a warning if you omit the first line.
  23. pyscripter

    New Hint in D13

    Indeed.
  24. D13 does not let me add breakpoints in Vcl.Forms. Use debug dcus is set and I can debug other Vcl units such as Vcl.Controls. Does anyone else have the same issue?
  25. pyscripter

    Cannot debug Vcl.Forms with D13

    https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-4094
×