Normal view

There are new articles available, click to refresh the page.
Before yesterdayGautier's blog

HAC - range checks

4 September 2021 at 18:36

Up to a few hours ago, range checks in HAC (the HAC Ada Compiler) were limited to array indices.

However, a simple and cool Ada feature is the possibility of subtyping, as in

subtype Level is Integer range 1 .. 30;
It allows to describe precisely values in your program that have to stay within a certain range and would not be meaningful outside of that range. You can also use the subtype's name in many contexts like

switch : array (Level) of Boolean;

or 

for x in Level loop ...

Furthermore it opens the possibility of checking that values are actually within the range.

Typically you have at some places a statement like:

lev := lev - 1;

for a variable defined as

lev : Level;
If your program, by mistake, decrements the variable lev to 0, a standard Ada run-time range check will detect it and raise an exception. This is a very powerful help in finding bugs in complex programs, typically data compression software.

Up to a few hours ago, HAC did not have that kind of range check. Now it is fixed.

Since types in the HAC Ada subset are fully known at compile time, the addition was actually easy:

1) Add appropriate Virtual Machine instructions:


2) Implement them in the VM interpreter:


3) On the parser side, add the run-time check for (sub)type conversions (better to do an easy case as a warm-up):


4) Add the run-time check for assignment statements (:=):

The last point was a bit less trivial. Some details had to be changed in the compiler's way of memorizing and propagating information about types and their range constraints.

For instance, for a composite type like

type Rec is record

  L : Level;

  Points : Natural;

end record;

and an array

x : array (1 .. N) of Rec;

the compiler needs to track correctly that

x(i).L

is of subtype Level, with the range 1 .. 30, and not only of the broader type Integer, when it considers checking the range of the value after := in the following statement:

x(i).L := new_value;

Conversely, in an expression like  z + y * x(i).L, the subtype has to be ignored, it is an Integer expression and nothing more (Integer in that case is called the base type). A solution was to define, in the compiler, a type extension for holding subtype informations:

In places where the subtype constraint needs to be ignored, it is easy to do:


 HAC is an open-source software and can be found here and here.


 

 

A curiosity with LZMA data compression

10 August 2021 at 09:42

Uncompressed file: 1'029'744 bytes.

Compressed size (excluding Zip or 7z archive metadata; data is not preprocessed):

BytesCompressed / Uncompressed ratio Format Software
172'976 16.80% PPMd 7-Zip 21.02 alpha
130'280 12.65% BZip2 Zip 3.0
119'327 11.59% BZip2 7-Zip 21.02 alpha
61'584 5.98% LZMA Zip-Ada v.57
50'398 4.89% LZMA2 7-Zip 21.02 alpha
50'396 4.89% LZMA 7-Zip 21.02 alpha
42'439 4.12% LZMA Zip-Ada v.58 (preview)
41'661 4.05% LZMA Zip-Ada (current research branch)

Conclusion: the Zip-Ada (current research branch) compresses that data 17.3% better than 7-Zip v.21.02!

The file (zipped to its smallest compressed size, 4.05%) can be downloaded here. It is part of the old Canterbury corpus benchmark file collection (file name: kennedy.xls).

Please don't draw any conclusion: the test data is a relatively small, special binary file with lots of redundancy.
But that result is a hint that some more juice can be extracted from the LZMA format.

The open-source Zip-Ada project can be found here and here.

The HAC scripts invasion (follow-up)

26 July 2021 at 18:18

As a follow-up of another post about converting bash (Linux) or cmd (Windows) scripts to HAC scripts, here is a fresh example.

I needed to improve an existing cmd script for benchmarking compression software, with the possibility of switching various subsets separately: that is re-run this subset of methods, or that other subset, or the full tests (long!), etc.

Of course, if you use a real language instead of command-line interpreter ones, there is an obvious solution: you can define a set and you can programmatically flip the membership switches.

In Ada, it looks like

  type Category is (
    Reduce_Shrink,
    Deflate,
    Deflate_External,
    BZip2_External,
    PPMd_External,
    LZMA_7z,
    LZMA_3,
    TAR,
    Preselection
  );

  cat_set : array (Category) of Boolean;
The good news is that you can run an Ada program exactly like a script by using HAC (the HAC Ada Compiler). That is, it runs immediately (with HAC), and HAC doesn't drop .ali, .o, .bexch, .tmp, .exe files which are too much waste for the sake of running a small script-like job.

Below are screenshots of the quick development of bench.adb using the LEA editor, where you can punch F4 to check eventual errors. If there is one, you get instantly to the offending line / column point.

This script is part of the Zip-Ada project and is very helpful for developing and testing new compression methods.

 

Click to enlarge


Click to enlarge


Harpex index & the Recurve tool for getting long-term data

29 May 2021 at 13:21

Yet another use of the Recurve tool available with GID @ https://gen-img-dec.sourceforge.io/ or https://github.com/zertovitch/gid : the long-term reconstruction of the Harpex index, which tracks worldwide container shipping prices.

The Harpex chart since 2001 is available for free on the Harper Petersen & Co Web site, but the data is freely available only for the last 3 years.

Solution: use the Recurve tool for digitizing the long-term chart till 2018.

Bonus: I've found an article with a Harpex chart from 1995 to 2010. Another opportunity to apply Recurve!

All in all (two digitized charts, plus data since 2018):

 

For a full walk-through about using Recurve, see this article.

Cleaning up HAC sources with AdaControl

30 April 2021 at 14:15

AdaControl is a powerful Ada source code verification tool. It's freely available here. As a side note, its name sounds like "flight control" and it is no coincidence 😊.

Our HAC (HAC Ada Compiler) project is a good opportunity to use AdaControl from scratch on a given project and to show you how capable it is.

*** 

A note about installation. The free version of AdaControl works so far with the GNAT Ada toolset called Community Edition 2019 - not later, for reasons explained in a newsgroup post titled "Status of AdaControl".

So, for example on Windows, the installation steps include installing GNAT CE 2019 (even if you use a later version), writing a script, say, go19.cmd, with the line "path c:\gnat\2019\bin;%path%". The AdaControl installer (adactl-1.21r6b-exe_setup.exe) will work correctly if you first set the correct temporary path with "go19", then launch the installer, from the same command line session.

Then, you can write a second script, say, gps_19.cmd, with the lines:

  call go19
  start gps -P hac.gpr

That way you can start your AdaControl session comfortably through GNAT Studio by just double-clicking gps_19.cmd.

***

AdaControl works with rules that you can choose to apply (or not), sometimes with sub-rules. You list the rules you want to apply in a text file. In the HAC project (see hac.gpr) we have called it "test/verif_hac.aru".

Let's start with a first rule which seems promising: "simplifiable_statements". As you know, unnecessary complications are the biggest threat to programs of any size. Small simplifications that are automatically detected are very welcome. Of course it doesn't replace larger, conceptual simplifications - but for that, you need a brain 😉.

------------------------------------------------
--  AdaControl verification rules             --
--  https://www.adalog.fr/en/adacontrol.html  --
------------------------------------------------

-- Set for HAC (HAC Ada Compiler).

--------------------------------------
--  (1) Required ("check" command)  --
--------------------------------------

check simplifiable_statements;


------------------------------------------------------------------
--  (2) Acceptable, but should be looked at ("search" command)  --
------------------------------------------------------------------ 

All but one line of the above rules file are comments starting with "--". But since AdaControl provides 579+ possible rules and sub-rules, the comments will be useful later.

So, we courageously begin with the first rule, on the main procedure of the HAC command-line compiler and VM interpreter, hac.adb (that GNAT turns into hac.exe).

Click to enlarge

After a few seconds, AdaControl completes with 74 diagnostics in 18 files (it scans recursively all units that the initial unit (hac.adb) depends on, and the units those units depend on, and so on).

That, for the "simplifiable_statements" rule only. Ouch! 😨

Click to enlarge

