Ann: HAC v.0.06
Wed, 20 May 2020 08:04:03 -0700 (PDT)

          From comp.compilers

Related articles
Ann: HAC v.0.06 (2020-05-20)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: Wed, 20 May 2020 08:04:03 -0700 (PDT)
Organization: Compilers Central
Injection-Info:; posting-host=""; logging-data="17425"; mail-complaints-to=""
Keywords: Ada, available
Posted-Date: 21 May 2020 22:43:14 EDT

HAC (HAC Ada Compiler) is available on two open-source development sites:

HAC is a small, quick, open-source Ada compiler, covering a subset of
the Ada language.
Even though the HAC documentation is more or less non-existent, the good
news is that you can use, as a help, Ada books and online documentation
about Ada: HAC does not define a dialect of Ada, only a subset.
A glimpse into the file "src/" gives you the currently
available types and subprograms.

The latest additions are:

    - v.0.06: Text File I/O around File_Type (example below)

    - v.0.05: type VString (variable-size string), with various operators
            and functions ("&", "*", comparison operators, Element, Length,
            Slice, Index, Trim, Image, Integer_Value, Float_Value functions);
            system functions (Argument_Count, Argument, Get_Env, Set_Env,

HAC programs are real Ada programs, they can be built by a "serious"
Ada compiler, through the HAC_Pack compatibility package.
See the exm/hac_exm.gpr and test/hac_test.gpr project files
for the GNAT compiler.

HAC is itself programmed in Ada. To build HAC for the command-line,
all you need (with GNAT) is to run "gprbuild -p -P hac".
Then you get the executable hax[.exe].
The command "hax" alone will show you basic help.

    HAX: command-line compilation and execution for HAC (HAC Ada Compiler)
    Compiler version: 0.06 dated 18-May-2020.

    Usage: hax [options] main.adb [command-line parameters for main]

    Options: -h : this help
                      -v, v1 : verbose
                      -v2 : very verbose
                      -a : assembler output
                      -d : dump compiler information

Gautier's Ada programming
NB: follow the above link for a valid e-mail address
PS: The example (exm/file_copy.adb):

with HAC_Pack; use HAC_Pack;

procedure File_Copy is
    s : VString;
    f1, f2 : File_Type;
    Open (f1, "file_copy.adb");
    Create (f2, "file_copy.txt");
    while not End_Of_File (f1) loop
        Get_Line (f1, s);
        Put_Line (f2, s);
    end loop;
    Close (f1);
    Close (f2);
end File_Copy

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.