In quantitative finance SE, there is a question asking for help calculating an index. If someone writes a program that performs the calculations described in the handbook and shares that program publicly, would it violate the index copywrite? Or does the translation from English to computer program make it ok?
Copyright never protects ideas or processes, it only protects expression: words, images, and sounds, some of which may describe ideas. But when a work is nothing more than a translation of an idea into words, with no independent originality -- when almost anyone would use more or less the same way to describe the idea, then the work will not be protected by copyright at all, as it is not considered an "original work". Computer code that implements an algorithm often falls under this rule.
It is my belief that the code shown in the linked SE thread would fall under this rule, and would not be protected by copyright at all. If this is correct, then anyone may share such a program with no copyright concern.