The first item is a loop that is simplifiable into a "for" loop. First, a disclaimer: I did not write that loop👐🚿. Remember that HAC stems from an automatic translation of SmallAda (written in the late 1980's), itself a derivation of CoPascal, which derives from Pascal-S by Pr. Wirth himself around 1975. At the time some languages did not produce a check to skip a "for" loop from a to b when a > b. If it is not skipped, the loop parameter will be incremented to "the infinity", and practically, towards an overflow error in best cases. So probably authors of SmallAda or earlier felt better using a "while" loop instead of a "for" loop in such cases.

In Ada every situation is defined in the Reference Manual (an ISO standard!), and programmers can count on the fact that the loop "for i in a .. b" is skipped if a > b.

Back to AdaControl. Obviously, it has found a case where you can simplify a "while" loop into a "for" loop.

This finding looks easy, a posteriori, for the human reader, because it is a tiny loop. But it is not trivial. Logically, AdaControl was able to figure out that the "OC'Last" part of the exit condition is invariant during the loop's activity (if not, you must stick with the "while" loop). Clever!

Plus, it has seen that the exit condition was equivalent to an upper bound check in a "for" loop. Very clever!

Plus, it has detected simple increment (LC0 := LC0 + 1;) in the main execution path of the loop - and nothing else, nowhere else, like, for instance, a modification of LC0 in the "if" statement. That's very, very clever!

So let's do the recommended simplification. The loop in

  procedure Patch_Addresses (
    OC            : in out Object_Code_Table;
    dummy_address :        Operand_2_Type
  )
  is
    LC0 : Integer := OC'First;
    use Defs;
    use type HAC_Integer;
  begin
    while LC0 < OC'Last loop
      if OC (LC0).F in Jump_Opcode and then OC (LC0).Y = dummy_address then
        OC (LC0).Y := HAC_Integer (OC'Last);
      end if;
      LC0 := LC0 + 1;
    end loop;
  end Patch_Addresses;

becomes:

    for LC0 in OC'First .. OC'Last - 1 loop
      if OC (LC0).F in Jump_Opcode and then OC (LC0).Y = dummy_address then
        OC (LC0).Y := HAC_Integer (OC'Last);
      end if;
    end loop;

As a bonus, the variable declaration, "LC0 : Integer := OC'First;", can be deleted (it is implicitely defined in Ada for the "for" loop).

But the simplification is not enough for AdaControl! It detects, on a second round, that the loop parameter (LC0) is always used as an index to an array. It says that the "for ... of" Ada 2012 statement can be used instead. This means that instead of having a loop incrementing an index to the OC array, the loop could as well scan OC's elements directly. The job is the same, but the Ada code is shorter and cleaner for human readers. In this case the gain is small, but for an array like "foo(k).bar.x3.grogu(l)" it makes a big difference in readability.

Let's apply again the recommanded change.

    for Op of OC (OC'First .. OC'Last - 1) loop
      if Op.F in Jump_Opcode and then Op.Y = dummy_address then
        Op.Y := HAC_Integer (OC'Last);
      end if;
    end loop;

Beautiful!

Here are both changes together, in colour, via GitHub: 

More AdaControl adventures in a further post...


Economic index reconstruction using Recurve

27 April 2021 at 11:53

The problem: a certain data is publicly available only for the last ten years in the form of data table.
I'd like to complete it with the largest time frame's data.

But: there are many charts with "all time" data on the Web.

The solution: use Recurve!

This is done in 3 easy steps (OK, after 3 preliminary steps 😉):

-2) Download and install GNAT from here.

-1) Download GID (Generic Image Decoder) from here or here, or get it as a crate from Alire (crate description here)

0) Build the GID tools (Windows: double-click "build.cmd" or command-line: "gprbuild -p -P gid" or Alire: "alr get gid", then "alr run" (details in the doc)).

1) Open the "test" directory.

2) Windows and probably others: drag-&-drop your chart image on recurve[.exe], or command-line: "[./]recurve pic.ext"


3) Open the .csv in your favorite spreadsheet app, chart the recurve data for comparing with the original chart image.

Now, we can see the various data reconstruction steps. Starting point:


  • Turn x values from pixels into dates, pick correct curves at the ends (the moving average 20 days in the chart happened to have the same colour as the values).


  • De-logarithm-ize the y values, have index points instead of pixels.

  • Switch to the actual data since March 2011.

