Secrets of Part-Based Programming
Towards Higher Level Syntax for Programming Languages 2025-01-01
Part
A part - ė - contains exactly 1 input queue and exactly 1 output queue.
Queues hold Messages in order of arrival.
Parts cannot send Messages to other parts, they can only append Messages to their own output queue. Something else (the part’s owner) shepherds the messages from part to part.
Message
Messages are composed of 2 fields:
A port (string)
A payload (string).
Conduit
A conduit is a record of how a Message should be transmitted.
A conduit consists of 3 fields:
Direction (down | across | up | through)
Sender
Receiver.
When a Message is transmitted, the Message’s port is rewritten by the transporter. A new Message is created including the port of the Receiver and the payload of the Sender.
There are 4 cases for transmission:
Down - The new Message is added to the input queue of the Receiver. The Message is passed downward from the part’s owner to one or more parts contained (directly) within the owner.
Across - The new Message is added to the input queue of the Receiver. The Message is passed across from the output of a part to the input of another part. Both parts must be directly owned by the same owner.
Up - The new Message is added to the output queue of the Receiver. The Message is passed from the output of an owned part to the output of the part’s owner.
Through - The new Message is added to the output queue of the Receiver. The Message is passed directly from the input of an owner to the output of the same owner (“stubbed out”).
Owner parts are called “choreographers”.
Directly owned parts can be “choreographers” or “workers”. I.E. choreographer parts are recursively defined. Choreographers can hold workers and they can hold1 other choreographers.
There’s More
There’s more, but, for simplicity, I’ll stop here for now.
For example
What’s inside a choreographer part?
How do you write this stuff down? I.E. how do you express little networks built this way?
What programming languages can be used?
Can we abstract this stuff to make it more portable?
Etc.
An experimental implementation of these concepts exists[1] in various programming languages (Odin, Python, Common Lisp, Crystal, etc.) but uses different names internally.
See Also
References: https://guitarvydas.github.io/2024/01/06/References.html
Blog: guitarvydas.github.io
Videos: https://www.youtube.com/@programmingsimplicity2980
Discord: https://discord.gg/65YZUh6Jpq
Leanpub: [WIP] https://leanpub.com/u/paul-tarvydas
Gumroad: tarvydas.gumroad.com
Twitter: @paul_tarvydas
Bibliography
[1] 0D from https://github.com/guitarvydas/0D
Akin to how lists work in Lisp. A List can hold Atoms and/or other Lists.




