You cannot make sense of “meaning” unless you assume some form of compositionality. We know the meaning of A: it is a (partial) function which maps some strings as input to some other strings as output. We could decompose A into an algorithm which parses a string to an abstract syntax tree, another algorithm which evaluates the AST and outputs an internal representation of its result, and a third algorithm which prettyprints the result. This makes sense, since our programming language probably has a syntax construct with the meaning of function composition.
But then what’s the meaning of an input, such as “2” ? Taking our algorithm as given, “2“ is sort of like a function which waits for the rest of our input and then feeds it to the evaluator. Under some niceness assumptions, we can reason about the whole thing and get something better: “2” means: “the leftmost leaf of the abstract syntax tree is of the form: 2 * 10^n + i_(n-1) * 10^(n-1) + i_(n-2) * 10^(n-2) + … + i_1 * 10 + i_0 , where n >= 0 and each i_k is a natural number from 0 to 9”. This assumes that we can assign natural numbers and trees as the meaning of our inner representation, which requires some handwaving in itself. If the programming language has primitive data types and operations for these, then this is easily justified. Otherwise, we would need to prove that some data representations within our program are isomorphic to the naturals, etc. and that the operations are also implemented correctly.
You cannot make sense of “meaning” unless you assume some form of compositionality. We know the meaning of A: it is a (partial) function which maps some strings as input to some other strings as output. We could decompose A into an algorithm which parses a string to an abstract syntax tree, another algorithm which evaluates the AST and outputs an internal representation of its result, and a third algorithm which prettyprints the result. This makes sense, since our programming language probably has a syntax construct with the meaning of function composition.
But then what’s the meaning of an input, such as “2” ? Taking our algorithm as given, “2“ is sort of like a function which waits for the rest of our input and then feeds it to the evaluator. Under some niceness assumptions, we can reason about the whole thing and get something better: “2” means: “the leftmost leaf of the abstract syntax tree is of the form: 2 * 10^n + i_(n-1) * 10^(n-1) + i_(n-2) * 10^(n-2) + … + i_1 * 10 + i_0 , where n >= 0 and each i_k is a natural number from 0 to 9”. This assumes that we can assign natural numbers and trees as the meaning of our inner representation, which requires some handwaving in itself. If the programming language has primitive data types and operations for these, then this is easily justified. Otherwise, we would need to prove that some data representations within our program are isomorphic to the naturals, etc. and that the operations are also implemented correctly.