What gives Smalltalk the ability to do image persistence, and why can't languages like Ruby/Python serialize themselves?

后端 未结 4 1221
青春惊慌失措
青春惊慌失措 2021-02-07 05:13

In smalltalk, you\'re able to save the state of the world into an image file. I assume this has to do with Smalltalk\'s ability to \"serialize\" itself -- that is, objects can p

4条回答
  •  轮回少年
    2021-02-07 05:43

    Crucial difference is that Smalltalk treats Program just as bunch of objects. And IDE is just a bunch of editors editing those objects, so when you save-load image, all your code is there just as when you left off.

    For other languages it could be possible to do so, but I guess there would be more fiddling, depending on how much reflection there is. In most other languages, reflection comes as add-on, or even afterthought, but in Smalltalk it is in the heart of the system.

提交回复
热议问题