Squik language features
ajh18 at cornell.edu
Mon Apr 14 19:50:57 UTC 2003
Thanks for your inquiry.
Michael van der Gulik <mikevdg at hetnet.nl> wrote:
> * Will it be fast? Are you going to be compiling to machine code, or
> interpreting? Or both?
I forgot to mention performance but it will be slow (interpreted) until
it includes optimizing dynamic translation (a la Bryce Kampjes' Exupery
compiler or Eliot Miranda's Adaptive Optimizer for Smalltalk written in
> * Will it be secure / modular / sandboxed? You mention Namespaces; does
> that mean that the machine would be safe to run foreign code? Is this a
Security will be achieve through capability discipline, which basically
just requires no globals and objects can only send message to other
objects it has pointers to. Hence my class variable visibility design.
If a behavior is not in your class variables you can't use it. See the
E language (erights.org) and my Shared Smalltalk paper
(http://minnow.cc.gatech.edu/squeak/SharedSmalltalk) for more.
Foreign bytecode will have to be verified to ensure no stack
overflow/underflow then it can be used.
> Also, a more general question. There are no instance variables and you
> can only assign to them by doing #instVarAt:...
> Now, this is a great idea, but will you be making "a := 2." shorthand
> for "myObject #instVarAt: 4 put: 2."?
No, you would use the accessor instead, as in "self a: 2". The
assignment operator (:=) will be reserved for temps only.
> What happens in Squeak? I see instVarAt:put: in class Object, so does
> that mean that ":=" get's turned into a "instVarAt:put:" by the
> compiler? Is ":=" considered to be a message? Much in the same way, is
> accessing an instance variable turned into an "instVarAt:" by the
> compiler? This behaviour would be very handy; you could do useful things
> like adding pre- and post- conditions to instance variable usage by
> overriding these methods.
No, in Squeak, inst var access is compiled directly to special bytecodes
(pushReceiverVariableBytecode and storeAndPopReceiverVariableBytecode).
There is no way to hook into it. If you want a hook always use
accessor methods. Object>>instVarAt:(put:) is just a different way to get at
instance data, but the compiler does not use it.
> p.s. congrats for getting into Georgia Tech!
More information about the Squeak-dev