I recently tried to declare a constant named PIXEL in a fragment shader, and it failed with a syntax error. It took me a while to figure out what was the problem: in wrap_Graphics.lua, there's
When defined this way, it still serves its purpose, but it can also still be used as an identfier in shader code without getting syntax errors. Same for VERTEX.
Reasoning is, it is convention to write constants in UPPER CASE, and PIXEL and VERTEX are somewhat likely candidates to be used in shaders. The syntax error is confusing at first. This minor redefinition would solve this, and it doesn't seem to have any downsides.
I'm referring to the conventions published in K&R's The C Programming Language, which are widely accepted for basically all C-like languages for many, many years. What convention do you mean?
Another accepted convention is to prefix your implementation defined stuff with underscores instead of polluting the global namespace with common identifiers.
Defining the PIXEL and VERTEX macros the way I have proposed has no downsides and it prevents syntax errors that can't be explained by reading the language specifications. The principle of least surprise applies.