This document highlights guidelines for writing clean, optimized, and secure TechScript code.
const over mutable variables for values that never change during program execution (e.g. settings, ports, limits).# Good
const SERVER_PORT = 8080
# Bad (mutable variable unnecessarily)
server_port = 8080
Minimize shadowing of variables from outer scopes to improve code readability:
# Confusing
x = 10
do calc()
x = 5 # Shadows outer x
send x
end
Keep scope footprints narrow by declaring variables only when they are needed.
ffi module only when necessary. FFI calls bypass the VM’s memory manager, exposing programs to crashes.