Hello list,
my name is Marc Hanisch, I'm from Germany and I recently joined the list. I'm new to GNU Smalltalk but was curious about the language, because every time I heard about cool features of a programming language (like Ruby) they said: this feature came from Smalltalk :-) I'm familiar with C-like languages (C, Java and most of the time PHP but Ruby too) and playing around with GNU Smalltalk is very exciting. At the moment I'm a bit confused about images vs. files. I'm accustomed to work with files with my favorite texteditor in PHP and this works in Smalltalk, too. But what is the advantage of images? And to be honestly, the GNU Smalltalk documentation is not the best and clearly one... So maybe someone can show me the advantages of images or why to use them... Best regards, Marc _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
> At the moment I'm a bit confused about images vs. files. I'm
> accustomed to work with files with my favorite texteditor in PHP and > this works in Smalltalk, too. But what is the advantage of images? I think this post http://gbracha.blogspot.com/2009/10/image-problem.html shows the advantages and disadvantages of images pretty well. In GNU Smalltalk, the image is used mostly as a cache of preloaded packages. It allows very fast startup because all the code is already compiled and converted to objects (instances of Class, CompiledMethod, etc.). See also http://smalltalk.gnu.org/faq/37 which expands a bit on this topic. > And to be honestly, the GNU Smalltalk documentation is not the best > and clearly one... What did you find confusing, exactly? Paolo _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
Hello Paolo,
thank your for the hints... 2010/5/20 Paolo Bonzini <[hidden email]>: >> At the moment I'm a bit confused about images vs. files. I'm >> accustomed to work with files with my favorite texteditor in PHP and >> this works in Smalltalk, too. But what is the advantage of images? > > I think this post > > http://gbracha.blogspot.com/2009/10/image-problem.html > > shows the advantages and disadvantages of images pretty well. > > In GNU Smalltalk, the image is used mostly as a cache of preloaded > packages. It allows very fast startup because all the code is already > compiled and converted to objects (instances of Class, CompiledMethod, > etc.). See also > > http://smalltalk.gnu.org/faq/37 > > which expands a bit on this topic. I'm currently editing my class files with an editor. Implies the use of images, that I have to edit my classes inside of gst? Or can I mix both approaches? > >> And to be honestly, the GNU Smalltalk documentation is not the best >> and clearly one... > > What did you find confusing, exactly? The users guide is somewhat undidactic. There are no words about the differences between the standard and GNU Smalltalk (for example the braces in methods, the different initialisation of instance and class variables (instanceVariableNames, classVariableNames etc)) in the introduction. This makes it hard for new users :-) Therefore the class-reference is fantastic :-D Best regards, Marc _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
On 05/20/2010 10:18 AM, Marc Hanisch wrote:
>> In GNU Smalltalk, the image is used mostly as a cache of preloaded >> packages. It allows very fast startup because all the code is already >> compiled and converted to objects (instances of Class, CompiledMethod, >> etc.). See also >> >> http://smalltalk.gnu.org/faq/37 >> >> which expands a bit on this topic. > > I'm currently editing my class files with an editor. Implies the use > of images, that I have to edit my classes inside of gst? Or can I mix > both approaches? People who edit their classes inside GST will have to answer. :-) But yes, you can in general mix both approaches. The most common way is to make an image with some packages preloaded (e.g. Seaside or Iliad) and then you load your code into it. That's much faster than waiting for GST to reload code from the entire web framework (and dependent packages) everytime. >>> And to be honestly, the GNU Smalltalk documentation is not the best >>> and clearly one... >> >> What did you find confusing, exactly? > > The users guide is somewhat undidactic. There are no words about the > differences between the standard and GNU Smalltalk (for example the > braces in methods, the different initialisation of instance and class > variables (instanceVariableNames, classVariableNames etc)) in the > introduction. This makes it hard for new users :-) Thanks. The tutorial is supposed to be a bit more complete about that, but it's not optimal (and a cross-reference would help). Paolo _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
In reply to this post by Marc Hanisch
On Thu, 20 May 2010 08:16:48 +0200
Marc Hanisch <[hidden email]> wrote: > Hello list, Hello Marc, have you read Canol's book? http://www.canol.info/books/computer_programming_using_gnu_smalltalk/ s. _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
Although the book might answer some other newbie questions of Marc, it does not mention about the image system, yet. Hopefully, second edition will cover more Smalltalk (and GNU Smalltalk, in particular) specific topics like images, packages, VisualGST etc.
Canol Gökel
|
> Although the book might answer some other newbie questions of Marc, it does
> not mention about the image system, yet. Hopefully, second edition will > cover more Smalltalk (and GNU Smalltalk, in particular) specific topics like > images, packages, VisualGST etc. Actually, I think that only three people could answer about how to use images with GST, and that does not include me (which is a good thing, since I cannot be considered omniscient...). That's of course Berto, Nicolas and Sebastien since they used GST in production. All I know is that Berto is using Postgres for his data, while the two Odyssey people are using images and ObjectDumper as their primary persistence strategies. I imagine their handling of images is pretty different, though all three of them are using gst-remote. So if any of you could write a blog post about how to use images for GST apps that would be really great. Paolo _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
Hi guys,
> So if any of you could write a blog post about how to use images for > GST apps that would be really great. Sure, I can do it, but I think our use of images is pretty specific to web applications. I'll try to write more details in a blog post, but the basic idea is that we load all our packages and save the image with a bash script like echo "PackageLoader fileInPackage: '...'. ObjectMemory snapshot: 'foo.im'" | gst This way we can start gst with all our packages very quickly. Then we start the image with loaded packages with gst-remote. We don't use the image itself as persistence, instead we save all our data in binary (using ObjectDumper) or xml format. This means we always have all our data loaded in memory and that we save the entire database each time. We can afford it since we don't have too much data, and for small applications I think it works fine. Of course if you have 40Gb of data, it may not work for you. Another interesting use of images for us, since we have one image and db per website, is to stop gst-remote and make a snapshot (this time with all data loaded) when all sessions expire. Then we would restart them for the next request. We didn't try it in production yet, but our experiments seem quite conclusive. Cheers, Nico _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk signature.asc (205 bytes) Download Attachment |
Free forum by Nabble | Edit this page |