Loading ...
Sorry, an error occurred while loading the content.

[self-interest] Re: Announcing mySelf

Expand Messages
  • Jecel Assumpcao Jr
    I m back from vacation and only now reading my December email. I m glad to see people having fun with the Self syntax. As you have already found out, ^ and
    Message 1 of 3 , Jan 5, 1999
    • 0 Attachment
      I'm back from vacation and only now reading my December email. I'm
      glad to see people having fun with the Self syntax.

      As you have already found out, '^' and '|' are NOT valid binary
      selectors.

      About expressions in parentheses, in Self 1.0 they WERE parsed as
      method objects, though they were tagged as "inner methods" as
      opposed to the normal "outer methods". So the expression

      3 + ( 4 * 5 )

      would result in the following bytecodes:

      push literal ( | | 4 * 5 )
      push literal 3
      send '+'

      Just as pushing a block does something special (it actually creates
      a block context and pushes that instead), the push inner method
      resulted in pushing the result of evaluating that method.

      This was eliminated in Self 2.0 or 3.0, and I patched my tinySelf0
      parser (in C) to handle this by testing for inner methods that
      had exactly one expression and no slots and "expanding" them so
      that the following bytecodes would now be generated:

      push literal 5
      push literal 4
      send '*'
      push literal 3
      send '+'

      If you write something like

      3 + ( | x=9 | x * 5 )

      then tinySelf0 will generate an inner method, but Self 4.0 will
      complain that inner methods are no longer supported.

      > Hi!
      >
      > I've set up a web page for my first version of ``mySelf┬┤┬┤, my Self parser
      > and simulator written in Smalltalk! If you like, check out
      >
      > http://freeweb.digiweb.com/computers/sma/
      >
      > MySelf works both for VisualWorks Smalltalk and Squeak, however the Squeak
      > port is really crude. As Squeak's syntax unfortunately doesn't conform with
      > the "standard", I had to work around some problems, mainly the fact that
      > "_" isn't a valid character in message names. Therefore, I recommend
      > VisualWorks NC, which is also _much_ faster.

      I'll have a look as soon as I can.

      I have downloaded two very interesting programs. Here are the first
      lines of the README files for them:

      --------------------------
      Ultimardrev-Self is an interpreter of Self 1.0 implemented
      in Smalltalk 2.5 by P.Mulet and F.Rivard in 1991.
      --------------------------
      The PROTOTALK platform
      for the simulation of prototype-based languages.
      --------------------------

      I have never run them as I had no access to a ParcPlace Smalltalk and
      didn't want to port them to some other dialect. It would be interesting
      to see if the would run on the latest version of VW NC. They don't
      seem to be available for FTP, though, so I am wondering if I should
      make them available on my site (contacting the authors to ask them
      about this will probably be a bit complicated).

      > Happy New Year!
      > bye
      > --
      > Stefan Matthias Aust // Are you ready to discover the twilight zone?

      -- Jecel


      ------------------------------------------------------------------------
      eGroup home: http://www.eGroups.com/list/self-interest
      Free Web-based e-mail groups by eGroups.com
    • Stefan Matthias Aust
      ... Then SELF 1.0 had no ( expr ) at all. Everything in () was a new object, however only objects in slot definitions got a self slot. Right? ... Which is
      Message 2 of 3 , Jan 6, 1999
      • 0 Attachment
        >About expressions in parentheses, in Self 1.0 they WERE parsed as
        >method objects, though they were tagged as "inner methods" as
        >opposed to the normal "outer methods".

        Then SELF 1.0 had no '( expr )' at all. Everything in () was a new object,
        however only objects in slot definitions got a 'self' slot. Right?

        >This was eliminated in Self 2.0 or 3.0, and I patched my tinySelf0
        >parser (in C) to handle this by testing for inner methods that
        >had exactly one expression and no slots and "expanding" them so
        >that the following bytecodes would now be generated:

        Which is the same heuristic as I used. However, I dislike this solution
        because I'd prefer one which can be expressed with a context free LL(1)
        grammar.

        >then tinySelf0 will generate an inner method, but Self 4.0 will
        >complain that inner methods are no longer supported.

        But this means, the grammar given in the Self 4.0 programmers reference is
        wrong (or at least ambigious). If I understand this correctly, objects
        with code (aka methods) are only allowed in constant slot definition and
        never in general expressions. This would lead to...

        object --> '(' [object-slot-list] ')'
        method --> '(' [object-slot-list] code ')'
        block --> '[' [block-slot-list] [code] ']'

        (btw, whats the result of the empty block []?)

        receiever --> [primary]
        primary --> 'self' | '(' expression ')' | constant
        constant --> number | string | object | block

        expression --> keyword-message
        and so on... (see my web site for a full grammar)

        unary-slot --> identifier ['*'] '=' method
        binary-slot --> operator [identifier] '=' method
        keyword-slot --> ... '=' method

        data-slot --> identifier ['*'] [('<-' | '=') expression]

        and there's now only a problem to distinguish a constant data-slot and an
        unary-slot. (| a = (3 + 4). |) would actually be a method, not a constant.

        >I have downloaded two very interesting programs. Here are the first
        >lines of the README files for them:

        I'd be interested in the Ultimardrev-Self thing, and might even try to port
        this to VW3 or Squeak, which might be easier.


        bye
        --
        Stefan Matthias Aust // Are you ready to discover the twilight zone?

        ------------------------------------------------------------------------
        eGroup home: http://www.eGroups.com/list/self-interest
        Free Web-based e-mail groups by eGroups.com
      Your message has been successfully submitted and would be delivered to recipients shortly.