<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2743.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi all,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I have been working on my own
computerlanguage<BR>based on smalltalk (and little bit of everything).<BR>I see
much of the discussions here related to the same problems I have been
solving.<BR>At least I hope I solved them..</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>-------Proposal 1 use modules to manage
behaviour-------<BR>1) Managing complex behaviour would be more structured by
using modules..<BR>All related methods of different classes can be defined
within one module.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Modules can really helps on the long term
development.<BR>Modules are first defined using a special fileIn/fileOut format,
to enable incremental separation of the image.</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>------Proposal 2 use text to define modules and classes---------<BR>2)
defining modules and classes</DIV>
<DIV> </DIV>
<DIV>First I would like to start to introduce a script which defines the modules
and classes..</DIV>
<DIV> </DIV>
<DIV>MyFirstModule := << Module |</DIV>
<DIV> </DIV>
<DIV> MyPoint := << Class
|<BR> varX.
varY.<BR>
#x<BR> ^varX.</DIV>
<DIV> </DIV>
<DIV>
#y<BR> ^varY</DIV>
<DIV> </DIV>
<DIV>
#x:x<BR> varX:= x.</DIV>
<DIV> </DIV>
<DIV>
#y:y<BR> varY:= y.</DIV>
<DIV> </DIV>
<DIV> #<BR> >></DIV>
<DIV> </DIV>
<DIV> MyStorage:= << Class |<BR>
#storeInto:File<BR>
#loadFrom:File<BR> #<BR>
>><BR>>>.</DIV>
<DIV> </DIV>
<DIV>This far it is simple..<BR>I use a construct definition << >>
to define anything in my system..<BR>There are many different constructs
possible:<BR>Module, Class but also Application or DeviceDriver or
Primitive.<BR>These could all be meta-constructions.</DIV>
<DIV> </DIV>
<DIV>You probably have some nice idea's too :-)</DIV>
<DIV> </DIV>
<DIV>------Proposal 3a define inheritance by including behaviour---------<BR>3)
defining imports and inheritance</DIV>
<DIV> </DIV>
<DIV>The Classname<<>> construct defines extension within current
construct,<BR>i.e. inheritance...</DIV>
<DIV> </DIV>
<DIV>The identifier<<>> construct defines a local extension. Is
currently used for imports.</DIV>
<DIV> </DIV>
<DIV><BR>MySecondModule:= << Module |<BR>
import<<<BR> MyFirstModule.<BR>
>>.<BR> version:= 3;</DIV>
<DIV> </DIV>
<DIV> MyStoredPoint:= <<Class|<BR>
MyPoint<<<BR> >>.<BR>
MyStorage<< <BR>
#storeInto:File<BR> File
writeVar:varX.<BR> File
writeVar:varY.<BR>
#loadFrom:File<BR> varX:= File
readVar.<BR> varY:= File
readVar.<BR> #<BR>
>>.<BR> >>.<BR> <BR>>>.</DIV>
<DIV> </DIV>
<DIV>Some may notice that:<BR>MyFirstModule<< >> could also be an
import definition..</DIV>
<DIV> </DIV>
<DIV><BR>------Proposal 3b define inheritance by extending
behaviour---------</DIV>
<DIV> </DIV>
<DIV>The class can als be extended using a similar syntax</DIV>
<DIV> </DIV>
<DIV>MyThirdModule:= << Module |<BR> import<<
<BR> Math. MyFirstModule. <BR> >><BR>
MyPoint:<< "this is an extension"<BR> <BR>
MyStorage<< "I inherit from MyStorage
again"<BR>
#storeInto:File<BR> File
writeVar:varX.<BR> File
writeVar:varY.<BR>
#loadFrom:File<BR> varX:= File
readVar.<BR> varY:= File
readVar.<BR> #<BR>
>>.<BR> <BR> >><BR>
Integer:<<<BR> #@ y<BR> |
newPoint |<BR> newPoint:= MyStoredPoint
new.<BR> newPoint x:self;
y:y.<BR> ^newPoint.<BR>
#<BR> >><BR>>></DIV>
<DIV> </DIV>
<DIV><BR>------Proposal 4 change grammar a bit for some
typedefinitions---------</DIV>
<DIV> </DIV>
<DIV>I'll use the example below</DIV>
<DIV> </DIV>
<DIV>//In my own language I use a slightly different sytnax which enables
typedefinitions..<BR>//And even parametric types.<BR>//I'll just add the
different syntax for the good of discussion..<BR>//I wonder if anyone here
really cares about what characters are used for certain definitions,<BR>//as
long they are usefull..<BR>//<BR>//<BR>// MyPoint:=
<<Class|<BR>// varX; <BR>//
varY; <BR>// "x":={ varX; }; #methods
are defined as blocks<BR>// "x:" := { ?x | varX:= x;
}; # ? defines input, ! defines output<BR>//
<BR>// "y":={ !result| result:= varY; };
<BR>// "y:":= { ?y | varY:= y;
};<BR>//<BR>// varZ: Double,Integer; # type
definitions.. <BR>// # anything
that implements Double or Integer can work<BR>// count::
Integer32 =0; # strict type definition and
initialisation<BR>//<BR>// # I add a z here to show some more
options<BR>//<BR>// "z"(!d:Double,Integer):={ d:= varZ;
};<BR>// "z: ?d:Double":= { varZ:= d;
};<BR>//<BR>// ":Point":= { Point newX: varX andY: varY; };
<BR>// #defines point as replacement if
necessary<BR>// #often easier than inheritance..<BR>//<BR>//
>><BR>//<BR>// #Since the types and methods are binded at runtime,
<BR>// # we can may constants in definitions too..<BR>//<BR>//
Integer:<<<BR>// "factorial:?0":=
{1};<BR>// "factorial:?n:Integer":= { n*(n-1) factorial;
}<BR>// >><BR>//<BR>//
Integer:<<<BR>//
"divmod()":(?x:Integer;!div,!mod:Integer):= { div:= self//x; mod:= self\\x
};<BR>// #call with: 5 divmod(?x:= 3;
resDiv:= div; resMod:= mod);<BR>// >><BR>//</DIV>
<DIV> </DIV>
<DIV>I don't know how to do such definitions in current smalltalk grammar.<BR>I
thought of using @ for types.. and :: for output, but these symbols <BR>differ
too much from other languages..</DIV>
<DIV> </DIV>
<DIV>-----------------------------</DIV>
<DIV> </DIV>
<DIV><BR>These modules reduce a bit of complexity of modules and
behaviours (traits, inheritance). </DIV>
<DIV>The script of managing projects and fileIn.</DIV>
<DIV>
<DIV>The fflexible typesystem might add to speed and such..</DIV>
<DIV> </DIV>I know the problems are not all solved yet, but it is just a
start.</DIV></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>