If you want to compute a value at compile-time you can use a static block that returns a tuple and you can extract what you need from that tuple.
Or you can use a template + inject like what we're doing here: [https://github.com/status-im/nimbus/blob/master/nimbus/vm/interpreter/gas_costs.nim#L112](https://github.com/status-im/nimbus/blob/master/nimbus/vm/interpreter/gas_costs.nim#L112)