Done!

CBSG: added "next stage of growth" and "high-volume production"

17 April 2021 at 15:36

The Corporate Bullshit Generator (CBSG) is growing and growing...
We just added... "next stage of growth" and "high-volume production"!

For seeing the second addition in a sort of self-referencing action, let's just type on a terminal:

   produce_corporate_bullshit -b "high-vol"

...to show how the software can literally produce high volumes of bullshit with laser-focus:

"It's not about attractiveness. It's about the outsourced high-volume production.
The key to high-volume production is value realization.
Thought leadership requires truly optimizing high-volume production to deliver maximum impact."
A video capture of the above command illustrates perhaps better the "high-volume production" 😉 of the CBSG:

 

HAC v.0.095

7 April 2021 at 20:13

A bit of brush-up after our last post about the new modularity features of HAC (the HAC Ada Compiler), we can announce the release of version 0.095.

We have tested since then parameters to units, and the use of functions instead of procedures as units.

All that with the LEA editor, in order to experiment the behaviour of compile-time errors and run-time errors. In contrast to the command-line tool called "hac" where everything is forgotten once the command is run, whatever the outcome, in an integrated editor the compiler needs to close files properly in every case - also on errors, because the editor will open them to show the error locations. Similarily, the builder needs to clear the library information between two builds. The improvements to be made to HAC for a smooth functioning were straightforward. Just a couple of statements to add here and there.

A demo of HAC's current modularity support, in one picture:

Click to enlarge

HAC (HAC Ada Compiler) is a small, quick, open-source Ada compiler,
covering a subset of the Ada language.
HAC is itself fully programmed in Ada.

HAC web site: http://hacadacompiler.sf.net/


Source repositories:
 #1 svn: https://sf.net/p/hacadacompiler/code/HEAD/tree/trunk/
 #2 git: https://github.com/zertovitch/hac

Enjoy!

First steps in modularity for HAC

5 April 2021 at 18:55

The recent development effort of HAC (the open-source HAC Ada Compiler, links here and here) is concentrated on modularity.

Some new packages were added on the compiler side:
 - HAC_Sys.Builder   : about building a program around a main procedure
 - HAC_Sys.Librarian : about registering units, compiling them if needed, and making them available to other units.
 
In order to do things step by step, we have begun with the simplest form of modularity units: subprograms. We'll do packages later.
Probably some people will be surprised that modularity units in Ada can be something else than packages.

This little-known feature is already useful for the following very simple job: making a "shell" program calling other programs. An example: someone had a series of programs:
  poly_1 (Ada name: poly_1.adb, executable: poly_1.exe)
  poly_2 (Ada name: poly_2.adb, executable: poly_2.exe)
  poly_3 (Ada name: poly_3.adb, executable: poly_3.exe)
  ...

The deployment to users of all those executables was cumbersome.
The solution was to define:

  with Poly_1, Poly_2, Poly_3, ...
  with Ada.Command_Line;

  procedure Poly_N is

    use Ada.Command_Line;
  begin
    case Argument (1) is
      when "1" => Poly_1;
      when "2" => Poly_2;
      when "3" => Poly_3;
      ...
    end case;
  end;

 
Et voilà. Of course it works because Ada doesn't have a hard-coded name for "main".

Back to HAC's development. Here is a nonsensical example, which is a bit tricky on nesting levels.

a.adb:
  with B, C, HAL;

  procedure A is
    v : Integer;
    a_msg : HAL.VString;

    use HAL;

    procedure X is
    begin
      Put("(x>");
      a_msg := +"A";
      B;
      v := v * 2;
      Put("<x)");
    end X;

  begin
    v := 111;
    a_msg := +"a";
    HAL.Put(+"(a" & a_msg & ">");
    for i in 1 .. 2 loop C; end loop;
    X;
    B;
    X;
    HAL.Put(v, 0);
    HAL.Put("<A" & a_msg & ")");
  end A;

 
