HAC: Web site
Enjoy!
C:\Ada\hac\exm>..\hax -v2 maze_gen.adb
*******[ HAX ]******* Compiler version: 0.061 dated 28-May-2020.
*******[ HAX ]******* Caution: HAC is not a real Ada compiler. Type "hax" for license.
. . . .[ HAX ]. . . . Compiling from file: maze_gen.adb
. . . .[ HAX ]. . . . Compilation finished in 0.000414700 seconds.
. . . .[ HAX ]. . . . Starting p-code VM interpreter...
Height: 15, Width: 24
Starting generation at 7, 12
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| | | | | |
+ +---+ +---+---+ + +---+ +---+ +---+---+ + + + + +---+---+---+---+---+ +
| | | | | | | | | | | | | | |
+---+ +---+ +---+ + +---+---+ + + +---+---+---+ + +---+---+ + +---+ +---+
| | | | | | | | | | | |
+ +---+ +---+---+---+ +---+ + + +---+---+---+ + +---+ +---+ + +---+---+ +
| | | | | | | | | | | | | | |
+ +---+ + + + + + + +---+---+ + + + +---+ +---+ +---+ +---+---+ +
| | | | | | | | | | | | | | | | | | |
+---+ + + + +---+ + + + + + + + +---+ +---+ + + + + +---+ +
| | | | | | | | | | | | | | | | |
+ +---+ +---+---+ + + +---+ + +---+ + + +---+ +---+---+ +---+ + +---+
| | | | | | X | | | | | | | | |
+ + +---+---+ +---+---+ + +---+---+ + + + + + +---+ +---+ +---+ + +
| | | | | | | | | | | | | | | | |
+ +---+ + +---+---+ +---+---+---+ +---+---+ +---+ +---+ +---+---+ + + + +
| | | | | | | | | |
+ + +---+ + +---+---+ +---+---+---+ + +---+ + +---+---+ +---+---+---+---+ +
| | | | | | | | | | | | | | |
+ + + + + + + + + + +---+ + + +---+---+---+ +---+---+---+---+ +---+
| | | | | | | | | | | | | |
+---+ + + +---+---+---+---+ +---+ +---+ + + + + +---+---+---+---+ +---+ +
| | | | | | | | | | | | |
+ +---+---+---+ +---+---+ +---+ + + +---+ +---+ +---+---+---+ +---+---+ + +
| | | | | | | | | | |
+ + +---+---+---+---+ +---+---+---+ +---+---+---+ + +---+---+---+---+ +---+---+ +
| | | | | | | | | | | | |
+ + + + + + + +---+ + +---+---+---+ + +---+---+---+ +---+ + +---+ +
| | | | | | | |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
-------[ HAX ]------- VM interpreter done after 0.080759500 seconds.
C:\Ada\hac\exm>
HAC VM: raised Constraint_Error
Out of range
Trace-back locations:
exception_04.adb: Exception_04.Nest.NTF.Add_n_shift.Shift_n_add at line 18
exception_04.adb: Exception_04.Nest.NTF.Add_n_shift at line 23
exception_04.adb: Exception_04.Nest.NTF.Add_n_shift.Shift_n_add at line 16
exception_04.adb: Exception_04.Nest.NTF.Add_n_shift at line 23
exception_04.adb: Exception_04.Nest.NTF.Add_n_shift.Shift_n_add at line 16
exception_04.adb: Exception_04.Nest.NTF.Add_n_shift at line 23
exception_04.adb: Exception_04.Nest.NTF.Add_n_shift.Shift_n_add at line 16
exception_04.adb: Exception_04.Nest.NTF.Add_n_shift at line 23
exception_04.adb: Exception_04.Nest.NTF.Add_n_shift.Shift_n_add at line 16
exception_04.adb: Exception_04.Nest.NTF.Add_n_shift at line 23
exception_04.adb: Exception_04.Nest.NTF at line 27
exception_04.adb: Exception_04.Nest at line 34
exception_04.adb: Exception_04 at line 42
GNAT's output on the same program is: raised CONSTRAINT_ERROR : exception_04.adb:18 range check failed
[C:\Ada\hac\test\exception_04.exe]
Exception_04.Nest.Ntf.Add_N_Shift.Shift_N_Add at exception_04.adb:18
Exception_04.Nest.Ntf.Add_N_Shift at exception_04.adb:23
Exception_04.Nest.Ntf.Add_N_Shift.Shift_N_Add at exception_04.adb:16
Exception_04.Nest.Ntf.Add_N_Shift at exception_04.adb:23
Exception_04.Nest.Ntf.Add_N_Shift.Shift_N_Add at exception_04.adb:16
Exception_04.Nest.Ntf.Add_N_Shift at exception_04.adb:23
Exception_04.Nest.Ntf.Add_N_Shift.Shift_N_Add at exception_04.adb:16
Exception_04.Nest.Ntf.Add_N_Shift at exception_04.adb:23
Exception_04.Nest.Ntf.Add_N_Shift.Shift_N_Add at exception_04.adb:16
Exception_04.Nest.Ntf.Add_N_Shift at exception_04.adb:23
Exception_04.Nest.Ntf at exception_04.adb:27
Exception_04.Nest at exception_04.adb:34
Exception_04 at exception_04.adb:42
Main at b__exception_04.adb:294
procedure SD3 is
begin
for I in 1 .. 3 loop
declare
type T1 is new Integer range 1 .. I * 5; -- I is dynamic
subtype T2 is T1 range 1 .. T1 (I);
type T3 is array (1 .. 2 * I) of T2;
type T4 is array (1 .. 3 * I) of T3;
B: T4;
begin
null;
end;
end loop;
end;
x : array (False .. True) of Integer;
x : array (Boolean) of Integer;
for b in Boolean loopAs an illustration, here is an excerpt of the before/after comparison on one of the HAC examples:
x (b) := ...
end loop;
Click to enlarge |
New menu entry: Code sample (click to enlarge image) |
Sample selector (click to enlarge image) |
Enron didn't rely on huge "bet-the-company" gambles to create growth. Each step was a manageable investment that built on established capabilities and offered the potential to add new ones.
A company need not possess strengths in all areas of a business—just in the areas important to making money. Growers distinguish between attributes that garner value and those that are simply necessary to play the game. Enron became a world leader in international private power generation because it saw that profit did not depend on construction and operation skills, but on deal structuring and risk allocation.Anyway. Here are some new key additions to the CBSG, put in practice:
One thing about talent retention is clear: reputation and resiliency turbocharge a values-based market practice.Probably, if we search for "wirecard double-digit growth" we'll find some fresh stuff for the CBSG...
One thing about data practices is clear: delivery framework, competitive differentiator and solution boost architectures.
The Digital Marketers create strategic options and opportunities across geographies.
The pioneers create strategic options and opportunities going forward.
Opting out of reorganizations is not a choice, while the team players create new business options.
A profit-maximizing portfolio shaping 24/7 reenergizes a motivational onboarding solution. As a result, the team players create new business options.
Trending your numbers should carve a competitive position.
The point is not merely to carve a competitive position. The point is to reinvest in a high-grade footprint.
The team players preempt competitors by thinking outside of the box.
High-performance benchmarkings challenge us to preempt competitors.
The group facilitates our value-chain without pre-empting or constraining future flexibility.
The key representatives improve top-line talents without pre-empting or constraining future flexibility.
The challengers co-specify cross-platform, bifocal, evolutions.
The resources formulate a non-linear, bifocal and hyper-hybrid business equation.
Fully networked, company-first, industry market shifts challenge us to front-face bifocal value propositions.
Cross-pollinations deepen a manageable brand value.
The white-collar workforce potentiates manageable efficient frontiers.
Manageable portals motivate the market thinker.
The tolerably expensive, innovative, digital acceleration interacts with our distinctive workflows.
The decision makers strengthen distinctive swim lanes.
The enablers take control of structured, distinctive, organizational and high-level visibilities.
Click to enlarge |
Latest commit to the Corporate Bullshit Generator (live web app - source site 1 - source site 2): only one addition, but which one!
[prompt] produce_corporate_bullshit -h
Options:
-1, --one, --sig single sentence
-b, --bulk EXPR infinite loop; shows only sentences with EXPR
-h, --help this help
-w, --workshop workshop format
[prompt] produce_corporate_bullshit -b "together, we"
Together, we synergize a workforce-focused, deterministic, global touch-base.
Together, we prioritize well-implemented accelerators.
Together, we solutionize profiles.
Together, we execute on priorities.
Together, we enhance game-changing strategic staircases.
Together, we identify known unknowns.
Together, we facilitate our competitive success.
Together, we whiteboard outward-looking challenges.
Together, we create momentum.
Audacity is a free, open source, audio editor, available here.
If you want to backup you Audacity project, you can manually do it with "Save Lossless Copy of Project..." with the name, say, X, which will create X.aup (project file), a folder X_data, and, in there, a file called "Audio Track.wav".
Some drawbacks:
A solution: Zip-Ada.
The latest commit (rev. 796) adds to the Preselection method a specific configuration for detecting Audacity files, so they are compressed better than with default settings.
Funny detail: that configuration makes, in most cases, the compression better than the best available compression with 7-Zip (v.19.00, "ultra" mode, .7z archive).
The compressing process is also around twice as fast as 7-Zip in "ultra" mode. This is no magic, since the "LZ" part of the LZMA compression scheme spends less time finding matches, in the chosen configuration for Zip-Ada.
A backup script could look like this (here for Windows' cmd):
rem --------------------------
rem Nice date YYYY-MM-DD_HH.MM
rem --------------------------
set year=%date:~-4,4%
set month=%date:~-7,2%
if "%month:~0,1%" equ " " set month=0%month:~1,1%
set day=%date:~-10,2%
if "%day:~0,1%" equ " " set day=0%day:~1,1%
set hour=%time:~0,2%
if "%hour:~0,1%" equ " " set hour=0%hour:~1,1%
set min=%time:~3,2%
set nice_date=%year%-%month%-%day%_%hour%.%min%
rem --------------------------
set audacity_project=The Cure - A Forest
zipada -ep2 "%audacity_project%_%nice_date%" "%audacity_project%.aup" "%audacity_project%_data\e08\d08\*.au"
Just in time to celebrate the 25th anniversary of Windows as we know it (ouch!), here is a gadget-ish contribution to the GWindows library, the open-source Ada library for MS Windows, available here and here.
In there gwindows/contrib directory, there is gwin_util.ads (spec.) and gwin_util.adb (body), and in gwindows/contrib/test, there are demos. All that is available comfortably through the gwindows_contrib.gpr project file in the gwindows directory.
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;HAC is free and open-source, you can find it here and here.
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);
Perhaps you were already confronted to this problem:
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.
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.
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.
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.