Tuesday, December 18, 2018

The Hardly object model

All objects are stacks, all stacks are lists of word, all key terms,v variable pointers, and integers are words. The standard word is Text8, 64 bit aligned.

Any other object created is from a stack and gets the basic stack builtins. We introduce the using built in which sets the stack default scope making built in operate with the understood 'self' pointer to the proper stack.

For example, a string is a stack, it is recovered by popping the stack until empty  String methods like compare become a series or pop, test and jump; eight chars at a time. Shifting and inserting into strings requires some mask and shift to move byte chunks within Text8 forms. Mask and bye shifting Text8 are not in the syntax of pop and push words, needs a built in. No byte moves are are of the syntax, and byte strings not word aligned become foreign and need and external loaded module.

Beyond that, object creation needs an implicit (and explicit) make and destroy  stack.  Either implicit in the grammar context or an actual built in, likely both.  Hardly is design to be a byte code machine for higher level stack applications. It is targeted at applications that need to order and reorder sequences, applications that could use a Shunt machine, and Hardly will be designed around the general purpose shun system.

The idea is that, hardly resolves back to a standard minimal Forth when using is set to default, a 64 bit Forth.

No comments: