SmallTalk, Self, etc. used in Virtual Reality 
Author Message
 SmallTalk, Self, etc. used in Virtual Reality

I have just begun my exploration into true OO languages like Smalltalk.
Because the language is more of an environment, isn't it very well
suited for virtual reality projects?  Creating and manipulating objects
without 'halting' the application is so powerful, I can't believe it is
not the most used language.  All I ever do in C++ is 'I wonder if I can
do this' projects, when others languages just 'do it'. : )

Are there any links to virtual reality using SmallTalk?

Thanks,
Mike

P.S. I have to admit that some of the semantics of the language are odd
for the first time user. For example loops, or thing like ^##(var).



Wed, 18 Jun 1902 08:00:00 GMT  
 SmallTalk, Self, etc. used in Virtual Reality
There are some projects around that do it using openGL. I think
Jun may be suited for this.
Another option would be the directX framework for dolphin.
Quote:

>I have just begun my exploration into true OO languages like SmallTalk.
>Because the language is more of an environment, isn't it very well
>suited for virtual reality projects?  Creating and manipulating objects
>without 'halting' the application is so powerful, I can't believe it is
>not the most used language.  All I ever do in C++ is 'I wonder if I can
>do this' projects, when others languages just 'do it'. : )

>Are there any links to virtual reality using SmallTalk?

>Thanks,
>Mike

>P.S. I have to admit that some of the semantics of the language are odd
>for the first time user. For example loops, or thing like ^##(var).



Wed, 18 Jun 1902 08:00:00 GMT  
 SmallTalk, Self, etc. used in Virtual Reality

Quote:

> P.S. I have to admit that some of the semantics of the language are odd
> for the first time user. For example loops, or thing like ^##(var).

That depends on your background.  If you come from a procedural programming
background, you might expect things like loops and conditionals to be built
into the language.  After all, you need them to program, right?

In Smalltalk, we deal with objects and messages.  With that in mind, we
need to look for an object-oriented approach to these things called
"loops", because loop-like constructs are darn handy.

So we have a cute little thing called a Block.  These are little bundles of
code, and guess what?  They're objects, too.  You can stash them in a
variable, evaluate them time and time again, or evaluate them with
different arguments.  I hardly dare say it, but they're almost an
reification (an object-ification) of a function.  They take arguments,
return a value (sometimes), and do things.

To "loop" in Smalltalk, we make a Block out of the code that we want to
repeat.  It would look something like this:

"This is bogus code, but hopefully it helps illustrate a point"
[:arg |
arg doSomething.
myCollection add: arg reversed].

Then, we evaluate that block for every number in an Interval (a range of
numbers). This provides looping functionality.

More powerfully (sometimes), we can evaluate the block for every element in
a collection.  This is the basis of the Collection>>do: message.  Contrast
these two chunks of code:

-----

/*
 * Notice that in this loop, you have to turn around and access the array
 * to get each element.  The example is trivial, but similar things happen
 * in my code all the time.
 */
    char    *string.

    string = "abcd";

    printf("Characters in the string follow:\n\n");

    for ( i=0; i < strlen(string); i++ ) {
        printf("%c\n", string[i];
    }

-----

    "Here's the Smalltalk example."
    "Notice that the block in the loop is evaluated with each
     character as an argument, not just the index of the character."

    |string|
    string := 'abcd'.

    Transcript
        show: 'Characters in the string follow:';
        cr;
        cr.

    string do: [:each |
        Transcript
            nextPut: each;
            cr.].

-----

Cool, huh?

Thus having blocks as a first-class object provides even more power than a
looping construct built in to the language.  Maybe loops look a little
weirder, but you can do some slick stuff with them.  It just takes a while
to wrap your mind around it if you come from a procedural programming
background.

In that example, you're actually looping over a string, not just a range of
numbers.  And that's just the tip of the iceberg, as far as the power of
blocks.  Wait 'til you see some of the _other_ stuff collections can do.

--
Ken Treis / Software Engineer
Fravenic Skreiggser Software Collective

---
"Java and C++ make you think that the new ideas are like the old ones."
 -- Alan Kay, OOPSLA '97



Wed, 18 Jun 1902 08:00:00 GMT  
 SmallTalk, Self, etc. used in Virtual Reality

Quote:

>Are there any links to virtual reality using SmallTalk?

Screenshots and downloads of a couple of 3D games built using Smalltalk are
available at www.creative-computing-inc.com.  Both games require an OpenGL
accelerator (TNT-based cards seem to work well).  The 3D modelers and
framework used to develop the games should be available, in beta form at
least, within the next couple months.

Chris Hayes
Creative Computing



Wed, 18 Jun 1902 08:00:00 GMT  
 SmallTalk, Self, etc. used in Virtual Reality
I downloaded the 2 games on this page and installed them.  Both of them pop
up an error dialog that just says  "No such path".  I looked through the log
file and can't find what path they are looking for.


Quote:

> >Are there any links to virtual reality using SmallTalk?

> Screenshots and downloads of a couple of 3D games built using Smalltalk
are
> available at www.creative-computing-inc.com.  Both games require an OpenGL
> accelerator (TNT-based cards seem to work well).  The 3D modelers and
> framework used to develop the games should be available, in beta form at
> least, within the next couple months.

> Chris Hayes
> Creative Computing



Wed, 18 Jun 1902 08:00:00 GMT  
 SmallTalk, Self, etc. used in Virtual Reality
This is possibly due to a bug in the current build where the program is
looking for a "default" drive and directory (this function is slated to be
removed).  If the files were installed somewhere under "Program files" (the
default!) then this bug is the likely cause of what you're seeing.  Should
be able to get around the problem if you move the install directory out from
under "Program files" and put them in their own directory under the root.
Sorry for the inconvenience.

Chris Hayes

Quote:

>I downloaded the 2 games on this page and installed them.  Both of them pop
>up an error dialog that just says  "No such path".  I looked through the
log
>file and can't find what path they are looking for.




>> >Are there any links to virtual reality using SmallTalk?

>> Screenshots and downloads of a couple of 3D games built using Smalltalk
>are
>> available at www.creative-computing-inc.com.  Both games require an
OpenGL
>> accelerator (TNT-based cards seem to work well).  The 3D modelers and
>> framework used to develop the games should be available, in beta form at
>> least, within the next couple months.

>> Chris Hayes
>> Creative Computing



Wed, 18 Jun 1902 08:00:00 GMT  
 SmallTalk, Self, etc. used in Virtual Reality

Quote:

> I downloaded the 2 games on this page and installed them.  Both of them pop
> up an error dialog that just says  "No such path".  I looked through the log
> file and can't find what path they are looking for.

You have to install them in c:\ (That worked for me).

Tom

--
"It's not what you don't know that kills you, ... it's what you know that ain't
so." - Mr Thompkins



Wed, 18 Jun 1902 08:00:00 GMT  
 SmallTalk, Self, etc. used in Virtual Reality
You might like my renderer, written in python and OpenGL. Luciano
Notarfrancesco is porting it to Squeak. Check the Squeak mailing list
for his address. If you're willing to try Python mail me.

sr

Sent via Deja.com http://www.deja.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 SmallTalk, Self, etc. used in Virtual Reality

Quote:

> I have just begun my exploration into true OO languages like
SmallTalk.
> Because the language is more of an environment, isn't it very well
> suited for virtual reality projects?  Creating and manipulating
objects
> without 'halting' the application is so powerful, I can't believe it
is
> not the most used language.  All I ever do in C++ is 'I wonder if I
can
> do this' projects, when others languages just 'do it'. : )

> Are there any links to virtual reality using SmallTalk?

You should try the 3D scripting system Alice, which is built into
Squeak/Smalltalk. (originally from Python)  This runs on a 3-D graphics
engine in Squeak called Balloon-3D.

To try it, simply download Squeak 2.5 from http://squeak.org.  When
running Squeak, try using the "Play With Me - 7" window.

Quote:
> Thanks,
> Mike

> P.S. I have to admit that some of the semantics of the language are
odd
> for the first time user. For example loops,

Loops aren't really *that* much different from something like C/Java, if
you want to stick to "for" or "while" loops:

C:
for (i=1; i<=5; i++) {
     z = z + i;

Quote:
}

Smalltalk:
1 to: 5 do: [:i |
     z := z + i.
]

But Smalltalk also gives you the do:, select:, collect:, and detect:
block operators.  These take a little getting used to, but you'll find
that they are *much* nicer to use than the "for" loops you would have to
use in other languages to do the equivalent.

Quote:
> or thing like ^##(var).

Not sure what you mean here, I've never used this exact construct in my
years of programming with Smalltalk.  Yes, "^" is used in place of
"return" in C, which doesn't seem like a big deal.

- Doug Way
  EAI/Transom Technologies, Ann Arbor, MI
  http://www.transom.com

Sent via Deja.com http://www.deja.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 SmallTalk, Self, etc. used in Virtual Reality
The only problem for me is that it hinders readability.  I know you get used to
it, but it is just not as clear as other languages.  Maybe a little rearranging
like "if ( expression ) isTrue: [ ]", where "if" is a 'test' object, and
isTrue: is called if expression is true?  You can't beat readability of some
higher level languages such as "for each object in collection".  Are there any
"pure" OO languages that try to achieve this form of expression?

Also, are there any problems with people misusing #= and similar operator
messages like *++'s operator overloading?  For example "mydata * mydata2" where
you could perform anything you want, but is not very clear what is going on.

P.S. to Chris Hayes: I had downloaded CoolPool a few weeks before, didn't even
realize it was in st.  Those are great examples!

Mike

Quote:


> > P.S. I have to admit that some of the semantics of the language are odd
> > for the first time user. For example loops, or thing like ^##(var).

> That depends on your background.  If you come from a procedural programming
> background, you might expect things like loops and conditionals to be built
> into the language.  After all, you need them to program, right?

> In Smalltalk, we deal with objects and messages.  With that in mind, we
> need to look for an object-oriented approach to these things called
> "loops", because loop-like constructs are darn handy.

> So we have a cute little thing called a Block.  These are little bundles of
> code, and guess what?  They're objects, too.  You can stash them in a
> variable, evaluate them time and time again, or evaluate them with
> different arguments.  I hardly dare say it, but they're almost an
> reification (an object-ification) of a function.  They take arguments,
> return a value (sometimes), and do things.

> To "loop" in Smalltalk, we make a Block out of the code that we want to
> repeat.  It would look something like this:

> "This is bogus code, but hopefully it helps illustrate a point"
> [:arg |
> arg doSomething.
> myCollection add: arg reversed].

> Then, we evaluate that block for every number in an Interval (a range of
> numbers). This provides looping functionality.

> More powerfully (sometimes), we can evaluate the block for every element in
> a collection.  This is the basis of the Collection>>do: message.  Contrast
> these two chunks of code:

> -----

> /*
>  * Notice that in this loop, you have to turn around and access the array
>  * to get each element.  The example is trivial, but similar things happen
>  * in my code all the time.
>  */
>     char    *string.

>     string = "abcd";

>     printf("Characters in the string follow:\n\n");

>     for ( i=0; i < strlen(string); i++ ) {
>         printf("%c\n", string[i];
>     }

> -----

>     "Here's the Smalltalk example."
>     "Notice that the block in the loop is evaluated with each
>      character as an argument, not just the index of the character."

>     |string|
>     string := 'abcd'.

>     Transcript
>         show: 'Characters in the string follow:';
>         cr;
>         cr.

>     string do: [:each |
>         Transcript
>             nextPut: each;
>             cr.].

> -----

> Cool, huh?

> Thus having blocks as a first-class object provides even more power than a
> looping construct built in to the language.  Maybe loops look a little
> weirder, but you can do some slick stuff with them.  It just takes a while
> to wrap your mind around it if you come from a procedural programming
> background.

> In that example, you're actually looping over a string, not just a range of
> numbers.  And that's just the tip of the iceberg, as far as the power of
> blocks.  Wait 'til you see some of the _other_ stuff collections can do.

> --
> Ken Treis / Software Engineer
> Fravenic Skreiggser Software Collective

> ---
> "Java and C++ make you think that the new ideas are like the old ones."
>  -- Alan Kay, OOPSLA '97



Wed, 18 Jun 1902 08:00:00 GMT  
 SmallTalk, Self, etc. used in Virtual Reality

Quote:

> The only problem for me is that it hinders readability.  I know you get used to
> it, but it is just not as clear as other languages.  Maybe a little rearranging
> like "if ( expression ) isTrue: [ ]", where "if" is a 'test' object, and
> isTrue: is called if expression is true?  You can't beat readability of some
> higher level languages such as "for each object in collection".  Are there any
> "pure" OO languages that try to achieve this form of expression?

> Also, are there any problems with people misusing #= and similar operator
> messages like *++'s operator overloading?  For example "mydata * mydata2" where
> you could perform anything you want, but is not very clear what is going on.

> P.S. to Chris Hayes: I had downloaded CoolPool a few weeks before, didn't even
> realize it was in st.  Those are great examples!

Mike, have you ever studied another foreign language?
I am asking because I think you would be able to accept the difference through a parallel.
computer languages, just like human languages, are different.
for example, some languages put the adjective after the noun, so an english "the red ball" would become "the ball red". very odd? not really. not if you "think" in the other language.

it's the same with reading/writing Smalltalk you got to switch to think the Smalltalk way, which, as many would claim, is the object way.
as Ken pointed out, Smalltalk has taken the approach that the Smalltalk universe is composed of objects and objects only. and the only conversation going on is among these objects, which communicate via messages (which in turn are objects, ad nauseam).

the Smalltalk implementors went through a great deal to hide from the user/developer that there is an actual Turing machine underneath it all, and gave us a simple, concise, and consistent language/environment.

just like with this little universe of ours, sometime in the past (maybe?) God has created it all, but there are no traces left behind. same with the Smalltalk environment; nowhere there are "sparkles" of divine intervention such as the implicit presence of main() in all C derived languages. it is objects all the way. I think you can recognize just that; that the language constructs such as for loops and if-then-else, are a carry-over from procedural C. there presence in C++, Java, and the like is (among other carry-overs) responsible for both their appeal and demise (at least in so far as to the repercussions of object impurity in an object world.)

so, when in Rome, do as the Romans, and when using Smalltalk, think objects ...

regards,
Benny Sadeh



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Virtual Reality using Smalltalk

2. virtual REALITY - more REALITY

3. Virtual Schooling a Virtual Reality?

4. Virtual Schooling a Virtual Reality?

5. Virtual Reality Programming

6. Virtual Reality

7. virtual reality type app, help!

8. My Virtual Reality system

9. CD-ROM - VRML lion - a Virtual Reality programmers resource

10. Virtual Reality Assistantship

11. TUTORIALS: automated graphics, virtual reality, visual languages

 

 
Powered by phpBB® Forum Software