From: Thomas Walker Lynch Epimetheus is a Python library for
+ Epimetheus is a Python library for
+ Unlike Prometheus (Forethought), who defines what an object is before it is born (classic class instantiation), Epimetheus allows you to attach meaning, identity, and semantic types to objects after they exist.
+
+ In standard programming, the
+ Epimetheus (Afterthought) rejects this. It allows you to attach meaning (semantics) to objects after they are born. You can decide later that an object behaves like a number, or a string, or a user.
+
+ If you strip away all pre-defined types and behaviors (no ints, no strings, no classes), what is left? What is the one thing you absolutely cannot add later?
+
+ Unlike Prometheus (Forethought), who defines what an object /is/ before it is born (classic class instantiation), Epimetheus allows you to attach meaning, identity, and semantic types to objects /after/ they exist.
+ You cannot attach meaning to an object if you cannot point to it. You cannot say "This object is a Number" if you cannot distinguish "This object" from "That object."
+
+ Therefore, the The English language is a given, apparently. Though once we have English, it seems a lot of the rest of this is moot.
-
+ As is apparent while you read this, English prose is a given. The goal in making use of prose is to explain that the code is internally consistent without the English description. Once the formal relations are established, the prose is no longer needed, as the logic permits no dependence on the medium used for its introduction. In other words, code does not read the comments to decide what to do.
+
- The code related to this discussion is implemented in Python, however issues with other languages are considered. On salient difference that is considered is that Python integers are bignums are passed by reference. In some other languages integers are considered primitives, are bounded and bit copied.
+ The code related to this discussion is implemented in Python; however, issues with other languages are considered. One salient difference involves the fact that Python integers are bignums and are passed by reference. In some other languages, integers are considered primitives, are bounded in magnitude, and are bit-copied.
- We are given a symbol instance factory. Each time the
- A symbol instance may be copied. A common method for making a copy in many languages is to use assignment, e.g.,
- Any two, or by transitivity, any number of, symbol instances can be compared for equality, say
- A symbol instance newly minted using the given symbol factory What is it
+ Introduction
- Assumptions and Terms
- Given
-
Given
+
+ Symbol
@@ -35,23 +73,31 @@
Instance
+ Any two, or by transitivity, any number of, symbol instances can be compared for equality, say
+ A symbol instance newly minted using the given symbol factory
Equality over symbol instances is an equivalence relation:
- Given an original, all copies stemming from it will be equal to each other and to the original. By
@@ -84,51 +130,83 @@
- The factoryâs
- If a symbol persists across contexts, such as across scopes or processes, it must remain distinct from all other symbols as it enters into those new processes or contexts. + If a symbol persists across contexts (such as across scopes or processes), it must remain distinct from all other symbols as it enters those new environments. +
+ ++ In this implementation, we meet this constraint by utilizing a global symbol instance factory and by explicitly disallowing a symbol from being employed outside the process of its creation. As a means of enforcement, there are no permitted methods to serialize a symbol to a string, nor to output one to a console or stream.
- In this implementation, we meet this constraint by using a global symbol factory and by explicitly disallowing a symbol from being used outside the process it was made in. + These constraints do not apply to symbol names, which are text strings. However, a symbol cannot be recovered from its name; the name is a label, not a reconstruction key.
- The term "Python object" refers to anything that can or could appear in Python code and could be associated with a symbol. This includes symbols themselves. + The term "Python object" refers to anything that can or could appear in legal Python code and could be associated with a symbol. This includes symbols themselves.
A symbol is associated with an object using a Python dictionary. The symbol is the key, and the object is that thing which is "looked up" via said key. + One such example is the symbol name dictionary mentioned in the prior section.
+
+ In the TTCA, we gave a formal definition for a
+ If a tape is treated as nothing more than its cells, then deleting the last cell causes the tape to no longer exist. In a system that has a higher level structure that preserves the tape as a distinct entity, deleting the last cell produces an empty tape that is said to have zero cells. +
+ ++ Consider a web browser. When the last tab is closed, the window disappears, forcing the user to create a new window to continue. Some users don't like this behavior, and would prefer that the window to remain as an empty canvas. Then a mistaken close could be undone by selecting 'reopen closed tab', without having to relaunch the browser and resettle the new window into the workspace. ++ +
+ The tape abstraction is particularly expressive in Python, as the language utilizes object references and permits lists to hold objects of any type. Once data within a container is modeled as a tape, structures such as lists, arrays, token streams, argument lists, and sequences all share the same abstract model. +
+ +The term
- In the TTCA, we provided a formal definition for a "tape." A tape has a leftmost cell, one or more "in-between" cells, and a rightmost cell. A "path" is a special case of a tape with additional constraints.
+ The leftmost cell in a path is called the
- Each cell of a path holds a symbol. The leftmost cell is called the - destination. The reader might have expected the path to go from left to right, but such a definition would run into a problem, as left-to-right traversal might not ever end. + The reader might have expected the path to go from left to right, with the destination on the far right. This would be natural because we read characters from a written page going from right to left. However, such a definition would run into a problem, as left-to-right traversal might not ever end.
Think about it this way: you are sitting in a pub of an inn, and a stranger walks in. Though you know the stranger's current destination, you might not know where he came from.+
- All cells of the path to the right of the destination cell are called "the way." If we were to drop the leftmost cell from the tape, then we would find "the way," if it exists, to be another tape. + Now consider another tape called F, where each cell holds a path. As a path is a special kind of tape, this new structure, F, is a tape of tapes.
-- Consider another tape where each cell holds a path. If we compare all paths on said tape and find that no two identical "ways" lead to different destinations, we call said tape a discrete function. + Now suppose we traverse this new tape while examining the paths as (destination ,way) pairs. If we find that all eual ways lead to + the same destination, then tape F is a discrete Function. We say it is discrete because we F is defined on a tape of discrete cells, and it is based on discrete symbols. We say it is a function due to having this property that all paths with identical ways lead to identical destination. + + + + compare all the paths on this + Suppose that when we + + If we compare all paths on said tape and find that no two paths have the same "ways" that lead to different destinations, we call said tape a discrete function.