Very Basic Squeak information

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Very Basic Squeak information

Eric Ching
Hi, I am looking for some very (super newb) basic information about squeak.  
Here are my questions:

- Where does the source code go?  I used the workspace window to test the
objects I created (and others), but where do I put the main program logic so
that I can execute the program at will?  Just use workspace window like I
was doing? Are there other methods?

- Is there such a thing as command line squeak?  Such that I can create my
objects, then put the basic program logic in a file and fire it off from the
command line?

I feel as though I am missing something essential that was not made obvious
from the documentation (or I just plain missed it).  How do you distribute a
squeak program?  Do you always have to use the IDE environment to run the
programs you create?

What is the difference between the VM and the main GUI environment download?

I understand the concept of creating objects and passing messages to the
objects, I am just fumbling for the thing that glues this all
together....like a main class in Java, for example.

If someone could point me in the direction of those answers, I'd greatly
appreciate it.

Thanks in advance,
Eric Ching

_________________________________________________________________
All-in-one security and maintenance for your PC.  Get a free 90-day trial!
http://clk.atdmt.com/MSN/go/msnnkwlo0050000002msn/direct/01/?href=http://clk.atdmt.com/MSN/go/msnnkwlo0050000001msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Very Basic Squeak information

Giuseppe Luigi Punzi
I think other people with better english like mine can explain this
better than me but I will try because I had the same doubts few months ago.

Eric Ching escribió:
> Hi, I am looking for some very (super newb) basic information about
> squeak.  Here are my questions:
>
> - Where does the source code go?  
The code "lives" in the image. You only need to extract it if you want
to put the code in other image or load code from other people for example.

> I used the workspace window to test the objects I created (and
> others), but where do I put the main program logic so that I can
> execute the program at will?  Just use workspace window like I was
> doing? Are there other methods?

If you open a Class browser (ALT+B, or World Menu>Open>Class Browser)
you can view all the packages installed in this image with their
clasess/objects. The main program logic is simple the new method of an
instance.

See how the language works, the documentation is not out there, is
inside the image.

> - Is there such a thing as command line squeak?  Such that I can
> create my objects, then put the basic program logic in a file and fire
> it off from the command line?

No to comand line squeak like python for example. All may be used inside
the image. You can, fileIn code to your image from a file.

>
> I feel as though I am missing something essential that was not made
> obvious from the documentation (or I just plain missed it).  How do
> you distribute a squeak program?  Do you always have to use the IDE
> environment to run the programs you create?

You can distribute programs in repositories (like squeakmap,
monticello). Packages thath are something like a zip file to install the
application inside de image. But always needs an image (like Java needs
a VM), but in squeak, all lives inside the image. Think it like is an
OS. Inside an image of squeak there are mail clients, VNC server and
client, HTTP server, web explorer etc...etc.....

Yes, the IDE (as you name it) is for end users too. But you can lock the
develop facilities
http://map.squeak.org/package/0c6d3bda-adbb-496a-ae84-8d4c145d14b5

> What is the difference between the VM and the main GUI environment
> download?