b.adb:
  with C, HAL;

  procedure B is
    use HAL;
    b_msg : VString := +"b";
    --
    procedure Y is
    begin
      Put("(y>");
      C;
      HAL.Put("<y)");
      b_msg := +"B";
    end;
    procedure Y2 is
    begin
      Y;
    end;
  begin
    Put ("(b" & b_msg & ">");
    C;
    Y2;
    HAL.Put("<B" & b_msg & ")");
  end B;


c.adb:
  with HAL;
  use HAL;

  procedure C is
    c_msg : VString;
    procedure Z is
    begin
     c_msg := +"C";
     HAL.Put("z");
    end Z;
  begin
    c_msg := +"c";
    Put("(c" & c_msg & ">");
    Z;
    Put("<C" & c_msg & ")");
  end C;

 
The output is, with the GNAT compiler:
>gnatmake a -Isrc
gcc -c -Isrc a.adb
gcc -c -Isrc b.adb
gcc -c -Isrc c.adb
gcc -c -I./ -Isrc -I- src/hal.adb
gnatbind -Isrc -x a.ali
gnatlink a.ali
>a
(aa>(cc>z<CC)(cc>z<CC)(x>(bb>(cc>z<CC)(y>(cc>z<CC)<y)<BB)<x)(bb>(cc>z<CC)(y>(cc>z<CC)<y)<BB)(x>(bb>(cc>z<CC)(y>(cc>z<CC)<y)<BB)<x)444<AA)

With HAC:
>hac a.adb
(aa>(cc>z<CC)(cc>z<CC)(x>(bb>(cc>z<CC)(y>(cc>z<CC)<y)<BB)<x)(bb>(cc>z<CC)(y>(cc>z<CC)<y)<BB)(x>(bb>(cc>z<CC)(y>(cc>z<CC)<y)<BB)<x)444<AA)

If we add "with B" to C, we get the "circular unit dependency" issue. Each compiler handles it, as expected.

>hac a.adb
c.adb: 2:7-8: library error: Circular unit dependency ("->" means "depends on"): B -> C -> B

>gnatmake a -Isrc
gcc -c -Isrc a.adb
a.adb:1:08: circular unit dependency
a.adb:1:08: "A (body)" depends on "B (body)"
a.adb:1:08: "B (body)" depends on "C (body)"
a.adb:1:08: "C (body)" depends on "B (body)"
a.adb:1:08: "B (body)" depends on "B (spec)"
gnatmake: "a.adb" compilation error 

 

HAC at work with shiny gold bags (Advent of Code, Day 7)

7 December 2020 at 14:13

Day 7 of the Advent of Code, titled "Handy Haversacks" is nice pair of puzzles involving recursion.

The data is a set of rules, beginning with

wavy green bags contain 1 posh black bag, 1 faded green bag, 4 wavy red bags.

dotted chartreuse bags contain 1 light beige bag.

dark white bags contain 2 dotted white bags.

... 

There are hundreds of such rules.

The puzzles involve recursion, which makes them fun.

You can see below HAC at work on the problem, from the LEA editor.

There is also a "full Ada" version. I began with that one, because the current limitations of HAC would have been too time-consuming (in terms of development time) for submitting a solution quickly enough. The limitations are not around recursion, that HAC masters like a big one, but mostly around the enumeration type I/O which is currently non-existent in HAC (v.0.081).

Click to enlarge

Solutions will be soon be posted on the HAC repositories.

HAC built with ObjectAda 10.2

6 December 2020 at 14:31

When you think that your software is highly compiler- and operating-system-independent, it is only a guess until you can verify it.

For HAC (the HAC Ada Compiler), the OS-independence is easy to verify thanks to GNAT, the well-known free Ada compiler.

Regarding the full independence, it is a bit trickier. There are two items (which are subprograms in the HAC_Pack package), that are intrinsically non-portable and not covered by the standard Ada libraries whose authors bear the burden of finding implementations:

  package Non_Standard is
    procedure Sys (Command : String; Result : out Integer);
    function Directory_Separator return Character;
  end Non_Standard;

