Hacker Newsnew | past | comments | ask | show | jobs | submit | stevegh's commentslogin

Interesting. The hot code reloading functionality in Erlang led me to investigate ruby (my preferred Dev language) a bit more.

You can do a hot code load in Ruby using the Kernel#load() call. It won't alter functionality currently on the call stack, but it will change the functionality of everything not on the call stack. With some sympathetic design, you can achieve hot code loading fo high availability in ruby.


You can use that to replace code by monkey patching

    $ cat hi.rb 
    def method
      puts "hi"
    end
    method
    load("hello.rb")
    method

    $ cat hello.rb 
    def method
      puts "hello"
    end

    $ ruby hi.rb 
    hi
    hello
You must engineer your application to execute the load method and that's it. However I wonder if this is really equivalent to what Erlang does. I remember http://rvirding.blogspot.it/2008/01/virdings-first-rule-of-p...



If you want to know what he is actually talking about, this may help: https://popehat.com/2013/12/06/nock-hoon-etc-for-non-vulcans...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: