codegen: very basic codegeneration for global variables