So, if I were to write a programming language where the scope is accessible as an object, for example:
BlockScope {
scope: [circular BlockScope],
concat: "hello world",
parent: FunctionScope {
scope: [circular FunctionScope],
arg1: "hello",
arg2: "world",
parent: GlobalScope {
scope: [circular GlobalScope]
/* ... */
}
}
}
Would the performance be terrible? I know most programming languages, even interpreted languages, don’t preserve variable names, save for the global scope. I can infer, then, that this increases performance by a significant amount, but in this language, I would have to keep track of everything, nullifying most scope-based optimizations.
Note: This language would be written in a compiled language of some sort, maybe Rust.
TwiceUponATime is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.