Do other languages apart from Erlang have the ability to send code to running instances?

StackOverflow https://stackoverflow.com/questions/2185567

  •  25-09-2019
  •  | 
  •  

문제

I just learnt that Erlang can remote load code and modules onto all instances of a cluster by using the "nl" command. Can any other languages do this?

도움이 되었습니까?

해결책

Technically any of the lisp dialects could do it. Since 'code is data' in lisp, passing some code onto a different box and 'eval'-ing it would do the job. SLIME does this to some extent via remote repl using sockets.

다른 팁

You can write a ClassLoader in java similar to the codeloader in erlang. Java ClassLoaders have a lot of isolation, so it can be a bit more complicated (but you could do some nice things with this if you use it to your advantage rather than think of it as the enemy).

ClassLoaders are easy to write, but java doesn't ship with one that does the same kinds of things erlang does. Java also doesn't have the clustering tools erlang does, so it's not particularly surprising.

In theory pure functional languages should have such possibility but till this moment I've heard only about Erlang too.

None that I know, but it should be possible to implement it in dynamic languages such as Python, Perl or Lisp.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top