Two subprograms in 12595 lines of code spanning over 59 source files (revision #306) - it's not a such a big deal.

So a real test was to build HAC with the ObjectAda64 for Windows development environment.

Surprise (but with Ada, it was still a bit expected...): the build went completely seamlessly once I had selected "Ada 2012" in the project settings (HAC's source use a few Ada 2012 features).

Zero error, and the real surprise: zero warning.

The ObjectAda implementation for the above package Non_Standard actually required more work than building the Ada sources (basically, a few mouse clicks). For Directory_Separator, it was easy since we could hardcode '\' given the Windows target. For the procedure Sys, we were able to use the same C function (system) as for the C library that comes with GNAT since the Microsoft run-time imitates some Unix (and then GNU) functionalities. Then, having the linker finding system was the real challenge. Basically if you reference the Win32 library in the project, the linker somehow finds system. Don't ask me how, it's part of the mysteries of the tools that emulate modularity for C (to say things politely).

Enough dirty details, here is a screenshot:

ObjectAda's Integrated Development Environment, right after a complete build of HAC. Click to enlarge.

HAC is free and open-source, sources can be found here and here.


Advent of Code 2020 with HAC and LEA

2 December 2020 at 20:27

First use of HAC, via the LEA editor, for the famous Advent of Code contest.

LEA screenshot: a parser for Day 2 Advent of Code's puzzle

In my (of course biased) opinion, LEA is perfect (among other tasks...) for developing quickly Ada solutions to the Advent of Code problems.

After the rush, I tidy up the source code with GNAT's style checks. Hence the presence of a GNAT project file, aoc_2020.gpr .

Then I post my solutions as HAC examples, here and here


Some research with LZMA...

28 November 2020 at 19:54

A rare case where Zip-Ada's LZMA encoder is much better than LZMA SDK's. Rare but still interesting, and with standard LZMA parameters (no specific tuning for that file):


The compressed size with current revision (rev.#882) of Zip-Ada is slightly worse (42,559 bytes).

The file is part of the classic Canterbury Corpus compression benchmark data set.

The HAC scripts invasion

27 October 2020 at 12:42

Perhaps you were already confronted to this problem:

  • You have "housekeeping" shell scripts for cleaning files, building tools, listing results, etc. . 
  • You would like to have the project, that these scripts are serving, running on multiple systems: Linux, MacOS, Windows, ... Especially for highly portable Ada projects, it is almost a must.
  • But in the end, you have lots of duplicate scripts: for each script one version for Linux, one version for Windows.
The solution: use HAC (the HAC Ada Compiler).

One practical example of script simplification can be found in the Zip-Ada project.
In the test directory, there were test_za.cmd and test_za.sh, meant to do the same thing: testing the compression side of the library. But the scripts were out of sync, and it was a pain to make them converge. So it was a perfect opportunity to switch to HAC, which has since its 0.076 version standard subprograms for file management. The unified script is test_za.adb, can be run with the hac test_za.adb command.
Now test_rz.cmd and test_rz.sh (for testing the Zip archive recompression tool, ReZip) are also unified, and so are make_za.cmd and make_za.sh for building everything.

More generally HAC scripts have tremendous advantages:
  • They are plain Ada, so there is no need to learn a new language.
  • If you need it, they can be compiled with an Ada compiler. It can be for different reasons:
    • You need performance (nested loops, for instance). You'll get C-level performance, at least with the GNAT compiler.
    • You need more functionalities that are not present in HAC.
    • You are afraid HAC is not developed or supported further.
Here are a few screenshots:



The screenshots are taken from TeXCAD and LEA - other Ada projects 😏...

HAC v.0.076: Ada.Directories-like subprograms

24 October 2020 at 07:12

After Ada.Calendar-like subprograms, here are now Ada.Directories-like subprograms which facilitate shell scripting with HAC in a portable way.

As usual, the easiest way to see the full set of additions is to look into HAC_Pack's specification, hac_pack.ads:

      function Current_Directory return VString;

procedure Set_Directory (Directory : String) renames Ada.Directories.Set_Directory;
procedure Set_Directory (Directory : VString);

procedure Copy_File (Source_Name : String; Target_Name : String);
procedure Copy_File (Source_Name : VString; Target_Name : String);
procedure Copy_File (Source_Name : String; Target_Name : VString);
procedure Copy_File (Source_Name : VString; Target_Name : VString);

procedure Delete_File (Name : String) renames Ada.Directories.Delete_File;
procedure Delete_File (Name : VString);

function Exists (Name : String) return Boolean renames Ada.Directories.Exists;
function Exists (Name : VString) return Boolean;

procedure Rename (Old_Name : String; New_Name : String) renames Ada.Directories.Rename;
procedure Rename (Old_Name : VString; New_Name : String);
procedure Rename (Old_Name : String; New_Name : VString);
procedure Rename (Old_Name : VString; New_Name : VString);
HAC is free and open-source, you can find it here and here.

HAC v.0.075: time functions: goodies for scripting tasks

20 October 2020 at 19:44
Today, HAC has a few more functions, from Ada.Calendar. I have added them in order to translate a Windows cmd script to Ada (with HAC_Pack). More precisely, it's "save.cmd", which takes a snapshot of the sources of the HAC system and other key files. This snapshot is a Zip archive and has a time stamp in its name, like "hac-2020-10-20-20-27-36-.zip". Hence the addition of standard functions like Year, Month, etc. The script is very practical for making backups between commits via subversion or git, and for other purposes. Now the script is called "save.adb" and does the same job, but not only on Windows, but also on Linux or other Operating Systems. Since the Zip compression is also programmed in Ada (Zip-Ada), you have in that script example a cool situation of Ada invading your computer 😊.

Here, a screenshot of the added functions running from the LEA editor (hum, also a full Ada software, by the way!):

HAC 0.075 running from LEA. Click to enlarge.

More to come soon with some subprograms stemming from Ada.Directories.

HAC is free and open-source, you can find it here and here.

Zip-Ada v.57

3 October 2020 at 20:55
 New in v.57 [rev. 799]:

  - UnZip: fixed bad decoding case for the Shrink (LZW) format,
        on some data compressed only by PKZIP up to v.1.10,
        release date 1990-03-15.
  - Zip.Create: added Zip_Entry_Stream_Type for doing output
        streaming into Zip archives
.
  - Zip.Compress: Preselection method detects Audacity files (.aup, .au)
        and compresses them better
.

***

Zip-Ada is a pure Ada library for dealing with the Zip compressed
archive file format. It supplies:
 - compression with the following sub-formats ("methods"):
     Store, Reduce, Shrink (LZW), Deflate and LZMA
 - decompression for the following sub-formats ("methods"):
     Store, Reduce, Shrink (LZW), Implode, Deflate, Deflate64,
     BZip2 and LZMA
 - encryption and decryption (portable Zip 2.0 encryption scheme)
 - unconditional portability - within limits of compiler's provided
     integer types and target architecture capacity
 - input archive to decompress can be any kind of indexed data stream
 - output archive to build can be any kind of indexed data stream
 - input data to compress can be any kind of data stream
 - output data to extract can be any kind of data stream
 - cross format compatibility with the most various tools and file formats
     based on the Zip format: 7-zip, Info-Zip's Zip, WinZip, PKZip,
     Java's JARs, OpenDocument files, MS Office 2007+,
     Google Chrome extensions, Mozilla extensions, E-Pub documents
     and many others
 - task safety: this library can be used ad libitum in parallel processing
 - endian-neutral I/O

***

Main site & contact info:
  http://unzip-ada.sf.net
Project site & subversion repository:
  https://sf.net/projects/unzip-ada/
GitHub clone with git repository:
  https://github.com/zertovitch/zip-ada

Enjoy!

AZip 2.40 - Windows Explorer context menus

3 October 2020 at 18:00

New release (2.40) of AZip.

The long-awaited Windows Explorer integration is there:



 
Context menu for a file

Context menu for a folder

This integration is activated upon installation or on demand via the Manage button:

Configuration

 

This new version is based on the Zip-Ada library v.57 and includes its recent developments.

Enjoy!

❌
❌