The squeak.exe (or equivalent in other OS's) starts an image with all
the objects (included the VM).

>
> I understand the concept of creating objects and passing messages to
> the objects, I am just fumbling for the thing that glues this all
> together....like a main class in Java, for example.

The problem is thath you are thinking like others languages. The cycle
Edit, Compile, Run does'nt exists in Smalltalk. All are live Objects.

You are confused, I'm sure, because I had the same doubts and problems
to understand all of this. Only need to read some documentation, and,
never will go out :D

>
> If someone could point me in the direction of those answers, I'd
> greatly appreciate it.
>
Well, my english is very very bad, and I don't know to explain to me better.

I will give you some useful links to understand all of this, you will
need it.

Squeak on Wikipedia (must read): http://en.wikipedia.org/wiki/Squeak
Free Books (some books about smalltalk. Some are old, but in smalltalk,
the time don't run because the important thing are the OO think), I
recommend Smalltalk by Example, very good book.
http://www.iam.unibe.ch/~ducasse/FreeBooks.html

http://squeak.org/Documentation/

Of course, this list, and squeak-dev list.

But, think in this:
http://squeak.org/Documentation/

And think in this:
"Empty your mind, be formless. Shapeless, like water. If you put water
into a cup, it becomes the cup. You put water into a bottle and it
becomes the bottle. You put it in a teapot it becomes the teapot. Now,
water can flow or it can crash. Be water my friend." Bruce Lee

Give you a try to smalltalk. It's a little dificult to understand at
beginning because is diferent to others languages, but, since I
discovered Smalltalk, I don't want nothing more.

--
Giuseppe Luigi Punzi
Linux User: #370919
Skype: glpunzi
http://www.lordzealon.com

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Very Basic Squeak information

Ralph Johnson
In reply to this post by Eric Ching
> - Where does the source code go?  I used the workspace window to test the
> objects I created (and others), but where do I put the main program logic so
> that I can execute the program at will?  Just use workspace window like I
> was doing? Are there other methods?

You should use the browser to define and edit classes.  Perhaps this
is what you mean by "workspace" though in Smalltalk the workspace is
just a text editor that lets you evaluate expressions and so create
objects.  If you are looking at class definitions then the tool is
called the browser, and it is where you should start.

There is no main program in Smalltalk.  Once you understand this, you
will realize it is the right way to think about OO programming and
wonder why other langauges don't work this way, but it is a shock to
everybody when they encounter it for the first time.

Smalltalk is just objects.  There are class definitions, but no
programs.  When you look at classes in the browser, you are looking at
the code that is currently running.  It isn't a library in the sense
of code that you can decide to include in your program, it is already
in the image.  The image is all the objects that live in your world,
and some of those objects are classes and methods.  The browser lets
you examine and change them.

> - Is there such a thing as command line squeak?  Such that I can create my
> objects, then put the basic program logic in a file and fire it off from the
> command line?

Sort of.  You can create a specialized image that you can execute from
the command line.  But it isn't a text file.

> I feel as though I am missing something essential that was not made obvious
> from the documentation (or I just plain missed it).  How do you distribute a
> squeak program?  Do you always have to use the IDE environment to run the
> programs you create?

You distribute either source or images.  An image is the equivalent of
a binary form of a program.  Squeak makes it easy to distribute
source, but it is harder to distribute binaries, at least for
beginners.   Like many things, "it is easy if you know how".  Squeak
is optimized for developing programs, not for distributing them, but
obviously people who develop programs want to distribute them, too.  I
usually tell people to focus on learning how to develop programs and
by the time they know enough Smalltalk to do that, it won't be hard to
learn how to distribute them.

> What is the difference between the VM and the main GUI environment download?

The VM is a platform-specific program that runs the image.  The "main
GUI environment download" is the image.  It is portable and has most
of the complexity.  Most people don't think much about the VM and just
worry about the image.  There are a few people who make VMs for the
rest of us.

-Ralph Johnson
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Very Basic Squeak information

Göran Krampe
Hi!

"Ralph Johnson" <[hidden email]> wrote:
> > - Is there such a thing as command line squeak?  Such that I can create my
> > objects, then put the basic program logic in a file and fire it off from the
> > command line?
>
> Sort of.  You can create a specialized image that you can execute from
> the command line.  But it isn't a text file.

Yes, the image is like a "snapshot" of RAM with live objects in it. So
an image is not the same thing as for example a jar-file in the Java
world which is just a bunch of class definitions - not objects.

BUT... you can still start the Squeak VM with an image AND a "script"
file fed into it on the command line. The VM then starts the image which
in turn has standard mechanisms to examine the command line starting it,
extracting arguments and possible opening, compiling and executing
Smalltalk statements found in a file given as a URI on the command line.

regards, Göran
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Image vs. source code (was Re: Very Basic Squeak information)

Bert Freudenberg
On Nov 20, 2006, at 23:13 , [hidden email] wrote:
> Yes, the image is like a "snapshot" of RAM with live objects in it. So
> an image is not the same thing as for example a jar-file in the Java
> world which is just a bunch of class definitions - not objects.

That's a thing you have to deeply understand. In all object-oriented  
systems that are *not* image-based (which is the huge majority), you  
always start at the Big Bang - every time you run the program, it  
defines classes and creates instances until it can finally start  
servicing the user. Not so in Smalltalk - we make a snapshot of all  
the object instances that are already fully initialized and save it  
to disk. Running that image again just resumes execution wherever it  
was frozen.

Indeed, the last time objects were created "from scratch" in Squeak  
was like 30 years ago! From then, it's a continuous creation and  
destruction of objects inside the system, snapshotted to disk from  
time to time and passed to other people.

The objects in the image are the essence of Squeak, source code is  
just a temporary artifact. You cannot recreate a Squeak image from  
source-code alone, because in source-code only a few selected kinds  
of objects are preserved. Source-code pretty much is just a textual  
serialization of all instances of ClassDescription and its subclasses.

- Bert -



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Image vs. source code (was Re: Very Basic Squeak information)

Stephen Austin-3
On 11/21/06, Bert Freudenberg <[hidden email]> wrote:

> That's a thing you have to deeply understand. In all object-oriented
> systems that are *not* image-based (which is the huge majority)...

Just curious - can you name any others which are image-based in the
same way as Smalltalk/Squeak?

Steve
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Image vs. source code (was Re: Very Basic Squeak information)

David Douthitt
Stephen Austin wrote:
> On 11/21/06, Bert Freudenberg <[hidden email]> wrote:
>
>> That's a thing you have to deeply understand. In all object-oriented
>> systems that are *not* image-based (which is the huge majority)...
>
> Just curious - can you name any others which are image-based in the
> same way as Smalltalk/Squeak?

How about Common LISP (with CLOS) and FORTH for two?  FORTH isn't OOP,
but at least one author described how an OOP FORTH could be done (Dick
Pountain).  FORTH doesn't save "images" as much as they utilize the
source code model: start up with the core, and load extensions from
source.  Other than that, the model is the same.

This "image-based" idea is what makes FORTHers - or LISPers - or
Smalltalkers roll their eyes and sigh heavily (figuratively
speaking!!) when someone says: "Yes, but how do I save JUST MY PROGRAM
into an executable?"

In all three languages, one works in a complete environment, and
"saving a program" either means saving the source code to be read in
or saving the environment image.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re[2]: Image vs. source code (was Re: Very Basic Squeak information)

Herbert König
Hello David,


DD> How about Common LISP (with CLOS) and FORTH for two?  FORTH isn't OOP,
DD> but at least one author described how an OOP FORTH could be done (Dick
DD> Pountain).  FORTH doesn't save "images" as much as they utilize the

it's long ago, but IIRC save in Forth actually saved the image and you
had to come up with something special to save the sources in files.

Source lay in virtual memory (180kB floppy disk) files were a
refinement which some argued against. Later in a commercial Forth for
IBM PC building an application exactly meant to save the image and
hook the word which was your app's entry into the startup code.

And another similarity to squeak: that Forth was written in Forth to
create Assembler source that built the image by using MS
macro-assembler.



Cheers,


Herbert                            mailto:[hidden email]

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Image vs. source code (was Re: Very Basic Squeak information)

Tyler Sperry-2
In reply to this post by David Douthitt
David Douthitt wrote:
> How about Common LISP (with CLOS) and FORTH for two?  FORTH isn't OOP,
> but at least one author described how an OOP FORTH could be done (Dick
> Pountain).  FORTH doesn't save "images" as much as they utilize the
> source code model: start up with the core, and load extensions from
> source.  Other than that, the model is the same.
>
Well, as you say, Forth isn't object-based and the common communication
mechanism is source code, so I don't see a lot of similarity with
Smalltalk images. It's certainly true that it's common for developers to
save the state of their dictionaries (ie, compiled code) as a
convenience, but that's about it.

> This "image-based" idea is what makes FORTHers - or LISPers - or
> Smalltalkers roll their eyes and sigh heavily (figuratively
> speaking!!) when someone says: "Yes, but how do I save JUST MY PROGRAM
> into an executable?"
>

In my experience, most Forth systems have some set of words like TURNKEY
that create a "sealed" application where the user isn't presented with
the normal Forth "environment" (ie, the interpreter prompt), and for at
least the last decade I think they've offered optimizations that strip
unused words from the dictionary for application deployment. I think for
the equivalent functionality you'd be looking at something like Dolphin
Smalltalk rather than Squeak -- but perhaps someone here will point out
the Squeakish way of creating "standalone" (in appearance, at least)
applications.

Forth, Lisp, and Smalltalk are all intensely interactive languages and
all seem designed in a way to make it easy to "open the hood" and see
how the innards are working. I can't speak to CLOS, but in my limited
experience Smalltalk was unique for its time in presenting the developer
with browsers and making their use such an important part of normal
development. I don't think there's anything similar in Forth.

Tyler


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Image vs. source code (was Re: Very Basic Squeak information)

Andrew Burton-2
Tyler Sperry wrote:
> -- but perhaps someone here will point out
> the Squeakish way of creating "standalone" (in appearance, at least)
> applications.

I hope someone will.  I have no burning desire to create a "stand alone"
Squeak application, but it would still be interesting to know.

This is a great thread, both educational and kind of nostalgic.  It
reminds me of the shouting match I started on comp.lang.lisp asking how
you passed command line arguments to a CLISP program. :)


--
Andrew Burton
[hidden email]
http://utilitarian.us - A Guide to Esoteric Technology in Paragon City
http://jarodrussell.livejournal.com/ - Take a guess. ;)
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Image vs. source code (was Re: Very Basic Squeak information)

Brad Fuller
Andrew Burton wrote:

> Tyler Sperry wrote:
>
>> -- but perhaps someone here will point out the Squeakish way of
>> creating "standalone" (in appearance, at least) applications.
>
>
> I hope someone will.  

Search this mailing list. I and others recently posted documentation links.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Image vs. source code (was Re: Very Basic Squeak information)

Andrew Burton-2
Brad Fuller wrote:
> Search this mailing list. I and others recently posted documentation links.

Will do.  Thanks!

--
Andrew Burton
[hidden email]
http://utilitarian.us - A Guide to Esoteric Technology in Paragon City
http://jarodrussell.livejournal.com/ - Take a guess. ;)
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Stand alone application (was: Image vs. source code)

Bert Freudenberg
In reply to this post by Andrew Burton-2
On Nov 23, 2006, at 3:22 , Andrew Burton wrote:

> Tyler Sperry wrote:
>> -- but perhaps someone here will point out the Squeakish way of  
>> creating "standalone" (in appearance, at least) applications.
>
> I hope someone will.  I have no burning desire to create a "stand  
> alone" Squeak application, but it would still be interesting to know.

Also, you might want to have a look at Sophie:

        http://www.sophieproject.org/download/install

It uses the same cross-platform directory layout I developed for  
Plopp. In contrast to Plopp, Sophie is not locked-down, because it is  
still in heavy development, but you should get the idea of how a  
double-clickable Squeak app looks like.

<shamelessplug>
        Actually, you could also buy Plopp, it's just 15 Euros plus up to 13  
Euros world-wide shipping

                http://www.amazon.de/gp/product/3898353664

        Guess you must find someone to read the German on that website to  
you ;-)
</shamelessplug>

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Stand alone application

