Recent

Author Topic: Use of FreePascal packages without compilation of the IDE?  (Read 333 times)

good

  • Newbie
  • Posts: 1
Use of FreePascal packages without compilation of the IDE?
« on: March 22, 2023, 03:37:14 pm »
I am working on a bigger project which requires to modularize the code. As the concept of name spaces is not supported by Freepascal (dotted unit names is also not a good solution), packages are most likely the solution for a modularization. But all the documentation describes that the IDE must be recompiled. This seems to be a very clumsy way in early development stage.

1. Is the use of packages the preferred way to modularize the code?
2. Can GUI packages be used without a compilation of the IDE (i.e. components will be generated by code, not with the form designer)

Would appreciate a competent answer. Thank you in advance.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10717
  • FPC developer.
Re: Use of FreePascal packages without compilation of the IDE?
« Reply #1 on: March 22, 2023, 04:03:35 pm »
The term packages is ambiguous, and so is modularization.

Free Pascal inherits the unit system for modularization from Turbo Pascal, but apparently you mean a different kind of modularization. The namespace gimmick is later and not that interesting.

If you mean a modularization on a multiple binaries (DLL/BPL+EXE) level, that is currently hard or impossible. The Lazarus/GUI packages are basically just project files for build purposes, and not anything dynamically linkable.

So that means it is basically C level DLLs or multiple EXE's with IPC.

For some background you can also read https://wiki.freepascal.org/packages


KodeZwerg

  • Hero Member
  • *****
  • Posts: 1399
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Use of FreePascal packages without compilation of the IDE?
« Reply #2 on: March 22, 2023, 04:15:02 pm »
2. Can GUI packages be used without a compilation of the IDE (i.e. components will be generated by code, not with the form designer)
I would say, it depend on component and what that need to compile.
When you copy needed units to your project folder it should be very likely possible that you can create whatever at runtime.
(At least my own components I can integrate that way without the need of installing them into the IDE)
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

Thaddy

  • Hero Member
  • *****
  • Posts: 12976
Re: Use of FreePascal packages without compilation of the IDE?
« Reply #3 on: March 22, 2023, 06:05:51 pm »
The IDE only needs to be re-compiled for design-time enabled packages or if you change compiler version.
Work is being done to make it more comfy.
The industry way is to work with shared libraries (dll, so) as mentioned above. That is no problem at all with FPC/Lazarus.
I actually get compliments for being rude... (well, Dutch, but that is the same)

 

TinyPortal © 2005-2018