vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
982 stars 118 forks source link

optional gzip compression on save files #436

Open tueda opened 1 year ago

tueda commented 1 year ago

It is beneficial to have an option in the Save statement in such a way that FORM can gzip-compress expressions in save files. See also the discussion at https://github.com/vermaseren/form/pull/433.

A possible way for the syntax is:

Save gzip savefile;
Save gzip savefile expressions...;

Here gzip is a contextual keyword. The disadvantage of this syntax is that the user cannot specify gzip as the save filename (but normally nobody would want to do that).

If the save file format has room to record whether expressions in the file are gzip-compressed or not (or with other compression formats), then the syntax of the Load statement does not need to be changed; the user can just use Load as in the past and it transparently loads expressions if compressed.

vermaseren commented 1 year ago

I guess the best is to make it Save -gzip savefile etc; It would be a very bad habit to start a filename with - That can really get things messed up.

To figure out all necessary details and possibly implementing this would be a very good exercise for the workshop in April.

On 8 Mar 2023, at 03:15, Takahiro Ueda @.***> wrote:

It is beneficial to have an option in the Save statement in such a way that FORM can gzip-compress expressions in save files. See also the discussion at #433 https://github.com/vermaseren/form/pull/433.

A possible way for the syntax is:

Save gzip savefile; Save gzip savefile expressions...; Here gzip is a contextual keyword. The disadvantage of this syntax is that the user cannot specify gzip as the save filename (but normally nobody would want to do that).

If the save file format has room to record whether expressions in the file are gzip-compressed or not (or with other compression formats), then the syntax of the Load statement does not need to be changed; the user can just use Load as in the past and it transparently loads expressions if compressed.

— Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/issues/436, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCET5OGUKRT3FZWULEIDW27TV3ANCNFSM6AAAAAAVTG4RAU. You are receiving this because you are subscribed to this thread.

tueda commented 1 year ago

We can also use +gzip, for consistency with +s and -s options etc. of the Print statement (+gzip: enabled, -gzip: disabled).

vermaseren commented 1 year ago

Yes, if for + holds the same as for - in running shell commands and hence makes the use of filenames that start with + extremely dangerous. There are indeed optionsin commands that start with + as in chmod.

On 9 Mar 2023, at 13:18, Takahiro Ueda @.***> wrote:

We can also use +gzip, for consistency with +s and -s options etc. of the Print statement (+gzip: enabled, -gzip: disabled).

— Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/issues/436#issuecomment-1461938498, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCEXV6LS6C4Q5OUMMXWTW3HC7XANCNFSM6AAAAAAVTG4RAU. You are receiving this because you commented.