Is there a single noun for "value available at compile time"?
I'm working on an interpreter for some programming language.
The language uses many concepts, notably the concept of:
- "type" or "data type" (see Wikipedia's data type page)
- "value", in the sense of "data to which a type is assigned"
The interpreter for the language runs through at least two phases (happening in this order):
- compile time
- run time
Currently, in the module of the code base of the interpreter that implements the "run time" phase, I have a class named Value
and a class named Type
.
I am in the process of bringing the Type
class back to the "compile time" phase, so that type checking is done at the "compile time" phase rather than at the "run time" phase (In other words I'm trying to recover from a bad design decision).
This implies that I also have to somehow bring a bent version of the Value
class back to the "compile time" phase. More precisely, I have to create a new class that can:
- generate a
Value
- infer the
Type
of theValue
that can be generated
You could describe this concept as a "type-ascribed not-yet-evaluated value", or as a "value with a type", or as a "lazy value which type can be accessed without actually performing any run time operation".
[EDIT]
In other words, I'm trying to find a noun group for a value that is meant to be evaluated at run time, but which type is available at compile time without any computational cost.
[/EDIT]
So I'm now stuck, staring at my screen, looking for a miracle to find a way to name this concept. I'm looking for a noun group with the least amount of characters in it that represents this concept.
Here are some exemples of how the noun group would be used in an English sentence (as opposed to "in an identifier") like this:
As you see here [points a line of code], I can infer the type of an expression by using a [the noun group] without even evaluating the expression.
[The noun group] allows you to freely export some source code into as many different target languages as you'd like.
So far I came up with these names (each of them is followed by the reason it was dropped surrounded in parentheses):
class ValueThatHasAType { ... }
(It's really verbose, despite representing pretty well the idea)
class CompileTimeValueAndType { ... }
(It's really verbose, again, despite being really close to the concept I want)
class Symbol { ... }
(accordingly to thesaurus, "symbol" is a "letter, character, sign of written communication" (at the time I write this), but I'm trying to represent some sort of Value
)
class TypedLazyValue { ... }
(This is not really adapted: A LegsArmsBodyHead
isn't a Human
. In other words, TypedLazyValue
is too broad)
I'm not really expecting a single noun to exist for this (since I searched a lot on google and I couldn't find an acceptable term in the terminology used in the fields of compilation and interpretation), but if there is one, then I'd really be pleased to hear about it.
You could call this a declaration reference.
If I understand you correctly, your language has lexical tokens that have a type property and a value property.
The token 123 for example has the type integer and a value that identifies a location in a table. As the compilation proceeds, the entry at that table location will change. Ultimately, it may contain a relative address in the memory of the execution system, which in turn may contain a binary coded number.
In the first stage of lexical analysis, there is no real way to identify the type, unless it has been previously declared.
The declaration can be explicit, as it is in C++, Java and similar arguments.
The declaration can also be implicit in various ways. For example, the assignment of a string constant to a variable can implicitly declare the variable to be a string. This may require more than a simple analysis however, since many languages allow upconversions, implicit casting and other programmer conveniences, which make anything other than a simple assignment difficult to parse.
In any case, if you want to determine the association between a lexical token and a type, some kind of association must have already been performed. At runtime this can sometimes be done by examining the value assigned at an earlier point in the execution. Prior to runtime, the association must be made by some kind of declaration. Hence the term declaration reference.
Edited to add:
More generally, you could refer to the declaration as a type binding, in the same way that an assignment is a value binding. However, declaration might be more clearly seen as something that happens at compile time.