Skip to main content

A function pool manager for Python that enables multilingual function sharing through AST normalization

Project description

bb.py

Tests

Nurturing a society that recognizes diversity as strength through verifiable knowledge sharing.

Experimental: This is research software under active development.

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.

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.

Content-addressing gives every function a unique fingerprint. Authorship is preserved. Lineage is traceable. Knowledge is shared without losing track of who made what.

Same logic, three languages, one hash

# English
def calculate_sum(first_number, second_number):
    """Calculate the sum of two numbers."""
    result = first_number + second_number
    return result
# Français
def calculer_somme(premier_nombre, deuxieme_nombre):
    """Calculer la somme de deux nombres."""
    sortie = premier_nombre + deuxieme_nombre
    return sortie
# Español
def calcular_suma(primer_numero, segundo_numero):
    """Calcular la suma de dos números."""
    resultado = primer_numero + segundo_numero
    return resultado
bb init
bb add example_simple.py@eng      # → 9f86d0...
bb add example_simple_french.py@fra   # → 9f86d0...  ← same hash
bb add example_simple_spanish.py@spa  # → 9f86d0...  ← same hash again

Three languages. One identity. No one translated — they wrote originals.

What it enables

bb.py is a tool for sharing content-addressed knowledge that is verifiable, maintainable, and preserves authorship and lineage.

  • Think in your language — variable names and documentation in your native tongue, without penalty
  • Share across languages — retrieve any function in any language with bb show hash@lang
  • Verify identity — same logic always produces the same hash, no matter who wrote it or in what language
  • Preserve lineage — every function is traceable; who made what, who built on whom
  • Compose and build — functions import other pool functions; dependencies are tracked, compiled, and runnable
  • Single file, zero dependencies — the entire tool is one Python file

How it works

Source code → Parse to AST → Normalize → Hash → Store

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.

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).

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.

Install

# Using pip
pip install git+https://github.com/amirouche/bb.py.git

# Using uv
uv tool install git+https://github.com/amirouche/bb.py.git

Requires Python 3.11+. No runtime dependencies.

Vision

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.

Related Work

  • Unison — content-addressable code where the hash is the identity
  • Abstract Wikipedia — multilingual knowledge representation that separates meaning from language
  • Situational application — local, contextual solutions (also known as Situated Software)
  • Non-English-based programming languagesWikipedia overview
  • Content-addressed storage — Git, IPFS, Nix
  • Multilingual programming — Racket's #lang system, Babylonian programming

See Also

  • transcripts/ — walkthrough sessions showing Beyond Babel in action
  • LIMITS.md — known limitations and research questions

"The limits of my language mean the limits of my world." — Ludwig Wittgenstein

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beyondbabel-0.2.0.tar.gz (50.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beyondbabel-0.2.0-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

Details for the file beyondbabel-0.2.0.tar.gz.

File metadata

  • Download URL: beyondbabel-0.2.0.tar.gz
  • Upload date:
  • Size: 50.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for beyondbabel-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dfdc7aeadf7aada9c9f5b6cb66399804158c61007ead3ae376004f1fbb0031df
MD5 8be804b4d663f516fcf638d52ad7ea30
BLAKE2b-256 af55405b4e8ed58359fb5195ed5f158f95be0d13ef63b05e50915810fcc8a530

See more details on using hashes here.

File details

Details for the file beyondbabel-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: beyondbabel-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for beyondbabel-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f25ae45b86ea9abc5738951abbe00f5bf2bfc00658be9ac6b3af17841a22eb0
MD5 34b9057cd0432054ffbb9e6cab555704
BLAKE2b-256 bd693badaf8f38ff0b995006123e6812ebaea9a1b3be24c9678e2c878f4746c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page