Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2020-12

Ignoring the UNIT dependencies

8 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ralf Quint
to cbsistem
cbsistem wrote
How to compile only one .PAS file while ignoring the UNIT dependencies declared in the USES clause ?

Sorry, but that question doesn't make any sense. Either the units in the USES clause are referenced in some way in the code or they are not.

If they are not referenced, you can delete the USES clause or at least comment them out.

If you do this when they are in fact referenced, then you .PAS file simply won't compile. Very basic Pascal concept that everything that is being referenced has to be defined first...

Ralf

This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email

Jean SUZINEAU
to Ralf Quint

I agree it doesn't make sense, and I don't know specifically for pas2js, but  usually specifying a unit in the uses clause can have an impact even if the code doesn't make any reference to the code of this unit, if the unit has an initialization part.

I think for example to the cthreads unit used in Linux for threads ( https://www.freepascal.org/docs-html/current/rtl/cthreads/index.html ), or the memory manager for memory allocation (
https://www.freepascal.org/docs-html/current/prog/progsu175.html ).

Reply by email

Ralf Quint
to Jean SUZINEAU: I agree it doesn't make sense, and I don't know specifically for pas2js, but  usually…
Jean SUZINEAU wrote 9 lines
I agree it doesn't make sense, and I don't know specifically for pas2js, but  usually specifying a unit in the uses clause can have an impact even if the code doesn't make any reference to the code of this unit, if the unit has an initialization part. I think for example to the cthreads unit used in Linux for threads ( https://www.freepascal.org/docs-html/current/rtl/cthreads/index.html ), or the memory manager for memory allocation ( https://www.freepascal.org/docs-html/current/prog/progsu175.html ).

But that is the opposite of the scenario that you described.

Even if the reference is only indirect, by the initialization section of a used unit, you can remove it from the uses clause. Then still no code of that unit would be required to compile the file you are mentioned...

Ralf

This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email

cbsistem
to Ralf Quint

The intention would be to compile the paschal unit that is being altered without having to compile the entire project, to have more performance.

Pas2js could compile the Paschal Unit into a .JS file with the same name. Without packaging all UNITS.

Is there any way to improve performance by compiling only the unit that was changed?

-----
Cristiano Barbosa

Reply by email

Mattias Gaertner
to cbsistem: The intention would be to compile the paschal unit that is being altered without having…
Show quoted text 6 lines
The intention would be to compile the paschal unit that is being altered without having to compile the entire project, to have more performance. Pas2js could compile the Paschal Unit into a .JS file with the same name. Without packaging all UNITS.

Yes. Leave out -Jc

Is there any way to improve performance by compiling only the unit that was changed?

Not yet.

You can use -Ju instead of -Fu.

Mattias

Reply by email