You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THIS SHOULD BE MOVED TO A REPOSITORY FOR BETTER ORGANIZATION, AS IT IS GETTING
PRETTY MESSY HERE.
Also inspect whether a babel plugin can be developed for this (check this and this).
I have always wondered whether we could extend syntax of JavaScript to natively support reactive primitives, how would that look and whether that would be useful or not. This is a mental excercise on that front.
Ok so this is a personal investigation of how reactive programming can be better embedded in imperative languages in general. I have conducted such an investigation for JavaScript already with interesting results, but focusing solely on JavaScript and its conventions might be a bit limiting as I feel results can be achieved that are more generally applicable.
The Problem
A lot of modern programs work with reactive values or observables, i.e. values that change over time (number of clicks on a button, time of a timer, position of the mouse cursor, etc.). These values need to get processed, combined with other observables, etc.
Imagine a simple use case: a text input with a word count display underneath. You can specify this with a simple pseudo-code as follows:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I guess that the [fediverse][fediverse] will be as decentralised as email: a bit, but not that much. Most people will be dependent on a few major hubs, some groups might have their own hubs (e.g. company email servers), personal instances will be pretty rare. This is in contrast to personal blogging, where every Bob can easily host their own (and they often do). I mean that's already implied by the name: fediverse is [a federated universe, not a distributed one][fed-v-dis].
Why does this matter? Well I like not being dependent on one entity, but I would like it much more if I was dependent on no entities at all. In other words, I like to publish my own personal blog and get all the goodies of a social network, without being dependent on other micro-blogging / social content platforms.
So in this writing, I'm going to:
❓ Contemplate on why the fediverse gets federated not distributed (spoilers: its push vs pull)
an immutable transaction ledger where calculating account balance is quite fast
Offer-based Chain of State Ledger
UTXOs make it hard to calculate account balance. This can be fixed by merging all UTXOs of an account into one UTXO, and forking that UTXO into one to the recipient account and the remainder to the same account, for "spending". This constraint can be baked into all transactions, which turns the ledger into an effective snapshot history of each account (chain of state), while still being as secure, predictable and light-weight, though with reduced parallelizability.
Since during each transfer affected UTXOs are "locked" (concurrent operations on them result in conflicts and all but one of such conflicting changes will be dropped, or alternatively they are locked to avoid concurrent modifications), and since in such a mechanism each account will be a single UTXO, conducting the fork (from source account) and merge (into t