philipl / pifs

πfs - the data-free filesystem!
GNU General Public License v3.0
6.69k stars 290 forks source link

πEP 314: Python bindings #73

Open MaxwellWibert opened 9 months ago

MaxwellWibert commented 9 months ago

Let's imagine for a moment, the possibilities that would avail themselves if we were somehow able to combine the beauty and elegance of Python with the incredible efficiency of πfs. It would be great if we could add python bindings for this library using Python's CFFI, and publish it as a Python package, which I propose be called pyπfs . We can host pyπfs on the Python Package Index (which is developed and maintained by the Python Packaging Authority), with a set of optional dependencies that allow us to pipe the output of pyπfs into modules from other libraries, like SciPy.io.

Then whenever we need to access the filesystem pipes in a new SciPy project, we simply have to run

pip install SciPy pyπfs[πiopipes] # (from the PyPI)

or, if perhaps you prefer PyPy, you could run

pypy -m pip install SciPy pyπfs[πiopipes] # (from PyPI (by the PyPA))

Naturally, once a user has installed pyπfs once on their system, they should no longer need to make calls to the PyPI since, all of its packages are already in the digits of $\pi$, so I further propose we include a utility module, πιπ which retrieves any package you might need from the πfs-encoded python package index. Obviously for security and sustainability, we should form a committee that ensures that any package indexed in the πPyPI adheres with best practices, i.e. is πEP compliant. The πPyPA would do just that. When our work is done the above installation is as simple as

pypy -m πfs.πιπ install SciPy pyπfs[πiopipes] # (from πPyPI (by the πPyPA))

Then in our python code we could load arrays into the program from the πfs as follows

from pyπfs import πiopipes, πpath
import scipy.io

with πiopipes.pipe(scipy.io) as scipyπiopipe:
     Io_πpath = πpath.join("path", "to", "Io.io")
     Io = scipyπiopipe.read(Io_πpath)

Simple. Elegant. Efficient. Need I say more?

MaxwellWibert commented 9 months ago

Given the obvious power of this technology, I took the liberty of reaching out to some venture capital investors in the crypto space to apply for seed funding, and unsurprisingly, several of them saw the value in the opportunity I presented to them. I'm pleased to announce that the πPyPA received first round investments totaling nearly 20,000 ETH in all. I'll be reaching out again to start distributing funds, just as soon as πfs retrieves our private key. This may take a while since the first occurrence of the 32 byte key is at index $\approx 16^{64}$ (assuming $\pi$ is normal). Now, I hear all the naysayers who might point out that to date, pi has only been computed up to $\approx$ 83 trillion hex digits. But I believe if we just give Moore's law a couple more years, and find a faster converging series for $\pi$, I'll be able to get that key and distribute the funds so that we can all get started on this very important work.