Pragma syntax

Jecel Assumpcao Jr jecel at merlintec.com
Fri Aug 18 20:02:20 UTC 2006


I haven't been keeping track of this discussion and haven't looked into
the FFI/pragma/primitives issue at all (so feel free to ignore what
follows), but I would like to make a small comment based on my
experience in trying to simplify programming languages (Smalltalk in
particular). One way to do things is to define a syntax to embed in the
source messages to be sent to the compiler object itself. So something
like

<primitive: 32> blah blue

would cause the expression between < > to be compiled separately and
executed as if it were "thisCompiler primitive: 32". The compiler is
free to do whatever it wants (this is the "object way") and then it can
continuing parsing the rest of the text. Adding methods to Compiler will
automatically extend what it can do without having to mess with the
parser.

Some people would like for Smalltalk to be much more declarative (the
bane of "doIts"!) and this proposal goes in the opposite direction. It
actually has a Forth-like flavor to it. But if you want simplicity, this
is one way to get it.

-- Jecel



More information about the Squeak-dev mailing list