Pig Scripting allows Pig to be used for iterative algorithms and user defined functions by embedding Pig within a scripting language. This allows transitive closure, an iterative process, to be computed with one file using Python functions as UDFs and Python variables in Pig scripts, rather than requiring seven files and Java UDFs as plain Pig would.