Fumola is an experimental programming language. We take inspiration from The Extended Adapton Recipe, including Demanded Computation Graphs extended with symbolic space and time.
Fumola integrates these ideas with an otherwise conventional language, with conventional data types. For those features, we take inspiration from Motoko, a language design we adopt for most "core language features" that operate orthogonality to incremental computing primitives (e.g., primitive values, records, variants, functions, and modules).
Interactive view: For interactive control over the image above, see the interactive version here. This replayground demo features interactive accommodations for exploring the data stored in the picture, not included in the "high level" image above.
Description of the image:
The image above depicts the dynamic behavior of lazyMergeSort on 44 unsorted input elements, as a Demanded Computation Graph (DCG), from a "high level" vantage point, literally.
- Input list of 44 elements are the green boxes in far left column.
- Balanced "level tree" of 44 leaves is central, also green boxes, and constructed to the right of this input list.
- The thunks that "do" things in the DCG are blue orbs, with different kinds of actions (
put,force,get) drawn as graph edges coming out of each thunk orb doing that action. - To the right of this balanced tree, the sub-graph of
mergethunks constructs the final sorted list, on demand. It extends from left to right, horizontally. - The tree root's stream of
mergenodes (longest, central row of horizontal orbs) has the 44 elements in sorted order because we've demanded the full output.
fumola code for the image:
let seed = 10;
let size = 44;
let inputArray = R.generateRandomInput(seed, size);
let inputList_ = `ListFromRandomArray := thunk {
do within space `inputList {
List.fromIter(inputArray.vals())
}
};
let inputList = force(inputList_);
let inputTree_ =
`LevelTreeFromList := thunk {
do within space `inputTree {
Seq.fromList(inputList)
};
};
let inputTree = force(inputTree_);
let lazySorted_ =
force(`lazyMergeSort := thunk {
do within space `lazyMergeSort {
if false {
Seq.lazyMergeSort(inputTree)
} else {
Seq.lazyMergeSort_(inputTree)
};
}});
let sorted =
force(`forceSort := thunk {
do within space `forceSort {
LazyList.takeN_(lazySorted_, size);
}});- Fumola semantics performs realignment on DCGs via signaling and repair algorithms (Adapton Recipe semantics).
- More example algorithms and data structures.
- Replayground permits live editing of the program being displayed, like in Hazel.
- Use Fumola to author the UI aspects of the Replayground experience, now created by a static file exported from Fumola demo programs into static HTML/JS.
Contributions are welcome! Please check out the contributor guidelines for more information.