====== The Syndicated Actor Model (SAM) ======
//This information is provided by someone familiar with SAM but little knowledge of Folk. Some claims about Folk may be regrettably inaccurate.//
The Syndicated Actor Model (SAM) is a system for working with software actors that is convergent with Folk.
SAM is not a single program or library but a data language and protocols with a set of implementations for different languages. There is a common set of features with each language as varying in how much of the feature set is supported. Implementations with a simple feature set use the Syndicate protocol to communicate with actors in other languages that provided missing functionality.
===== Similarities =====
=== Universe of knowledge ===
Folk has a [[.:internals:db|database]] of statements and SAM [[.:syndicate#dataspaces|dataspaces]] of asserted facts.
=== Tcl ===
Folk is primarily written in Tcl and SAM has a basic [[.:Sycl|Tcl implementation]].
=== Reactive paradigm ===
Both use a reactive programing paradigm:
# Folk
When $program has resolved geometry /geom/ {
Claim $editor has resolved geometry $geom
}
# Syndicate for Tcl
## Folk style
during "[$program has resolved geometry @geom #?]" {
assert [list $editor has resolved geometry $geom]
}
## Native style
during "" {
assert [preserves::record resolved-geometry $editor $geom]
}
===== Differences =====
=== Composition ===
Folk is composed as a Tcl program. SAM is a composition of actors conversing using the Syndicate protocol.
=== Data ===
Folk uses [[.:internals:trie|statements]] built from tokens.
SAM uses the [[https://preserves.dev/|Preserves]] data language and relies on compound values such as lists, records (''''), dictionaries, and sets.
== Tokens ==
SAM has distinct text-string, byte-string, and symbol data types, which is a pain to deal with in Tcl.
Folk uses Tcl values.
==== What Folk has got ====
* Intuitive physical interface.
* Intuitive language for programs.
* Physically delineated security.
==== What Syndicate has got ====
* Addressable program/actor entities((https://synit.org/book/glossary.html#entity))
* Protocol for communicating with external entities and machines((https://synit.org/book/protocol.html))
* Libraries for multiple languages, programs written in different languages can communicate using a common protocol.
=== Dataspaces ===
Dataspaces((https://synit.org/book/syndicated-actor-model.html#dataspaces)) are a special SAM entities that hold Syndicate assertions of facts for observation by other actors. A program may have any number of internal dataspaces for holding facts. SAM implementations like [[.:Sycl]] do not support local dataspaces but do access dataspaces hosted by other programs.
Folk databases use a [[.:internals:trie]] whereas SAM dataspaces use what is described as a skeleton((https://git.syndicate-lang.org/syndicate-lang/syndicate-rkt/src/branch/main/syndicate/HOWITWORKS.md)).
===== Further reading =====
* https://syndicate-lang.org/
* https://synit.org/book/syndicated-actor-model.html
* https://tiddly.informatics.coop/