61 points · by cinquemb · 5y ago · 27 comments
> Fibonacci coding has a useful property that sometimes makes it attractive in comparison to other universal codes: it is an example of a self-synchronizing code, making it easier to recover data from a damaged stream.
http://teachersofindia.org/en/article/fibonacci-coding-and-c...
Here is a backstory. I'm a UI developer and I code to build UI, question that came to me, why not build an UI that builds the UI?
It's an IDE or a design tool. I tried it, built it, https://github.com/imvetri/ui-editor. but I wasn't really not convinced. why? A problem is solved only when solved recursively.
I did solve it recursively - I built an UI to build an UI, however I wanted to take to next step.
I'm trying to reduce code and include more interactions. I'm really not sure how to build a true UI that can build UI, but Fibonacci series or other growing functions that is solved recursively is my inspiration.
How to apply that to building User interfaces ?
Everything is a rectangle. A rectangle can have children rectangles. A rectangle can have sibling rectangle. A parent rectangle can create children rectangle. A parent can delete child rectangle. A rectangle can edit itself. hahaha
A parent rectangle can edit itself to create more children.
So I need one rectangle hardcoded that can create more children, and can edit itself
And I have solved that too - https://vimeo.com/464104903.
TDLR: I work on a side project to bring all frameworks under one hood (by targeted code generation to different framework with single source of truth. It is tested well for reactJS). I still want to work on it on everyday basis, but couldn't find the time I had 3 years back. However I'll be glad to set some time to guide someone if they are interested to contribute.
[0] https://github.com/invertedtomato/integer-compression
[1] https://raw.githubusercontent.com/invertedtomato/integer-com...
Still trying to explore though.
[0] https://en.wikipedia.org/wiki/Dynamic_Markov_compression
These days, they would usually be combined with an arithmetic or range coder to store each binary digit more efficiently than just writing it directly to the file.
1) https://en.wikipedia.org/wiki/G%C3%B6del_numbering
2) https://en.wikipedia.org/wiki/The_Gold_at_the_Starbow's_End
However, very many even integers are the total of more than one pair of primes. So, the encoding of a number using this scheme is not unique.
In contrast, because of the property F_n = F_{n-1} + F_{n-2} you never need more any Fibonacci number more than once in the code, so the code is binary (and the encoding unique).