|
|
|
|
|
by scotty79
689 days ago
|
|
> The syntax `expr :~ annot` is used to annotate the expression with static information. Compiler can tell if a thing is static or dynamic and apply the correct behavior. Why would I ever want to check static thing only dynamically and why would I ever want to try statically check dynamic type if not by mistake? If programmer doesn't really have a real choice why make him choose which buttons to press? |
|
In a language like MetaPost I can use equations between variables:
A reference to a variable x will use the current set of equations and solve for x. The solution (it it exists) will become the value of the variable reference.Let's say I want to extend Rhombus with this new kind of variable (let's call them linear variables).
Each linear variable needs to have some static information attached. Here the relevant information is the set of equations to consider. A reference to a linear variable will then reduce (at compile time) the equations associated with the variable. The reduced set of equations is then used to generate runtime code that finds the value.
In a sense "static information attached to an expression" is just a convenient way of working with compile time information (in the sense currently used by macros in Racket).