implement most of the linker in ruby