just wondering if "go" compiler uses any sort of optimization such as constant folding.
https://en.wikipedia.org/wiki/Constant_folding
searched through google but couldn't find the answer i'm looking for.
Constant folding is the process of recognizing and evaluating constant expressions at compile time rather than computing them at runtime.
The Go Programming Language Specification
Constant expressions may contain only constant operands and are evaluated at compile time.
import "math/big"
Package big implements arbitrary-precision arithmetic (big numbers).
Go constant expressions are evaluated at compile time. The Go gc compiler, written in Go, uses package big
to evaluate numeric constant expressions.