aime(1)
Okay bestie, let's talk about aime π it's from the General Commands crew and it is such a main character π§
β¨ NAME β¨
aime - interpret programs πΈ
β¨ SYNOPSIS β¨
aime [OPTIONS] PROGRAM [TYPE NAME VALUE]...
β¨ DESCRIPTION β¨
okay so aime executes your PROGRAM π₯ The TYPE NAME VALUE bits are how you slide program-accessible constants in. The TYPE can be one of cardinal (integral, positive), integer (integral), real (real) and text (string). β¨
β¨ OPTIONS β¨
-B,--reference-bail-outDUE β Okay this one's giving memory management π It stops reference tracing when it's figuring out reachability after DUE links have been examined. That check happens every time a reference gets removed, and the unreachable objects get destroyed. If it can't decide within DUE reference examinations, those objects get recorded and sorted out later in one consolidated go. A zero DUE meansaimedecides right away, no matter how many links it has to check π«Ά Any non zero value switches things from immediate disposal to consolidated disposal. The default for DUE is4. π-D,--reference-bail-setSET β Clears the bailed out references once there are SET of them. The reachability check for the recorded objects gets triggered when that count hits SET π¦-S,--initialINDEX β Sets where line numbering starts when error reporting kicks in. It starts from INDEX, and the default is1π-W,--cppCOMMAND β Sets the source preprocessing command to COMMAND π§ The command reads standard input and writes standard output. The default iscpp. Alternatives that are known to work includegcc -E -andmcppπ-aβ Makes your program arguments available asargc()/argv()/args()β¨ The arguments won't get read asTYPE NAME VALUEtriplets though. Check MISCELLANEOUS FUNCTIONS for the tea β-cβ Runs the PROGRAM program instead of the program read from the PROGRAM file π-f,--framedβ Expands function calls in a hierarchical way. It's faster than the default sequenced execution, but the stack based execution can't run programs once the call stack gets too deep π-p,--preprocessβ Runs your source through the C preprocessor π
Heads up bestie: comments in preprocessed sources should follow the preprocessor comment syntax. Source preprocessing is still experimental π and the preprocessor error messages look different from aime error messages, so don't panic.
-s,--sequencedβ Runs the program step by step and flattens the call hierarchy π«Ά It's a little slower than the stack based execution, but it can run programs no matter how deep the call stack gets. This is the default π--ignore-child-exitsβ Don't fail when child processes exit with something other than0π This doesn't apply to processes waited on throughaimelibrary routines, likexs_spend.--listβ Lists the available functions and exits with a status code that means success πΈ--helpβ Prints a usage message and exits with a status code that means success π--versionβ Prints version info on standard output and then exits π₯
β¨ PROGRAM SYNTAX β¨
Okay the syntax is basically C's cousin π It lets you use prefix unary and common binary operators, functions and variables. The types you can use include the immediate cardinal (integral, positive), integer (integral), real (real) and text (string), plus the referable data (byte array), date (calendar date), file (UNIX file), list (heterogenous sequence), record (string key heterogenous associate table), time (duration), etc. void is allowed as a function type β¨
The C if, else, while, do while and break statements are all here, and their syntax and semantics are pretty much the same as C π¦ There's also an extra elif statement that's borrowed from the C preprocessor, though its syntax is more C inspired. The for statement is for collection traversals. Its first iterator variable is always the position, and the optional second one is the data in that position π§ The opening and closing block braces are mandatory π Declarations have to come before statements inside a block, and variable initialization is disallowed π
A more formal syntax definition is:
program: block
block: declarations_section statements_section
declarations_section:
| declarations_line declarations_section
declarations_line: type name subsequent_name ;
subsequent_name:
| , name subsequent_name
statements_section:
| statement_line statements_section
statement_line: ;
| expression ;
| do { break_block } while ( expression ) ;
| if ( expression ) { block } elif_block_list else_block
| for ( variable1 [variable2] in collection ) { break_block }
| while ( expression ) { break_block }
elif_block_list:
| elif_block elif_block_list
elif_block: elif ( expression ) { block }
else_block:
| else { block }
collection: expression
break_block: declarations_section break_statements_section
break_statements_section:
| break_statement_line break_statements_section
break_statement_line: break ;
| statement_line
Functions and variables don't share a name space, so you're allowed to use a function name for a variable π
The break, do, elif, if, else and while keywords, plus the cardinal, integer, real and text type names, are restricted and can't be used for variable naming π«
The expression syntax is super similar to C expression syntax π Most prefix unary and common binary C operators are supported. That includes unary !, +, - and ~, and binary *, /, %, +, -, <<, >>, <, >, <=, >=, !=, ==, &, ^, |, &&, ||, =, +=, -=, *=, /=, %=, &=, ^=, |=, <<= and >>=. The semantics and precedence are the same as their C counterparts, or at least very close π
There's also a secondary syntax for functions, and the function definition syntax is pretty much C syntax π¦ One main function is expected. It returns integer and has a void argument list π
The formal syntax definition is:
program: function subsequent_function
function: definition
| declaration
definition: void name ( arguments_list ) { block }
| type_other_than_void name ( arguments_list ) { block_return }
arguments_list: void
| ...
| argument subsequent_argument
| argument subsequent_argument , ...
argument: type reference_class name
block_return: block return expression ;
declaration: type name ( positions_list ) ;
positions_list: void
| ...
| position subsequent_position
| position subsequent_position , ...
position: type reference_class
| type reference_class name
reference_class:
| &
subsequent_position:
| , position subsequent_position
subsequent_argument:
| , argument subsequent_argument
subsequent_function:
| function subsequent_function
Functions may return no value, but integer and real returns are the only ones that work π (so the return type can only be one of cardinal, integer, real and void) π
β¨ OUTPUT FUNCTIONS β¨
Here are the standard output formatting functions π
void o_byte(integer c);β outputs theccode character πΈvoid o_flush(void);β flushes standard output π«Άvoid o_integer(integer m);β outputsmβ¨void o_real(integer d, real x);β outputsxwith no more thanddigits ifdis not less than0, and does nothing otherwise π¦void o_text(text s);β outputssπ
β¨ ERROR FUNCTIONS β¨
And these are the standard error formatting functions π
void v_byte(integer c);β outputs theccode character π₯void v_flush(void);β flushes standard error π§void v_integer(integer m);β outputsmπvoid v_real(integer d, real x);β outputsxwith no more thanddigits ifdis not less than0, and does nothing otherwise πvoid v_text(text s);β outputssπ
β¨ MISCELLANEOUS FUNCTIONS β¨
These are the interpreter specific functions π§
integer argc(void);β is the number of program arguments πtext argv(integer i);β is the i indexed program argument, and the name of the program is the first one πΈ Negative indices count from the end of the arguments list π¦list args(integer i);β is a new list of the program arguments, starting with the i indexed one π A0i gives you all the arguments, including the program name. A1i skips the latter π«Άvoid exit(integer e);β terminates program execution and tellsaimeto exit with e β¨
Also, the argc(), argv() and args() functions are only available if you ask for them with the -a option π
β¨ MISCELLANEA β¨
aime waits for the child processes started through the process library, etc. π₯
β¨ RETURN VALUE β¨
aime returns non zero if the program execution wasn't successful π If it was successful, aime returns the value of the exit argument if exit was called. Otherwise it returns the return of main for procedural programs, and zero for non procedural programs π
β¨ SEE ALSO β¨
cpp(1), express17(1), gcc(1), mcpp(1) π¦
β¨ AUTHORS β¨
Ciprian Niculescu π«Ά
That's the whole tea, bestie π This manual was written by Ciprian Niculescu, and it's the aime(1) page last updated in May 2019 πβ¨
π¦ where this page comes from
- epel 10: aime 8.20241231-1.el10_0 Β· GPL-3.0-or-later
- epel 9: aime 8.20241231-1.el9 Β· GPL-3.0-or-later
- fedora 43: aime 8.20241231-1.fc42 Β· GPL-3.0-or-later
- fedora 43: aime 8.20241231-1.fc42 Β· GPL-3.0-or-later
- fedora 43: aime 8.20250217-1.fc43 Β· GPL-3.0-or-later
- fedora 43: aime 8.20250217-1.fc43 Β· GPL-3.0-or-later
- fedora 44: aime 8.20250217-3.fc44 Β· GPL-3.0-or-later
- fedora 44: aime 8.20250217-3.fc44 Β· GPL-3.0-or-later
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms