From: Bill Kelly Date: 2004-07-02T13:28:13+09:00 Subject: Re: Why I don't use Ruby. From: "TLOlczyk" > Let us as an example look at a program that looks at a directory of > Web pages, and traces through them. If it cannot find a link to a > certain page, then it creates a link on a page in a prescribed manner. > > You've written the program and tested it on a small data set. > Now you want to test it on a large data set. It fails miserably > and you try to debug. > Phase one of the program gets a list of all the files in the directory > ( recursively ). > Phase two is to scan the root files for hrefs. Then scan the files in > the hrefs. Then ... untill there are no more files to scan. > Phase three is to pick some file you didn't reach and create a link to > it. > > So you work on Phase one and get it to run. > Then you work on Phase two. But it takes Phase one > ten minutes to run. So each time you test a fix in phase two > it takes at least ten minutes to run. Although different than saving the whole program image, It's pretty to load/save entire object hierarchies in Ruby... For ex: # A little boilerplate... require 'yaml/store' ystore = YAML::Store.new("my_persistent_data") # At the end of phase one, we'll have our file list, # which we can persist as easily as: ystore.transaction { ystore["filelist"] = phase_one_filelist } # At the beginning of phase two, we can load it: phase_one_filelist = ystore.transaction { ystore["filelist"] } . . . This would allow phase 1 and 2 to be totally separate ruby programs, if you like. Just one possibility... Regards, Bill