overlay.language 0.2.0.post2.dev0__tar.gz → 0.2.0.post4.dev0__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.
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/PKG-INFO +1 -1
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/docs/conf.py +1 -0
- overlay_language-0.2.0.post4.dev0/docs/index.rst +60 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/docs/overlay-language-tutorial.rst +7 -6
- overlay_language-0.2.0.post2.dev0/docs/index.rst +0 -26
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/.gitignore +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/README.md +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/docs/Makefile +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/docs/installation.rst +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/docs/specification.md +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/docs/tutorial.rst +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/pyproject.toml +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/src/overlay/language/__init__.py +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/src/overlay/language/_config.py +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/src/overlay/language/_core.py +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/src/overlay/language/_interned_linked_list.py +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/src/overlay/language/_mixin_directory.py +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/src/overlay/language/_mixin_parser.py +0 -0
- {overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/src/overlay/language/_runtime.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: overlay.language
|
|
3
|
-
Version: 0.2.0.
|
|
3
|
+
Version: 0.2.0.post4.dev0
|
|
4
4
|
Summary: A dependency injection framework with pytest-fixture syntax, plus a configuration language for declarative programming
|
|
5
5
|
Project-URL: Repository, https://github.com/Atry/overlay
|
|
6
6
|
Author-email: "Yang, Bo" <yang-bo@yang-bo.com>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Overlay Language
|
|
2
|
+
================
|
|
3
|
+
|
|
4
|
+
``overlay.language`` is a dependency injection framework with pytest-fixture
|
|
5
|
+
syntax, plus a configuration language for declarative programming. The package
|
|
6
|
+
has two parts:
|
|
7
|
+
|
|
8
|
+
The **Python decorator API** (``@scope``, ``@extern``, ``@resource``) gives you
|
|
9
|
+
dependency injection with pytest-fixture syntax — declare what a function needs
|
|
10
|
+
and the framework wires it up. Each module owns only its own concern; cross-
|
|
11
|
+
cutting behaviour layers on via ``@patch`` without touching the original code.
|
|
12
|
+
App-scoped singletons and per-request resources coexist naturally.
|
|
13
|
+
See :doc:`tutorial`.
|
|
14
|
+
|
|
15
|
+
The **Overlay language** is a configuration language written in ``.oyaml`` /
|
|
16
|
+
``.ojson`` / ``.otoml`` files. SQL queries, format strings, URL patterns — all
|
|
17
|
+
the business decisions that clutter Python code — live in the Overlay language
|
|
18
|
+
instead, where independent modules deep-merge by name without glue code —
|
|
19
|
+
dissolving the
|
|
20
|
+
`Expression Problem <https://en.wikipedia.org/wiki/Expression_problem>`_.
|
|
21
|
+
|
|
22
|
+
If you have ever struggled to mock a service that tangles I/O with business
|
|
23
|
+
logic, or dreaded porting an application from sync to async, or needed to swap
|
|
24
|
+
between providers without rewriting half your Python — the Overlay language can
|
|
25
|
+
help. It is also a statically typed modern programming language based on
|
|
26
|
+
`Overlay-Calculus <https://arxiv.org/abs/2602.16291>`_, which is provably more
|
|
27
|
+
expressive than λ-calculus, so it can express your entire business logic — not
|
|
28
|
+
just configuration. Move that logic into the Overlay language and Python reduces
|
|
29
|
+
to thin I/O adapters that are trivial to mock or replace. The same Overlay code runs against any set of adapters and the business logic
|
|
30
|
+
never changes, even when you
|
|
31
|
+
port your synchronous program to async — the problem known as
|
|
32
|
+
`function colour <https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/>`_.
|
|
33
|
+
See :doc:`overlay-language-tutorial`.
|
|
34
|
+
|
|
35
|
+
:doc:`installation`
|
|
36
|
+
Install the package from PyPI.
|
|
37
|
+
|
|
38
|
+
:doc:`tutorial`
|
|
39
|
+
Getting started with the Python decorator API — build a web application
|
|
40
|
+
step by step using ``@scope``, ``@extern``, and ``@resource``.
|
|
41
|
+
|
|
42
|
+
:doc:`overlay-language-tutorial`
|
|
43
|
+
Getting started with the Overlay language — rewrite the same application
|
|
44
|
+
in ``.oyaml``, separating business logic from I/O, then switch the
|
|
45
|
+
underlying framework to asyncio without changing your code.
|
|
46
|
+
|
|
47
|
+
:doc:`specification`
|
|
48
|
+
Full language specification for the Overlay language.
|
|
49
|
+
|
|
50
|
+
`API Reference <api/overlay.language.html>`__
|
|
51
|
+
Python API reference (auto-generated).
|
|
52
|
+
|
|
53
|
+
.. toctree::
|
|
54
|
+
:hidden:
|
|
55
|
+
|
|
56
|
+
installation
|
|
57
|
+
tutorial
|
|
58
|
+
overlay-language-tutorial
|
|
59
|
+
specification
|
|
60
|
+
API Reference <api/overlay.language>
|
|
@@ -21,11 +21,12 @@ The Overlay language solves this by separating the application into three layers
|
|
|
21
21
|
per operation (``sqlite3.connect``, ``str.split``, ``wfile.write``). Each adapter
|
|
22
22
|
declares its inputs as ``@extern`` and exposes a single ``@public @resource``
|
|
23
23
|
output. The adapter contains **zero business logic**.
|
|
24
|
-
- **``.oyaml`` files** contain all application logic
|
|
25
|
-
|
|
26
|
-
scopes, deep-merge composition,
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
- **``.oyaml`` files** contain all application logic, written in the Overlay
|
|
25
|
+
language. The Overlay language is not just a configuration format — it is a
|
|
26
|
+
complete language with lexical scoping, nested scopes, deep-merge composition,
|
|
27
|
+
and lazy evaluation. These features make it more natural than Python for
|
|
28
|
+
expressing business logic, which is inherently declarative ("the user ID is
|
|
29
|
+
the last URL segment", "the response format is
|
|
29
30
|
``total={total} current={current}``").
|
|
30
31
|
- **Configuration values** (SQL queries, format strings, host/port) are pure
|
|
31
32
|
YAML scalars, gathered in one place.
|
|
@@ -282,7 +283,7 @@ Python vs Overlay language
|
|
|
282
283
|
|
|
283
284
|
* - Aspect
|
|
284
285
|
- Python ``@scope``
|
|
285
|
-
- ``.oyaml``
|
|
286
|
+
- Overlay language (``.oyaml``)
|
|
286
287
|
* - Composition
|
|
287
288
|
- Manual ``@extend`` + ``RelativeReference``
|
|
288
289
|
- Inheritance list: ``- [Parent]``
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Overlay Language
|
|
2
|
-
================
|
|
3
|
-
|
|
4
|
-
A dependency injection framework with pytest-fixture syntax, plus a
|
|
5
|
-
configuration language for declarative programming.
|
|
6
|
-
|
|
7
|
-
The configuration language is designed for modularity — independent modules
|
|
8
|
-
compose freely without glue code, dissolving the
|
|
9
|
-
`Expression Problem <https://en.wikipedia.org/wiki/Expression_problem>`_.
|
|
10
|
-
If you prefer declarative programming, you can even move all your business logic
|
|
11
|
-
from Python into the Overlay language — it is based on
|
|
12
|
-
`Overlay-Calculus <https://arxiv.org/abs/2602.16291>`_, which is provably more
|
|
13
|
-
expressive than λ-calculus. As a bonus, your Python code
|
|
14
|
-
reduces to thin I/O adapters, trivially mockable, and the same Overlay language
|
|
15
|
-
code runs unchanged on both sync and async runtimes
|
|
16
|
-
(a.k.a. `function-color <https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/>`_-blind).
|
|
17
|
-
|
|
18
|
-
.. toctree::
|
|
19
|
-
:maxdepth: 2
|
|
20
|
-
:caption: Contents:
|
|
21
|
-
|
|
22
|
-
installation
|
|
23
|
-
tutorial
|
|
24
|
-
overlay-language-tutorial
|
|
25
|
-
specification
|
|
26
|
-
API Reference <api/overlay.language>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/docs/installation.rst
RENAMED
|
File without changes
|
{overlay_language-0.2.0.post2.dev0 → overlay_language-0.2.0.post4.dev0}/docs/specification.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|