Offray Vladimir Luna Cárdenas
Hi,

Bert Freudenberg escribió:

> On Nov 23, 2006, at 3:22 , Andrew Burton wrote:
>
>> Tyler Sperry wrote:
>>> -- but perhaps someone here will point out the Squeakish way of
>>> creating "standalone" (in appearance, at least) applications.
>>
>> I hope someone will.  I have no burning desire to create a "stand
>> alone" Squeak application, but it would still be interesting to know.
>
> Also, you might want to have a look at Sophie:
>
>     http://www.sophieproject.org/download/install
>
> It uses the same cross-platform directory layout I developed for
> Plopp. In contrast to Plopp, Sophie is not locked-down, because it is
> still in heavy development, but you should get the idea of how a
> double-clickable Squeak app looks like.
>


Talking about Sophie, I have been tried to run Sophie in a Linux box for
a while without any success (well from the first try to the last one
things are better, but still not running). I asked in the forums and
there is not answer. I tried emulation with wine and get a little more,
but still not working. I'm wondering why multi platform apps made on
Squeak seems to run better on Mac that in anything else. ¿It's related
with the platform used by developers (which seems to be Mac) or the
particular dependencies of this app?

Cheers,

Offray
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Stand alone application

Bert Freudenberg
On Nov 23, 2006, at 12:14 , Offray Vladimir Luna Cárdenas wrote:

> Hi,
>
> Bert Freudenberg escribió:
>> On Nov 23, 2006, at 3:22 , Andrew Burton wrote:
>>
>>> Tyler Sperry wrote:
>>>> -- but perhaps someone here will point out the Squeakish way of  
>>>> creating "standalone" (in appearance, at least) applications.
>>>
>>> I hope someone will.  I have no burning desire to create a "stand  
>>> alone" Squeak application, but it would still be interesting to  
>>> know.
>>
>> Also, you might want to have a look at Sophie:
>>
>>     http://www.sophieproject.org/download/install
>>
>> It uses the same cross-platform directory layout I developed for  
>> Plopp. In contrast to Plopp, Sophie is not locked-down, because it  
>> is still in heavy development, but you should get the idea of how  
>> a double-clickable Squeak app looks like.
>
> Talking about Sophie, I have been tried to run Sophie in a Linux  
> box for a while without any success (well from the first try to the  
> last one things are better, but still not running). I asked in the  
> forums and there is not answer.

Actually, your question was answered on the mailing list. The  
installation instructions were wrong for Linux - maybe you just try  
again, the instructions have been corrected.

> I tried emulation with wine and get a little more, but still not  
> working. I'm wondering why multi platform apps made on Squeak seems  
> to run better on Mac that in anything else. ¿It's related with the  
> platform used by developers (which seems to be Mac) or the  
> particular dependencies of this app?

Well, one of the problems is that there is no "Linux" per se. It's a  
moving target, there is a lot of variety between distributions. Even  
if you restrict it to the ix86 platform and ignore all the other  
architectures, there are few things that you can really rely on. In  
particular as soon as it comes to Multimedia. For example, Plopp does  
run on Linux, too - but we can not guarantee it.

In Sophie's case, they use a few new plugins, which might not yet be  
available on Linux. There are some Mac developers, some Windows  
developers, but only one Linux developer AFAIK. The target market for  
Sophie is non-developers, and looking at market share you have to  
support Win and Mac before everything else. That said, contributions  
from Linux developers would certainly be welcome.

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Image vs. source code (was Re: Very Basic Squeak information)

Oscar Nierstrasz
In reply to this post by David Douthitt

Don't forget Self.

http://research.sun.com/self/

http://en.wikipedia.org/wiki/Self_programming_language

Oscar

On Nov 22, 2006, at 1:10, David Douthitt wrote:

> Stephen Austin wrote:
>> On 11/21/06, Bert Freudenberg <[hidden email]> wrote:
>>> That's a thing you have to deeply understand. In all object-oriented
>>> systems that are *not* image-based (which is the huge majority)...
>> Just curious - can you name any others which are image-based in the
>> same way as Smalltalk/Squeak?
>
> How about Common LISP (with CLOS) and FORTH for two?  FORTH isn't  
> OOP, but at least one author described how an OOP FORTH could be  
> done (Dick Pountain).  FORTH doesn't save "images" as much as they  
> utilize the source code model: start up with the core, and load  
> extensions from source.  Other than that, the model is the same.

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners