Lazarus

Using the Lazarus IDE => General => Topic started by: Selfmade.exe on June 24, 2019, 01:47:48 am

Title: Modular Lazarus
Post by: Selfmade.exe on June 24, 2019, 01:47:48 am
Hello everyone,

This topic might seem a bit odd (given the today's hardware) but I 'll give it a shot:

After recompiling IDE the size on the disk is about 1.30GB!! Without compile is about 1GB.
For me this is kinda ridiculous; It means that I need 1GB+ of software just to write, just say, a simple non gui program.. hmm.. I could produce the same* program with borland 7 for windows that takes no more than 25mb! (* yes I know, ancient staff, no support for modern processors, etc).
But the borland IDE was very straightforward and simple. I know that lazarus has a lot of staff, but it would be nice if I can have an IDE that I can select the components according to my programing needs and functions of IDE that I want (and thus a smaller install size).  UNLESS this can done already. Also a portable option with the config on the same folder would be nice!
Title: Re: Modular Lazarus
Post by: RAW on June 24, 2019, 01:59:54 am
Hi,
Borland 7 was Windows only or am I wrong? (16 bit ...?)
Years ago I installed a modern Delphi version (I think it was XE5 UPD 2) and that version needed approx. 5 GB disk space.
For non GUI Lazarus is not necessary, I guess you already know that ...  :)
Nowadays nobody cares about 1 GB SSD or HDD space ...

Quote
Also a portable option with the config on the same folder would be nice!
A secondary installation has the CFG folder exactly there, but I guess you need to setup some paths manually ... never needed this...
Maybe it's enough to change these files or use a little startup exe file that does all the changes ???

lazarus/lazarus.cfg: --primary-config-path=P:\lazarus\laz_conf
lazarus/environmentoptions.xml: <LazarusDirectory Value="P:\lazarus">
lazarus/laz_config/editoroptions.xml
lazarus/laz_config/environmentoptions.xml
lazarus/laz_config/fpcdefines.xml

I guess starting lazarus from USB is slow  :)
by the way: what about fpcUpDeluxe ... ? Is there an easier way possible ?
Title: Re: Modular Lazarus
Post by: Selfmade.exe on June 24, 2019, 02:39:37 am
Quote
Borland 7 was Windows only or am I wrong? (16 bit ...?)
Borland 7 was for windows 3.1 (!) but run fine through xp, and wayyy better that the atrocity called TurboPascal interface.

Quote
For non GUI Lazarus is not necessary
Well I know that I can use notepad too, but IDE is what it is supposed to be: an enviroment for programming, and if you dont have agood enviroment, then if you have second thoughts on starting something,well then you get one more..  :D

Quote
Nowadays nobody cares about 1 GB SSD or HDD space ..
Thats why I said that this topic might be odd, but this and the lack of the option to select is frustrating

Quote
A secondary installation has the CFG folder exactly there
I know that, but lazarus is the kind of the program that needs the "usual and proper" install on windows. Other programs even after a normal install ( just install in one folder, not appdata or roaming folders) run fine if you just transfer them from one installation to another. They are kinda portable.

Quote
what about fpcUpDeluxe
i don't know anything about this..
Title: Re: Modular Lazarus
Post by: lucamar on June 24, 2019, 07:26:12 am
A small, self-contained, mostly portable install with which to write simple, non-GUI programs?  Install just FPC, without Lazarus.

Depending on your system and what you install you'll need between 40 to 450 MiB(*), and you get, along a modern Object Pascal compiler plus lots of libraries, a multiplatform text-mode IDE very close in operation to the venerable Borland Pascal one.

Difficult to beat, hey? :)

(*) Those 450 MiB are about what a normal Lazarus installs of FPC and why the total is 1 GiB instead of just half that; and it includes 200+ MiB of source code for the rtl, fcl and all the extra "packages".
Title: Re: Modular Lazarus
Post by: valdir.marcos on June 24, 2019, 07:55:38 am
Hello everyone,
This topic might seem a bit odd (given the today's hardware) but I 'll give it a shot:
After recompiling IDE the size on the disk is about 1.30GB!! Without compile is about 1GB.
For me this is kinda ridiculous; It means that I need 1GB+ of software just to write, just say, a simple non gui program.. hmm.. I could produce the same* program with borland 7 for windows that takes no more than 25mb! (* yes I know, ancient staff, no support for modern processors, etc).
But the borland IDE was very straightforward and simple. I know that lazarus has a lot of staff, but it would be nice if I can have an IDE that I can select the components according to my programing needs and functions of IDE that I want (and thus a smaller install size).  UNLESS this can done already. Also a portable option with the config on the same folder would be nice!
If you mean something similar with old Netbeans versions (see attached image), your idea is good but not feasible for Free Pascal and Lazarus because of many reasons.
https://web.archive.org/web/20170506091836/https://netbeans.org/downloads/index.html

To achieve modularity, Lazarus project would need be greatly reorganized. There are neither human and money resources nor intention for that.

Recompile Free Pascal or making Lazarus cross-compiling easier and intuitive are much more requested and will not be implemented any time soon.

Android and iOS and Web (with pas2js) programming in IDE still need some IDE extra manual adjusts. They are more needed than modularity and are still neither easy nor intuitive for beginners.
Title: Re: Modular Lazarus
Post by: marcov on June 24, 2019, 11:11:13 am
Just do an install, and cut down to the items you want. Educational institutions do this routinely, and copy the relevant parts to the machine you want.

The number of paths in configuration can be quite low (see the various topics about portable versions).

If you want to put in a bit more effort, you can make own installers. The installer scripts and everything are also open source, just go ahead!
Title: Re: Modular Lazarus
Post by: Selfmade.exe on June 26, 2019, 06:39:37 pm
Quote
Just do an install, and cut down to the items you want

and how do I know which parts are necessary or not? or do I have to trial & error with 11,469 files for every program that I make??
Do any of the devs have some kind of csv file to keep track of the files?
Title: Re: Modular Lazarus
Post by: Thaddy on June 26, 2019, 06:53:09 pm
Quote
Just do an install, and cut down to the items you want

and how do I know which parts are necessary or not? or do I have to trial & error with 11,469 files for every program that I make??
Do any of the devs have some kind of csv file to keep track of the files?
Lucky for you: the compiler determines that.....Except for the system unit everything else is strictly on demand.
Title: Re: Modular Lazarus
Post by: Selfmade.exe on June 26, 2019, 10:25:36 pm
Quote
Lucky for you: the compiler determines that.....Except for the system unit everything else is strictly on demand.

Can you elaborate more on that?
Title: Re: Modular Lazarus
Post by: Thaddy on June 26, 2019, 11:06:36 pm
Any library code that is not actually used is eliminated by the compiler. So seem to believe everythink is linked in. That is not the case.
Title: Re: Modular Lazarus
Post by: Martin_fr on June 26, 2019, 11:08:10 pm
Under menu:
  Package > Package Graph
  View > Unit Dependencies  (Ensure to check "All package units")

You can see which package (folder components) uses depends on what. You then have to decide if you will ever need a package or not. Any package you may need (including those used by the IDE), has to stay (as a whole), and all its dependencies have to stay too.

For Lazarus you can try rebuild packages that you need, but setting debugging to NONE. That may shrink ppu and o files.


In the fpc directory you can go through the packages dir. But there is no dependencies graph (i.e. which Lazarus package depends on which fpc package). And the ppu are all mixed into one folder... So that will be harder to decide on.

On the other hand in the fpc directory, the source (rtl and packages) are only used by codetools (the IDE navigation and code completion).
- If you do not need navigation and code completion then you can delete all of them.
- If you do need navigation and code completion, then you have at least to keep rtl sources. And maybe some packages (no idea which ones, no easy way to find out)

Still in the fpc dir: ppu and o files (in the lib or units folder) are from rtl and packages (they match the names of the source files).
If you NEVER need database stuff, you can find db related packages, note the source file names, find the corresponding ppu and o files and remove them.



Not sure if it is worth the work....
Title: Re: Modular Lazarus
Post by: marcov on June 27, 2019, 01:33:58 am
Quote
Just do an install, and cut down to the items you want

and how do I know which parts are necessary or not? or do I have to trial & error with 11,469 files for every program that I make??
Do any of the devs have some kind of csv file to keep track of the files?

Then just trust the default install. They all are useful for something, or wouldn't be there.
Title: Re: Modular Lazarus
Post by: Martin_fr on June 27, 2019, 01:50:05 am
Do any of the devs have some kind of csv file to keep track of the files?
No csv files exist.

Files are organized into packages (Lazarus packages, and fpc packages - there is a diff).
You know by the folder, so no csv needed.

Each package has a description. (and sources, if the description is unclear)

And then there are other folders, most of them self explaining: examples, ide, debugger, docs, ...


Title: Re: Modular Lazarus
Post by: lucamar on June 27, 2019, 02:15:59 am
As a last resort you could try other IDEs (https://wiki.freepascal.org/IDE). Lazarus is just the more advanced, not the only one.

Note that I've never tried any alternative so I don't know how good (or bad) any of them are. Well, except Dev-Pascal which I know is ... not really up to par (and quite obsolete).
Title: Re: Modular Lazarus
Post by: valdir.marcos on June 27, 2019, 03:30:39 am
Netbeans IDE took years of effort to be modular before Sun to be sold to Oracle, and Oracle to donate it to Apache Foundation.
Eclipse IDE was born already modularized and plugable.

Not sure if it is worth the work....
Although it would be good to have a modularized and plugable IDE,  there are much more important things to be done.
Title: Re: Modular Lazarus
Post by: PascalDragon on June 27, 2019, 09:21:36 am
Although it would be good to have a modularized and plugable IDE,  there are much more important things to be done.
Well, the Lazarus IDE itself is already modularized and plugable (even if it requires a recompilation), but the Lazarus distribution simply contains everything already.
Title: Re: Modular Lazarus
Post by: Selfmade.exe on July 01, 2019, 08:18:15 pm
Quote
Well, the Lazarus IDE itself is already modularized and plugable (even if it requires a recompilation), but the Lazarus distribution simply contains everything already.

To some extend maybe, but when new fpc rolls out, there must be used with a newer version of Lazarus), unless I am wrong (some time ago I did try to run newer fpc in 1.6 Lazarus but I got errors all the time).
About the settings; I use 2.0.2 as a separate install so I dont know if transfering older version setings is working/exists. But setting again the settings, plus the new ones tha come with every new version is frustating..

It's going to take some time to clean up my build, but one thing is sure: its messy. And dont take it the wrong way, I know that Lazarus is a project that takes a lot of personal time and resources, but a modular redesign would be much much better..
Title: Re: Modular Lazarus
Post by: RAW on July 01, 2019, 08:41:13 pm
I don't understand the problem at all, there are a lot of easy solutions:

NewPascal
fpcUpDeluxe
StableLazarus (Secondary Installation)
CodeTyphon
fpGUI
FPC only with own Editor or any TextEditor or MSE IDE etc ...

I like this very much !!! More than I need  :D
Title: Re: Modular Lazarus
Post by: Martin_fr on July 01, 2019, 10:30:40 pm
To some extend maybe, but when new fpc rolls out, there must be used with a newer version of Lazarus), unless I am wrong (some time ago I did try to run newer fpc in 1.6 Lazarus but I got errors all the time).
About the settings; I use 2.0.2 as a separate install so I dont know if transfering older version setings is working/exists. But setting again the settings, plus the new ones tha come with every new version is frustating..

It's going to take some time to clean up my build, but one thing is sure: its messy. And dont take it the wrong way, I know that Lazarus is a project that takes a lot of personal time and resources, but a modular redesign would be much much better..

Fpc sometimes has changes or bug-fixes that break compatibility. So Lazarus needs to be adapted for that (like any other project would).
Current Lazarus will probably run with the next version of fpc, but there is no telling how many future fpc versions.

Newer Lazarus versions, can read your existing config. So you can keep that.
However installing 2 or more Lazarus in parallel, each Lazarus needs its own config.
TinyPortal © 2005-2018