aime(1)

πŸ“¦ version 8.20250217, in epel 10, epel 9, fedora 43, fedora 44

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-out DUE β€” 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 means aime decides 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 is 4. πŸ“
  • -D, --reference-bail-set SET β€” 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, --initial INDEX β€” Sets where line numbering starts when error reporting kicks in. It starts from INDEX, and the default is 1 πŸŽ€
  • -W, --cpp COMMAND β€” Sets the source preprocessing command to COMMAND 🧚 The command reads standard input and writes standard output. The default is cpp. Alternatives that are known to work include gcc -E - and mcpp πŸ’œ
  • -a β€” Makes your program arguments available as argc() / argv() / args() ✨ The arguments won't get read as TYPE NAME VALUE triplets 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 than 0 πŸ™ˆ This doesn't apply to processes waited on through aime library routines, like xs_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 the c code character 🌸
  • void o_flush(void); β€” flushes standard output 🫢
  • void o_integer(integer m); β€” outputs m ✨
  • void o_real(integer d, real x); β€” outputs x with no more than d digits if d is not less than 0, and does nothing otherwise πŸ¦‹
  • void o_text(text s); β€” outputs s πŸ’–

✨ ERROR FUNCTIONS ✨

And these are the standard error formatting functions 😭

  • void v_byte(integer c); β€” outputs the c code character πŸ”₯
  • void v_flush(void); β€” flushes standard error 🧚
  • void v_integer(integer m); β€” outputs m πŸ’œ
  • void v_real(integer d, real x); β€” outputs x with no more than d digits if d is not less than 0, and does nothing otherwise 🌈
  • void v_text(text s); β€” outputs s πŸŽ€

✨ 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 πŸ’– A 0 i gives you all the arguments, including the program name. A 1 i skips the latter 🫢
  • void exit(integer e); β€” terminates program execution and tells aime to 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 πŸ’–βœ¨