Questions about parsing and orthogonal constructs....

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

Questions about parsing and orthogonal constructs....

gi.joe
Hello everyone. I'm new to Squeak, and I chose to do a research paper for school on it. I have a few questions about the language. My first question is what components in Squeak can be successfully parsed by the compiler without necessarily creating a full program. For example, can a blank method be created? Create variables without using them? etc.

My second question is what constructs in the language are NOT orthogonal. I'm not sure if there is a different term for this, but basically it means what constructs cannot be used within a construct of the same type. For example, can you use a function within a function?

If any help can be provided, I would greatly appreciate it. Some examples and references to the ANSI Smalltalk Reference Manual would be much appreciated as well. I was trying to find the ansers in the ANSI manual haven't had much luck.
Reply | Threaded
Open this post in threaded view
|

Re: Questions about parsing and orthogonal constructs....

Dave Raymer

I would recommend you start with one of the free Smalltalk books accessible from

I would counsel that "Squeak by Example" would be a great place for you start.

The Smalltalk compiler in Squeak can parse empty methods successfully; Smalltalk 
does not have functions; methods are defined relative to an object, and cannot have
methods inside them, but they can have blocks; etc.  Smalltalk is deceptively complex 
in its simplicity.  A Smalltalk grammar is extremely simple, and Smalltalk interpreters
have been developed that are less than 2k lines of C code.

In Smalltalk, everything, and I mean everything is an object; you'll need to do a 
paradigm switch to be able to make the most of the power offered by the Simplicity
in Smalltalk.

regards,

Dave

On Nov 1, 2010, at 10:35 AM, gi.joe wrote:


Hello everyone. I'm new to Squeak, and I chose to do a research paper for
school on it. I have a few questions about the language. My first question
is what components in Squeak can be successfully parsed by the compiler
without necessarily creating a full program. For example, can a blank method
be created? Create variables without using them? etc.

My second question is what constructs in the language are NOT orthogonal.
I'm not sure if there is a different term for this, but basically it means
what constructs cannot be used within a construct of the same type. For
example, can you use a function within a function?

If any help can be provided, I would greatly appreciate it. Some examples
and references to the ANSI Smalltalk Reference Manual would be much
appreciated as well. I was trying to find the ansers in the ANSI manual
haven't had much luck.
--
View this message in context: http://forum.world.st/Questions-about-parsing-and-orthogonal-constructs-tp3022339p3022339.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.




Reply | Threaded
Open this post in threaded view
|

Re: Questions about parsing and orthogonal constructs....

Casey Ransberger-2
In reply to this post by gi.joe
Comments inline

On Nov 1, 2010, at 8:35 AM, "gi.joe" <[hidden email]> wrote:


Hello everyone. I'm new to Squeak, and I chose to do a research paper for
school on it. I have a few questions about the language. My first question
is what components in Squeak can be successfully parsed by the compiler
without necessarily creating a full program. For example, can a blank method
be created? Create variables without using them? etc.
Hard answers. Smalltalk *is* the full program. Your application is a bit like like an extension of Smalltalk. Blank methods are fine; unless you explicitly return a value, the method will happily return self by default. 

My second question is what constructs in the language are NOT orthogonal.
I'm not sure if there is a different term for this, but basically it means
what constructs cannot be used within a construct of the same type. For
example, can you use a function within a function?
Someone said that Smalltalk hasn't got functions, but I don't think that's really the best way to put it. 

Smalltalk "blocks" look a lot like lambdas, and in modern days have full closure semantics. They're also first class objects, so you can stick them in variables and interact with them more or less like anything else. You can nest blocks.

If any help can be provided, I would greatly appreciate it. Some examples
and references to the ANSI Smalltalk Reference Manual would be much
appreciated as well. I was trying to find the ansers in the ANSI manual
haven't had much luck.

Check out the free books mentioned in the other response. I have never looked at the ANSI standard; unless you're trying to do your own standards-compliant implementation, it's probably the wrong book to study, because AFAIK, no popular implementation is standard-compliant. 

I'd strongly recommend reading the "Blue Book" instead (Smalltalk-80: the Language and its Implementation.)

Have fun and point us at your project when the time is right!

--
View this message in context: http://forum.world.st/Questions-about-parsing-and-orthogonal-constructs-tp3022339p3022339.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.



Reply | Threaded
Open this post in threaded view
|

Re: Questions about parsing and orthogonal constructs....

K K Subbu
In reply to this post by gi.joe
On Monday 01 Nov 2010 9:05:43 pm gi.joe wrote:
> My second question is what constructs in the language are NOT orthogonal.
> I'm not sure if there is a different term for this, but basically it means
> what constructs cannot be used within a construct of the same type.
In Smalltalk, every construct (i.e. constructed from primitive objects) is an
object composed from any other object or primitive. But implementations of
Smalltalk do optimize representations for performance. AFAIK, CompiledMethod
is one such object in Squeak. Inspect:
  CompiledMethod someInstance

and contrast that with any other object.

"Blue book", that Casey pointed out in an earlier post, is a must-read for a
project like yours.

Subbu