I usually use this link to look into ruby - https://github.com/ruby/ruby/blob/trunk/ruby.c#L1843
but goal is same. It is to used to set $0 and also backtrace log ( this way irb set name to "irb" so backtrace contain it ).