beyondbabel 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: beyondbabel
3
+ Version: 0.2.0
4
+ Summary: A function pool manager for Python that enables multilingual function sharing through AST normalization
5
+ Author: Amirouche Boubekki
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/amirouche/bb.py
8
+ Project-URL: Repository, https://github.com/amirouche/bb.py
9
+ Project-URL: Issues, https://github.com/amirouche/bb.py/issues
10
+ Keywords: ast,code-sharing,multilingual,content-addressed,function-pool
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ Provides-Extra: dev
24
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
25
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
26
+
27
+ # bb.py
28
+
29
+ ![Tests](https://github.com/amirouche/bb.py/actions/workflows/test.yml/badge.svg)
30
+
31
+ **Nurturing a society that recognizes diversity as strength through verifiable knowledge sharing.**
32
+
33
+ > **Experimental**: This is research software under active development.
34
+
35
+ Every programmer who thinks in Wolof, Tamil, Vietnamese, or Tamazight and codes in English pays a cognitive tax. Every variable named in a second language is a thought translated before it's expressed. This overhead is invisible to the people who don't pay it — and universal for everyone who does.
36
+
37
+ bb.py makes that tax optional. Write functions in your language — name variables, write documentation, think natively. The tool separates what your code *does* from what you *called* things. Same logic, same hash, regardless of tongue.
38
+
39
+ Content-addressing gives every function a unique fingerprint. Authorship is preserved. Lineage is traceable. Knowledge is shared without losing track of who made what.
40
+
41
+ ## Same logic, three languages, one hash
42
+
43
+ ```python
44
+ # English
45
+ def calculate_sum(first_number, second_number):
46
+ """Calculate the sum of two numbers."""
47
+ result = first_number + second_number
48
+ return result
49
+ ```
50
+
51
+ ```python
52
+ # Français
53
+ def calculer_somme(premier_nombre, deuxieme_nombre):
54
+ """Calculer la somme de deux nombres."""
55
+ sortie = premier_nombre + deuxieme_nombre
56
+ return sortie
57
+ ```
58
+
59
+ ```python
60
+ # Español
61
+ def calcular_suma(primer_numero, segundo_numero):
62
+ """Calcular la suma de dos números."""
63
+ resultado = primer_numero + segundo_numero
64
+ return resultado
65
+ ```
66
+
67
+ ```bash
68
+ bb init
69
+ bb add example_simple.py@eng # → 9f86d0...
70
+ bb add example_simple_french.py@fra # → 9f86d0... ← same hash
71
+ bb add example_simple_spanish.py@spa # → 9f86d0... ← same hash again
72
+ ```
73
+
74
+ Three languages. One identity. No one translated — they wrote originals.
75
+
76
+ ## What it enables
77
+
78
+ bb.py is a tool for sharing content-addressed knowledge that is verifiable, maintainable, and preserves authorship and lineage.
79
+
80
+ - **Think in your language** — variable names and documentation in your native tongue, without penalty
81
+ - **Share across languages** — retrieve any function in any language with `bb show hash@lang`
82
+ - **Verify identity** — same logic always produces the same hash, no matter who wrote it or in what language
83
+ - **Preserve lineage** — every function is traceable; who made what, who built on whom
84
+ - **Compose and build** — functions import other pool functions; dependencies are tracked, compiled, and runnable
85
+ - **Single file, zero dependencies** — the entire tool is one Python file
86
+
87
+ ## How it works
88
+
89
+ ```
90
+ Source code → Parse to AST → Normalize → Hash → Store
91
+ ```
92
+
93
+ Normalization renames all local variables to a canonical form, sorts imports, and strips docstrings before hashing. Built-in names and imports are never renamed. The result: any function with the same logical structure produces the same SHA-256 hash, regardless of the names chosen by the author.
94
+
95
+ The original names, docstrings, and language metadata are stored alongside the hash — one mapping per language. This separates identity (the logic) from presentation (the language).
96
+
97
+ Exact matching is the foundation — the clean case where two people write the same logic independently and the hash proves it. For the realistic case where two people solve the same problem differently, semantic search surfaces near-matches: similar structure, different choices. Convergence isn't forced. It's discovered. The hash is the meeting point — independent teams who solve the same problem find each other through identity, not coordination.
98
+
99
+ ## Install
100
+
101
+ ```bash
102
+ # Using pip
103
+ pip install git+https://github.com/amirouche/bb.py.git
104
+
105
+ # Using uv
106
+ uv tool install git+https://github.com/amirouche/bb.py.git
107
+ ```
108
+
109
+ Requires Python 3.11+. No runtime dependencies.
110
+
111
+ ## Vision
112
+
113
+ bb.py is a step toward Möbius — a content-addressed language where timestamps make lineage visible, and names are views into a multilingual registry. Who made what, who built on whom, who absorbed whose work without credit. The mirror doesn't prescribe norms or enforce justice. It refuses amnesia.
114
+
115
+ ## Related Work
116
+
117
+ - **[Unison](https://www.unison-lang.org/)** — content-addressable code where the hash is the identity
118
+ - **[Abstract Wikipedia](https://meta.wikimedia.org/wiki/Abstract_Wikipedia)** — multilingual knowledge representation that separates meaning from language
119
+ - **[Situational application](https://en.wikipedia.org/wiki/Situational_application)** — local, contextual solutions (also known as Situated Software)
120
+ - **Non-English-based programming languages** — [Wikipedia overview](https://en.wikipedia.org/wiki/Non-English-based_programming_languages)
121
+ - **Content-addressed storage** — Git, IPFS, Nix
122
+ - **Multilingual programming** — Racket's #lang system, Babylonian programming
123
+
124
+ ## See Also
125
+
126
+ - [`transcripts/`](transcripts/) — walkthrough sessions showing Beyond Babel in action
127
+ - [`LIMITS.md`](LIMITS.md) — known limitations and research questions
128
+
129
+ ---
130
+
131
+ *"The limits of my language mean the limits of my world."* — Ludwig Wittgenstein
@@ -0,0 +1,105 @@
1
+ # bb.py
2
+
3
+ ![Tests](https://github.com/amirouche/bb.py/actions/workflows/test.yml/badge.svg)
4
+
5
+ **Nurturing a society that recognizes diversity as strength through verifiable knowledge sharing.**
6
+
7
+ > **Experimental**: This is research software under active development.
8
+
9
+ Every programmer who thinks in Wolof, Tamil, Vietnamese, or Tamazight and codes in English pays a cognitive tax. Every variable named in a second language is a thought translated before it's expressed. This overhead is invisible to the people who don't pay it — and universal for everyone who does.
10
+
11
+ bb.py makes that tax optional. Write functions in your language — name variables, write documentation, think natively. The tool separates what your code *does* from what you *called* things. Same logic, same hash, regardless of tongue.
12
+
13
+ Content-addressing gives every function a unique fingerprint. Authorship is preserved. Lineage is traceable. Knowledge is shared without losing track of who made what.
14
+
15
+ ## Same logic, three languages, one hash
16
+
17
+ ```python
18
+ # English
19
+ def calculate_sum(first_number, second_number):
20
+ """Calculate the sum of two numbers."""
21
+ result = first_number + second_number
22
+ return result
23
+ ```
24
+
25
+ ```python
26
+ # Français
27
+ def calculer_somme(premier_nombre, deuxieme_nombre):
28
+ """Calculer la somme de deux nombres."""
29
+ sortie = premier_nombre + deuxieme_nombre
30
+ return sortie
31
+ ```
32
+
33
+ ```python
34
+ # Español
35
+ def calcular_suma(primer_numero, segundo_numero):
36
+ """Calcular la suma de dos números."""
37
+ resultado = primer_numero + segundo_numero
38
+ return resultado
39
+ ```
40
+
41
+ ```bash
42
+ bb init
43
+ bb add example_simple.py@eng # → 9f86d0...
44
+ bb add example_simple_french.py@fra # → 9f86d0... ← same hash
45
+ bb add example_simple_spanish.py@spa # → 9f86d0... ← same hash again
46
+ ```
47
+
48
+ Three languages. One identity. No one translated — they wrote originals.
49
+
50
+ ## What it enables
51
+
52
+ bb.py is a tool for sharing content-addressed knowledge that is verifiable, maintainable, and preserves authorship and lineage.
53
+
54
+ - **Think in your language** — variable names and documentation in your native tongue, without penalty
55
+ - **Share across languages** — retrieve any function in any language with `bb show hash@lang`
56
+ - **Verify identity** — same logic always produces the same hash, no matter who wrote it or in what language
57
+ - **Preserve lineage** — every function is traceable; who made what, who built on whom
58
+ - **Compose and build** — functions import other pool functions; dependencies are tracked, compiled, and runnable
59
+ - **Single file, zero dependencies** — the entire tool is one Python file
60
+
61
+ ## How it works
62
+
63
+ ```
64
+ Source code → Parse to AST → Normalize → Hash → Store
65
+ ```
66
+
67
+ Normalization renames all local variables to a canonical form, sorts imports, and strips docstrings before hashing. Built-in names and imports are never renamed. The result: any function with the same logical structure produces the same SHA-256 hash, regardless of the names chosen by the author.
68
+
69
+ The original names, docstrings, and language metadata are stored alongside the hash — one mapping per language. This separates identity (the logic) from presentation (the language).
70
+
71
+ Exact matching is the foundation — the clean case where two people write the same logic independently and the hash proves it. For the realistic case where two people solve the same problem differently, semantic search surfaces near-matches: similar structure, different choices. Convergence isn't forced. It's discovered. The hash is the meeting point — independent teams who solve the same problem find each other through identity, not coordination.
72
+
73
+ ## Install
74
+
75
+ ```bash
76
+ # Using pip
77
+ pip install git+https://github.com/amirouche/bb.py.git
78
+
79
+ # Using uv
80
+ uv tool install git+https://github.com/amirouche/bb.py.git
81
+ ```
82
+
83
+ Requires Python 3.11+. No runtime dependencies.
84
+
85
+ ## Vision
86
+
87
+ bb.py is a step toward Möbius — a content-addressed language where timestamps make lineage visible, and names are views into a multilingual registry. Who made what, who built on whom, who absorbed whose work without credit. The mirror doesn't prescribe norms or enforce justice. It refuses amnesia.
88
+
89
+ ## Related Work
90
+
91
+ - **[Unison](https://www.unison-lang.org/)** — content-addressable code where the hash is the identity
92
+ - **[Abstract Wikipedia](https://meta.wikimedia.org/wiki/Abstract_Wikipedia)** — multilingual knowledge representation that separates meaning from language
93
+ - **[Situational application](https://en.wikipedia.org/wiki/Situational_application)** — local, contextual solutions (also known as Situated Software)
94
+ - **Non-English-based programming languages** — [Wikipedia overview](https://en.wikipedia.org/wiki/Non-English-based_programming_languages)
95
+ - **Content-addressed storage** — Git, IPFS, Nix
96
+ - **Multilingual programming** — Racket's #lang system, Babylonian programming
97
+
98
+ ## See Also
99
+
100
+ - [`transcripts/`](transcripts/) — walkthrough sessions showing Beyond Babel in action
101
+ - [`LIMITS.md`](LIMITS.md) — known limitations and research questions
102
+
103
+ ---
104
+
105
+ *"The limits of my language mean the limits of my world."* — Ludwig Wittgenstein