comp.lang.ada
 help / color / mirror / Atom feed
* Ann: HAC v.0.085
@ 2021-01-01 16:18 Gautier write-only address
  2021-01-02 21:10 ` reinert
  0 siblings, 1 reply; 4+ messages in thread
From: Gautier write-only address @ 2021-01-01 16:18 UTC (permalink / raw)


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.

Web site: http://hacadacompiler.sf.net/
Source repository #1: https://sf.net/p/hacadacompiler/code/HEAD/tree/
Source repository #2: https://github.com/zertovitch/hac

* Improvements:

    HAC_Integer (internal name in HAC_Sys.Defs), i.e. HAC's Integer
        type, is now 64 bit.
    HAC_Float (i.e. `Real` in HAC programs) has now System.Max_Digits
        digits accuracy.
    Added range constraints, like: ` subtype Answer_Range is Character
        range 'a' .. 'z' `.
    Added membership test, like: ` x [not] in a .. b `.
    Several additions to HAC_Pack.
    Better I/O error handling.
    The whole system (Compiler and VM run-time) builds on both
        GNAT and ObjectAda64.

* Fixes ([hand_washing] all bugs stem from SmallAda [/hand_washing]):

    Recursive calls to main procedure were mistaken as calls to
        "standard" procedures in HAC_Pack
    Block identification used main program's identifier instead
        of its nesting.
    EXIT statement on FOR loop implied stack corruption for several
        nested FOR loops.
    EXIT statements within IF statements didn't work properly.
    Priority levels in expressions were not conform to
        the Ada Reference Manual's. Most visible change: needless
        brackets can now be removed around logical expressions.

* Test suite: added new 19 programs to the 12 existing tests.
    The 19 source files are named exm/aoc/2020/aoc_2020_*.adb,
    solutions to the Advent of Code 2020 puzzles.

Enjoy!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ann: HAC v.0.085
  2021-01-01 16:18 Ann: HAC v.0.085 Gautier write-only address
@ 2021-01-02 21:10 ` reinert
  2021-01-03 10:53   ` Gautier write-only address
  2021-01-07 19:18   ` Gautier write-only address
  0 siblings, 2 replies; 4+ messages in thread
From: reinert @ 2021-01-02 21:10 UTC (permalink / raw)


Interesting with a subset under development,

It did function at my first attempt on my raspberry pi :-)

Maybe too early to ask, but is there an overview of what is implemented and not implemented?
Detail: all procedures need "with hac_pack; use  hac_pack;" ? 

reinert

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ann: HAC v.0.085
  2021-01-02 21:10 ` reinert
@ 2021-01-03 10:53   ` Gautier write-only address
  2021-01-07 19:18   ` Gautier write-only address
  1 sibling, 0 replies; 4+ messages in thread
From: Gautier write-only address @ 2021-01-03 10:53 UTC (permalink / raw)


> It did function at my first attempt on my raspberry pi :-) 

Gr8 !

> Maybe too early to ask, but is there an overview of what is implemented and not implemented? 

Not too early at all! Here is an excerpt of doc/hac.txt which summarizes the current subset supported:

  - You can define your own data types: enumerations, records, arrays
      (and every combination of records and arrays).
  - Only constrained types are supported (unconstrained types are
      Ada-only types and not in the "Pascal subset" anyway).
  - The "String" type (unconstrained) is implemented in a very limited
      way. So far you can only define fixed-sized constants,
      variables, types, record fields with it, like:
        Digitz : constant String (1..10) := "0123456789";
      ... output them with Put, Put_Line, do comparisons and
      concatenations with expressions of the VString variable-length
      string type.
      For general string manipulation, the most practical way with
      the current versions of HAC is to use the VString's.
  - There are no pointers (access types) and nor heap allocation,
      but you will be surprised how far you can go without pointers!
  - Subprograms names cannot be overloaded, although some *predefined*
      subprograms, including operators, of the Standard or the
      HAC_Pack package, are overloaded many times, like
      "Put", "Get", "+", "&", ...
  - Programmable modularity (packages or subprograms that you
      can "with") is not yet implemented.
  - Generics are not yet implemented.
  - Tasks are implemented, but not working yet.
  - Small parts of the standard Ada library are available through
      the HAC_Pack package. You can see the currently available
      items in the specification, src/hac_pack.ads .

To get a "tangible" idea, you can look at the examples in the "exm" directory (run ../hac gallery.adb for a show), and the "exm/aoc/2020" directory.
There is also stuff in "test", but programs there are not meaningful.

> Detail: all procedures need "with hac_pack; use hac_pack;" ? 

So far, yes. When modularity is implemented it will change...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ann: HAC v.0.085
  2021-01-02 21:10 ` reinert
  2021-01-03 10:53   ` Gautier write-only address
@ 2021-01-07 19:18   ` Gautier write-only address
  1 sibling, 0 replies; 4+ messages in thread
From: Gautier write-only address @ 2021-01-07 19:18 UTC (permalink / raw)


On Saturday, January 2, 2021 at 10:10:37 PM UTC+1, reinert wrote:

> Detail: all procedures need "with hac_pack; use hac_pack;" ? 

Actually not anymore, now (rev. #400+) you can write things like:

with HAC_Pack;

procedure Hello is
  procedure Prefixed is
  begin
    HAC_Pack.Put("Hello");
  end;
  procedure Using_Use is
    use HAC_Pack;
  begin
    Put(" World!");
  end;
begin
  Prefixed;
  Using_Use;
end;
 
:-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-07 19:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01 16:18 Ann: HAC v.0.085 Gautier write-only address
2021-01-02 21:10 ` reinert
2021-01-03 10:53   ` Gautier write-only address
2021-01-07 19:18   ` Gautier write-only address

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox