5 ms·
Author here: sorry if the "append-only" analogy went a bit upstream in the comments, it was certainly meant to be taken with a pinch of salt. All of regular pr
by sktrdie 7y ago
Author here: sorry if the "append-only" analogy went a bit upstream in the comments, it was certainly meant to be taken with a pinch of salt.
All of regular programming methodologies apply with b-threads. And most of the time changing requirements would require one to change the b-threads involved in that requirement. The append-only analogy was really more to showcase the feature of incrementality.
Technically one can develop a complicated system just via append-only but again you'll likely better off having clean b-threads that deal with specific behavior organized in specific and clean ways the same way we organize any other software.
From the comments it seems I wasn't successful at highlighting the key insights of this paradigm. One read that I suggested in this article that does a much better job at explaining these concepts is "The quest for runware: on compositional, executable and intuitive models" [1] where the authors essentially describe the need for something like Behavioral Programming (authors are the creators of BP). Some quotes from the paper:
> As mentioned earlier, it will be possible to represent new requirements, or changes thereof, in a new behavioral component or module, with minimal change to the previously specified parts of the model, and without sacrificing executability and manageability. Such modules will be simply added to the existing model, virtually ‘piled-atop’ it, with no component specific interface, connectivity, or ordering requirements.
> In our vision, the units of the specification and models
are not assembled in detail like resistors or chips on a computer board, or methods and fields in an OO-programming object class. The interweaving of behavioral modules will be
facilitated by their reference to common aspects of system
behavior described using shared vocabularies (for example,
common events), and not via mutual awareness and direct
communication between components. From the point of view
of such a module, the other modules could be transparently
replaced by new ones. In fact, the implementation of any
part of the specification or a model should be replaceable by
some kind of ‘invisible box’, whose implementation remains
a mystery, and the effectiveness of the remaining modules and
the integrity of the overall system behavior will be preserved.
And from the conclusion:
> What will happen if and when the human way of
expressing requirements for systems will become almost
indistinguishable from the way this is done with computer
programs? And what will be the result of a level of compositionality that would allow humans to add capabilities to
a system with much less dependence on that system than is
possible today?
> When a collection of specification units grows over time,
accumulating an unmanageable collection of patches, exceptions, and enhancements, it is likely developers will call for
merging or refactoring them into much more concise artifacts. The new modules will replace the existing collection in all its uses (final executing system, official record
of the specification, and means for communication between
humans) without changing other parts of the specification.
Such refactoring will be acceptable, even if it ends up being
done manually, as it will focus on capturing the human’s
revised perception of the affected behavior.
1. http://www.wisdom.weizmann.ac.il/~harel/papers/Runware.pdf http://www.wisdom.weizmann.ac.il/~harel/papers/Runware.pdf
- _pmf_ 7y agoI liked the article (in fact for me it was a better introduction that the "Liberating Programming, Period" article by Weizmann), but Hacker News is kind of a lost cause regarding, well, "news". Everything that cannot be shoehorned into their view of faux-FP has to be bad. Someone should probably post this on lobste.rs, which is a bit more open minded (I would, but don't have an account).
- arunaugustine 7y agoThere's already a discussion there: https://lobste.rs/s/tcequd/b_threads_programming_way_allows_for https://lobste.rs/s/tcequd/b_threads_programming_way_allows_...
- thekhatribharat 7y agoIIUC, this architectural pattern can be seen in a lot of different places: 1. Actor Model (ref: Erlang) or Communicating Sequential Processes (ref: Golang) as someone already mentioned in the comments. 2. Distributed replicated logs (ref: Kafka) acting as shared vocabulary for multiple data sources and sinks 3. D-Bus (for IPC b/w Linux processes) 4. Or any event-based system (ref: Node.js) So there's definitely two separate threads (no pun intended) of discussion here: 1. The BP idea 2. The implementation (a la B-threads) The BP idea's benefits can be seen, to an extent, in all the different models described above. But they also suffer from the same problems as any BP implementation: 1. Double negation[1] (as someone already mentioned in the comments) 2. If a specification change touches multiple "events" (aka shared vocabulary), it'll need refactoring across code organization units (eg. actors in Actor Model, B-theads in BP, functions/callbacks in Event-based systems, etc.) - which brings us back to the original problem of the human mind having to think of disparate execution paths to bring about spec changes in software. [1] https://news.ycombinator.com/item?id=20560001 https://news.ycombinator.com/item?id=20560001