Sitemap | Search || Zen Spider Website
/ Satori
/ The Satori Project
/ The User's Manual
The User's Manual
- Introduction to Satori
- What is Satori?
- Satori is a super-set of the Smalltalk-80 programming language which will extend Smalltalk-80 with optional variable typing.
- What is Smalltalk-80?
- An object oriented programming language from Xerox PARC labs.
- This language is a direct descendant of Simula, the first object oriented language.
- Smalltalk is a unique language in that it has a very simple English-like syntax and a large comprehensive class library.
- What does variable typing do?
- Optional variable typing will make it possible to do type-checking of variables and static binding of methods which are currently not possible in the Smalltalk-80 programming language.
- Type-checking ensures type-safe code while static binding reduces runtime expense.
- Satori consists of a compiler, an interpreter, & utilities.
- Compiler
- The compiler parses Satori source code.
- It translates source into actual object and bytecode form.
- It saves objects to a binary file for the interpreter.
- Interpreter
- The interpreter includes the bytecodes and primitives.
- The bytecodes tell the interpreter what actions to perform.
- The primitives are method implementations of the lowest layer of the Satori class library.
- Utilities used by both the Interpreter and Compiler.
- Arrays (static and dynamic), strings, integers and other data types.
- Garbage Collector and the Satori object model.
- Debugging utilities.
- Compiler
- What is a compiler?
- Satori's compiler translates text based source code, describing classes and their methods, into class and compiled method objects. It then writes these objects out to a binary file for the interpreter.
- What is a compiled method?
- A compiled method is an object containing a bytecode string and the information that the bytecodes need in order for the interpreter to execute the bytecode string.
- For more information on bytecodes, see the section on the interpreter.
- How was the compiler created?
- It was automatically generated by a set of tools called PCCTS, or the Purdue Compiler Construction Tool Set. PCCTS is a compiler for a language describing grammars.
- By feeding it the grammar of Satori, it produces C++ code that we use to parse and translate Satori source code into objects.
- Interpreter (VCPU)
- What is an Interpreter?
- The interpreter is a stack based "virtual CPU". It executes a string of bytecodes embedded in a compiled method.
- What are the major components of the VCPU?
- Data Stack
- A stack of objects used to temporarily store objects used as method arguments and return values.
- Active Context
- The currently executing context.
- See below.
- Context Stack
- A stack of contexts used to temporarily store currently executing methods.
- What is a "Context"?
- The storage of information necessary to execute a method. This includes a temporary frame for storage of the method's arguments and temporary variables,
- a literal frame for storage of the literal objects used by the method's bytecodes, an instruction pointer to keep track of execution progress, and the message's receiver (the object being asked to execute the current message).
- Debugging Utilities
- What are debugging utilities and why do we use them?
- Debugging utilities assist in verifying our code and preventing errors.
- Debugging has helped us eliminate many errors, early in the implementation phase, that may have been hard to find or could cause many problems later.
- What is "Tracing"?
- It outputs what calls are made.
- It verifies what we think the code should be doing. For example, if we believe our code should go from function "a" to function "b", but our tracing says we go from function "a" to function "c", we have quickly and easily pinpointed where the problem is.
- What are "Wrappers"?
- They protect programmers from potential problems that C++ allows while using C++ datatypes.
- They are designed to alleviate possible coding problems.
- Wrapper classes include: Unsigned Integer, Signed Integer, Boolean, and all other commonly used C++ datatypes.
- What are "Walk Throughs"?
- They are done by the group without the aid of a computer.
- We manually walk through every-line of written code.
- We verify that the design, as well as the code, is correct and consistent.
- What are "Test Drivers"?
- The test code that the computer runs.
- They verify that both the good and bad cases are properly handled.
- Garbage Collection
- What is garbage collection?
- It automates memory management & reclaimation.
- It prevents the ability to lose track of manually allocated memory.
- What type of garbage collection does Satori use?
- We use Baker's Semi-space Copying algorithm.
- How does Baker's algorithm work?
- There are two pools of memory.
- Only one pool is active at a time.
- When an object is created and there is not enough memory, garbage collection is automatically performed.
- The first task is to tell all root/perimeter pointers to collect their objects.
- Next, each object tells its sub-objects to collect.
- As each object is collected, a forwarding address is recorded so that objects referring to an old address are automatically updated. This is a lot like the post office when you move to a new address.
- In the end, all "live" objects have been moved to the non-active pool and all the pointers have been updated.
- The new pool is now the active pool and the old one is cleared.
- What are the Pro's and Con's using Baker's algorithm?
- Pro's
- It is easy to understand.
- It is simple to implement and maintain.
- Con's
- Half of memory is always empty and unused.
- Time spent is proportional to the number of live objects.
- Why do we use garbage collection?
- Because Satori is a superset of Smalltalk-80 and Smalltalk-80 automates memory management for the programmer.
- Because C++ forces us to concentrate on manual memory management.
- It is estimated that 2/3 of a C++ programmer's time is spent on memory management.
- Learning Satori
- To learn Satori, you must first learn Smalltalk-80. We suggest going straight to the source, Smalltalk-80: The Language, by Goldberg & Robson. This is an excellent book to truely understand Smalltalk as it it meant to be used.
- Once you learn Smalltalk, there is only one difference that you need to understand Satori. For every variable declaration, whether it is an instance variable, class variable, a temporary, argument, or block's injection variable,
- you may precede the variable's name with a type declaration in the form of:
- "(" ClassName ")"
- Please understand, the core class libraries of Satori will eventually be profiled by the authors, and you will probably not need to use this feature at all. The intent of variable typing in Satori was
- to optimize the well known cases in Smalltalk's core class libraries that can use the typing information to its benefit.
- Using Satori
- Editing Source
- To use Satori, you must first compose your source in your text editor of choice. At this time, Satori has no built in editing of methods or classes.
- Compiling & Running
- With a GUI version of Satori, you drag your source files to the application. On systems without a GUI, the you execute Satori with all pathnames of source files listed as arguments to Satori.
- Upon execution, Satori takes over, compiles and runs the files. Your interaction is then limited to the interactions defined by the source code you are running.
Sitemap | Search || Zen Spider Website
/ Satori
/ The Satori Project
/ The User's Manual