ETAC Website
Contents: Introduction, Features of ETAC, Script Examples, Screenshots.
This is the official website of the ETAC Programming Language. The latest version of the ETAC system was released on 15 December 2025 (Downloads: ETAC_Installers_4-ena.zip).
NOTE: This website is written in Australian English.
►►► ETAC CAN NOW DO INTERACTIVE GRAPHICS ◄◄◄
See Latest Announcements and The Visual Interaction System for ETAC for details.
INTRODUCING the production release of the first graphics version of ETAC for writing windowed 2-D graphics application programs in the ETAC programming language. The production release includes formal documentation and auxiliary programs. It also includes a comprehensive tutorial program with executable ETAC code examples to demonstrate the graphics features of the new ETAC.
Introduction
ETAC™ (pronounced: E-tack) is a syntactically simple but extremely versatile general purpose dictionary and stack based interpreted script programming language fully capable of traditional high-level block structured language style syntax. The ETAC programming language is not based on any other programming language.
An ETAC program is written in a single-byte (Western European Windows® code page 1252) or Unicode® (UTF-8, UTF-16, or UTF-32) text file which is interpreted directly by the Run ETAC Scripts program. The ETAC programming language has basic support for the full Unicode® codespace. ETAC is released only for the Windows® operating system using the x86 (32-bit) architecture (can also run on the x64 (64-bit) architecture) beginning with Windows® XP. Also, ETAC is released only in the (Australian) English language.
ETAC operates by sequentially activating text tokens (“token activated language” or “TAL” for short) from a file in conjunction with three object stacks, one of which contains dictionaries of defined token words. Instead of merely activating tokens from left to right, as is the case for other TALs, ETAC activates programmer-determined groups of tokens sequentially from left to right, but the tokens in each group are activated from right to left (“sequential reverse-flow activation”). An ETAC program, therefore, is not strictly written in postfix notation (unless the programmer wants to), but in groups of tokens with prefix notation activated in reverse. Such a system can be designed to incorporate a high-level syntactic structure without sacrificing the versatility of a TAL. The result of such a design is that an ETAC program could be written using any combinations of high-level syntax (as is typical of traditional high-level block structured languages) and TAL type syntax (as is typical of languages such as PostScript® and FORTH) in a seamless manner.
Features of ETAC
Some of the noteworthy features of ETAC are:
- Operates as a token activated language using sequential reverse-flow activation.
- An operator can be placed in any position within the parentheses of an operator expression (‘non-fix’ notation).
- ‘if’, ‘choice’, and ‘iterative’ command structures can be modified at run-time. The indexing structure of accessing sequences of multiple depth can also be modified at run-time.
- Any variable can have any type of value at any time (“dynamic typing”), including another variable as value.
- The size of sequences can change dynamically, and the sequences can have any mixture of elements including other sequences.
- Capable of full traditional high-level block structured language style syntax, as well as traditional stack-based language style, or any mixture of both.
- Can construct sequences and procedures at call-time (of a procedure).
- Internally emulates data structures via dictionaries, and uses data structures to emulate object oriented programming via ETAC script.
- Can internally create ETAC text script and execute it in a new ETAC session which shares command and operator definitions with the main ETAC session.
- Can compile ETAC script into binary form for convenience and execution speed (but is not required) via the ETAC Compiler program.
- Contains an internal interactive debugger for visually tracing the activation of script tokens in ETAC scripts when running in debug mode.
- A C++ computer programmer can extend the native set of commands and operators via external TAC libraries (implemented as dynamic linked libraries).
- An ETAC program can execute C++ application program functions, which allows an application program to use ETAC as a macro language via a special ETAC dynamic linked library.
- Has basic support for the full Unicode codespace (U+0000 to U+10FFFF).
- Intrinsically capable of windowed 2-D graphics programming.
An overview of the ETAC programming language is presented in the document ETACOverview.pdf. The official definition of the ETAC programming language is presented in the document ETACProgLang(Official).pdf.
Script Examples
An ETAC code sample (without explanation) for illustrative purposes is presented below. Notice that the code is in the form of traditional block structured style syntax, but keep in mind that ETAC is a dictionary and stack based language (notice the pop and swap commands on the tenth line, which are typical commands of a stack-based programming language). Comments are shown in green, and ignored by the ETAC interpreter.
[* Determines if a sub-string exists in a string sequence. *]
FindString :- fnt:(pStrSeq[*str-seq*] pStr[*str*]) [* => bool *]
{
RtnVal :- false; [*rtn*]
SrcStr :- ?;
do with SrcStr of pStrSeq while not RtnVal
{
RtnVal := (pop swap find_str pStr SrcStr != -1); [* Tenth line. *]
};
RtnVal; [*RETURN*]
};
[* Splits a string sequence at a line number and character offset. *]
SplitLines :- fnt:(pTextLines[*str-seq*] pLineNum[*int*] pCharOff[*int*])
{
ExtrLine :- ?;
ExtrLine := pTextLines%[pLineNum] := extr_str 0 pCharOff pTextLines%[pLineNum];
if (|pTextLines| = pLineNum) then
{pTextLines +:= ExtrLine;}
else
{pTextLines<%[(pLineNum + 1)] := ExtrLine;}
endif;
};
[* Function Calls *]
TextLines :- ["A string here", "Another one", "The final string"];
Found := FindString(TextLines "one");
SplitLines(TextLines 2 7);
The function SplitLines (shown in the example above) can be written as an ETAC procedure in typical stack-based syntax without using variables, as shown below.
SplitLines :- [* str-seq line-num-int char-off-int => - *]
{
copy 2; swap; get_elm; copy_any 4; extr_str 0; copy_any 3; swap; copy_any 5; put_elm;
copy_any 3; copy_any 3; size; swap; pop; eq;
if_else {mk_seq 1; roll -1 3; add2 1; insert;} {swap; add2; roll -1 3; pop;};
pop; pop;
};
[* Function Call *]
TextLines :- ["A string here", "Another one", "The final string"];
SplitLines TextLines 2 7;
To further illustrate the syntactic versatility of the ETAC programming language, consider a function, Factorial, to calculate the factorial of an integer. The function is defined in two ways. The first way uses the recursive method in a traditional block structured style syntax. The code uses a parameter and a local variable. A programmer not familiar with the ETAC programming language would not be able to tell that the code is written in a dictionary and stack based language. Note that the example below is for illustrative purposes only; the function can be written in a more concise way.
Factorial :- fnt:(pNum[*int*]) [* => factorial-int *]
{
Num :- pNum;
if (pNum = 0) then
{pNum := 1;}
endif;
if (pNum > 1) then
{Num := Factorial((Num - 1));}
else
{Num := 1;}
endif;
(pNum * Num); [*RETURN*]
};
The second way to define the Factorial function uses a procedure definition without using any parameters, local variables, or the dictionary stack (other than for storing the actual procedure itself). It uses only the object stack. This code runs the most efficiently; it does not use the recursive method. The factorial factors (1, 2, …, n) are all pushed onto the object stack first, then multiplied together.
Factorial :- [* int => factorial-int *]
{
(* 1 1 do_for {} 1 1 swap); [*RETURN*]
};
Some other ways to write the Factorial function are shown below.
Factorial :- fnt:(pNum[*int*]) [* => factorial-int *]
{
if (pNum = 0) then
{@Return 1;} [*RETURN*]
endif;
(pNum * Factorial((pNum - 1))); [*RETURN*]
};
Factorial :- fnt:(pNum[*int*]) [* => factorial-int *]
{
@IfElse((pNum = 0) 1 {(pNum * Factorial((pNum - 1)));}); [*RETURN*]
};
Factorial :- fnt:(pNum[*int*]) [* => factorial-int *]
{
if_else {mult2 pNum Factorial(sub2 pNum 1);} 1 (pNum = 0); [*RETURN*]
};
As can be seen from the illustrations above, the ETAC programming language is, arguably, the first of an evolutionary step of dictionary and stack based token activated programming languages, capable of full traditional high-level block structured syntax with the versatility and efficiency of a token activated stack-based language. Programmers who are not accustom to thinking on their own may find the versatility of ETAC overwhelming.
The Visual Interaction System for ETAC
The ETAC interpreter now intrinsically contains a system that allows user visual interactions with computer software. The system is called VIS (Visual Interaction System), and is implemented in both ETAC code and the ETAC interpreter executable program (C++), and can be used to create fully-fledged interactive 2-D graphics computer programs via the ETAC programming language. The system incorporates mainly vector graphics that the user can interact with, without the application programmer writing substantial ETAC code in many cases. No third-party software is used in or by VIS.
VIS allows an ETAC programmer to create a graphics application program by constructing the program via predefined (by VIS) components. There are components for projects, drawing planes (the “canvas” by which graphics objects are defined), VIEWs (operating system windows), graphics objects and sub-objects (the programmer-defined graphics to be drawn), five types of graphics items (which belong to graphics objects, and include vectors, text, and bitmaps), graphics contexts, pen attributes, brush attributes, bitmap attributes, text style attributes, and data packs. VIS components are not accessed by (or stored in) variables, but accessed by a unique text name or corresponding numerical identifier. VIS owns the components and maintains them where required.
To an ETAC application program, VIS is a set of ETAC API functions and commands, most of which create and set up the components of the application program as configured by the application programmer. However, VIS does not have direct drawing functions; the application program defines what to draw, but not how to draw. Therefore, the drawings that appear in VIEWs (windows) are defined by the application programmer via graphics components, and VIS automatically takes care of rendering a drawing onto the appropriate VIEW.
VIS implements some autonomous features, alleviating programmers themselves from explicitly programming those features. However, the programmer can disable those features and explicitly program their own desirable versions instead. An autonomous feature is typically activated by the programmer just setting an appropriate flag or calling an appropriate function; no other programming is necessary. Autonomous features include automatic rendering of images into a VIEW, scrolling and zooming the image in a VIEW via the right mouse button, mouse click and drag selection of graphics objects, graphics object resizing and movement via the left mouse button, automatic highlighting of graphics objects when selected, zoom range visibility for items, and fixed size items when zooming. The autonomous features are explained and demonstrated in the downloaded ETAC package.
The following ETAC code is a full program with minimal coding that uses default settings to create a maximised VIEW (window) displaying the text “Hello World!” as a graphics object in the centre.
[*::10ETAC-SOURCE-V1::*]
[* Simple Hello World program using graphics with default settings. *]
[* Use the default project (named "@VIS"). *]
vis_Project(?)
{
[* Create a drawing plane (canvas) for the text to be drawn on. *]
vis_DPlane("")
{
[* Create a VIEW (window) to display the text defined in the drawing plane. *]
vis_VIEW("")
{};
[* Create a graphics object on the drawing plane to be displayed. *]
vis_GObject("")
{
[* Create a graphics text item for the graphics object. *]
vis_TextItem("")
{@tiText := "Hello World!";};
};
};
};
[* Process user input (clicking the close button on the VIEW will end the program). *]
void vis_WaitForEvents(?);
Note that there are no drawing commands; the drawing is rendered automatically by VIS according to the specifications (eg: @tiText) set by the programmer.
Screenshots
The Gallery page contains screen shots and other pictures relating to the ETAC programming language.
.png)