dagr-cli 2026.9.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.
- dagr_cli-2026.9.0/LICENSE +287 -0
- dagr_cli-2026.9.0/PKG-INFO +140 -0
- dagr_cli-2026.9.0/README.md +115 -0
- dagr_cli-2026.9.0/dagr/__init__.py +10 -0
- dagr_cli-2026.9.0/dagr/cli.py +2311 -0
- dagr_cli-2026.9.0/dagr/codegen/__init__.py +0 -0
- dagr_cli-2026.9.0/dagr/codegen/api.py +38 -0
- dagr_cli-2026.9.0/dagr/codegen/go/__init__.py +0 -0
- dagr_cli-2026.9.0/dagr/codegen/go/arena.py +988 -0
- dagr_cli-2026.9.0/dagr/codegen/go/core.py +2320 -0
- dagr_cli-2026.9.0/dagr/codegen/go/defaults.py +136 -0
- dagr_cli-2026.9.0/dagr/codegen/go/direct.py +192 -0
- dagr_cli-2026.9.0/dagr/codegen/go/graphs.py +55 -0
- dagr_cli-2026.9.0/dagr/codegen/go/naming.py +116 -0
- dagr_cli-2026.9.0/dagr/codegen/go/serde.py +1159 -0
- dagr_cli-2026.9.0/dagr/codegen/go/sharedbuffer.py +927 -0
- dagr_cli-2026.9.0/dagr/codegen/go/sink.py +715 -0
- dagr_cli-2026.9.0/dagr/codegen/go/validate.py +220 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/__init__.py +0 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/arena.py +2310 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/core.py +1130 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/defaults.py +348 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/direct.py +470 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/frozen.py +214 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/packed.py +1355 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/path_query.py +1365 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/restore.py +546 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/serde.py +1679 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/sharedbuffer.py +1532 -0
- dagr_cli-2026.9.0/dagr/codegen/mojo/sink.py +1257 -0
- dagr_cli-2026.9.0/dagr/codegen/odin/__init__.py +0 -0
- dagr_cli-2026.9.0/dagr/codegen/odin/arena.py +1594 -0
- dagr_cli-2026.9.0/dagr/codegen/odin/core.py +2278 -0
- dagr_cli-2026.9.0/dagr/codegen/odin/serde.py +1945 -0
- dagr_cli-2026.9.0/dagr/codegen/odin/sharedbuffer.py +1345 -0
- dagr_cli-2026.9.0/dagr/codegen/odin/sink.py +896 -0
- dagr_cli-2026.9.0/dagr/codegen/python.py +473 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/__init__.py +0 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/arrow.py +632 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/arrow_lazy.py +1339 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/core.py +1548 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/direct.py +1209 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/explain.py +2105 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/fuzz.py +364 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/git_tools.py +2965 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/imhex.py +155 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/lazy.py +3073 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/path_query.py +2903 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/serde.py +8886 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/sharedbuffer.py +2212 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/sharedbuffer_fuzz.py +357 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/sink.py +3164 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/sink_arrow.py +1620 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/sink_fuzz.py +412 -0
- dagr_cli-2026.9.0/dagr/codegen/rust/types.py +353 -0
- dagr_cli-2026.9.0/dagr/codegen/shared.py +840 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/__init__.py +0 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/core.py +5269 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/direct.py +295 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/explain.py +2534 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/lazy.py +3113 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/path_query.py +2046 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/serde.py +3457 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/sharedbuffer.py +1584 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/sharedbuffer_explain.py +598 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/sink.py +2299 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/sink_explain.py +239 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/types.py +473 -0
- dagr_cli-2026.9.0/dagr/codegen/swift/union_emit.py +380 -0
- dagr_cli-2026.9.0/dagr/codegen/typescript/__init__.py +0 -0
- dagr_cli-2026.9.0/dagr/codegen/typescript/arena.py +1002 -0
- dagr_cli-2026.9.0/dagr/codegen/typescript/direct.py +186 -0
- dagr_cli-2026.9.0/dagr/codegen/typescript/graph_explorer.py +2448 -0
- dagr_cli-2026.9.0/dagr/codegen/typescript/lazy.py +1839 -0
- dagr_cli-2026.9.0/dagr/codegen/typescript/serde.py +1428 -0
- dagr_cli-2026.9.0/dagr/codegen/typescript/sharedbuffer.py +1600 -0
- dagr_cli-2026.9.0/dagr/codegen/typescript/sink.py +1202 -0
- dagr_cli-2026.9.0/dagr/codegen/typescript/sink_explorer.py +1788 -0
- dagr_cli-2026.9.0/dagr/config.py +223 -0
- dagr_cli-2026.9.0/dagr/dot.py +105 -0
- dagr_cli-2026.9.0/dagr/dsl.py +3101 -0
- dagr_cli-2026.9.0/dagr/favicons.py +5 -0
- dagr_cli-2026.9.0/dagr/importers/__init__.py +0 -0
- dagr_cli-2026.9.0/dagr/importers/asn1.py +781 -0
- dagr_cli-2026.9.0/dagr/importers/flatbuffers.py +869 -0
- dagr_cli-2026.9.0/dagr/importers/json_schema.py +969 -0
- dagr_cli-2026.9.0/dagr/importers/proto.py +1268 -0
- dagr_cli-2026.9.0/dagr/ir.py +495 -0
- dagr_cli-2026.9.0/dagr/layout.py +896 -0
- dagr_cli-2026.9.0/dagr/receipt.py +240 -0
- dagr_cli-2026.9.0/dagr/reserved_names.py +170 -0
- dagr_cli-2026.9.0/dagr/runtime/__init__.py +13 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_arrow.py +528 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_defaults.py +143 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_model.py +111 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_reader.py +264 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_restore.py +963 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_sb_concurrency.py +194 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_sb_fork_c.py +173 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_sb_reader.py +328 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_sb_typed.py +83 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_serialize.py +827 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_sink.py +359 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_typed.py +170 -0
- dagr_cli-2026.9.0/dagr/runtime/dagr_writer.py +958 -0
- dagr_cli-2026.9.0/dagr/sb_writer.py +607 -0
- dagr_cli-2026.9.0/dagr/test_data.py +229 -0
- dagr_cli-2026.9.0/dagr/theme.py +296 -0
- dagr_cli-2026.9.0/dagr/web_ui/__init__.py +0 -0
- dagr_cli-2026.9.0/dagr/web_ui/apple-touch-icon.png +0 -0
- dagr_cli-2026.9.0/dagr/web_ui/favicon.ico +0 -0
- dagr_cli-2026.9.0/dagr/web_ui/index.html +1464 -0
- dagr_cli-2026.9.0/dagr/web_ui/model.py +692 -0
- dagr_cli-2026.9.0/dagr/web_ui/server.py +640 -0
- dagr_cli-2026.9.0/dagr_cli.egg-info/PKG-INFO +140 -0
- dagr_cli-2026.9.0/dagr_cli.egg-info/SOURCES.txt +132 -0
- dagr_cli-2026.9.0/dagr_cli.egg-info/dependency_links.txt +1 -0
- dagr_cli-2026.9.0/dagr_cli.egg-info/entry_points.txt +2 -0
- dagr_cli-2026.9.0/dagr_cli.egg-info/requires.txt +3 -0
- dagr_cli-2026.9.0/dagr_cli.egg-info/top_level.txt +1 -0
- dagr_cli-2026.9.0/pyproject.toml +82 -0
- dagr_cli-2026.9.0/setup.cfg +4 -0
- dagr_cli-2026.9.0/targets/go/dagr/reader.go +547 -0
- dagr_cli-2026.9.0/targets/go/dagr/writer.go +2029 -0
- dagr_cli-2026.9.0/targets/mojo/fork_c/dagr_fork_c.mojo +175 -0
- dagr_cli-2026.9.0/targets/mojo/fork_c/fork_c_2proc.py +140 -0
- dagr_cli-2026.9.0/targets/mojo/fork_c/fork_c_gate.py +127 -0
- dagr_cli-2026.9.0/targets/mojo/fork_c/sb_fork_c_gate.py +58 -0
- dagr_cli-2026.9.0/targets/mojo/src/dagr_reader.mojo +1173 -0
- dagr_cli-2026.9.0/targets/mojo/src/dagr_writer.mojo +1315 -0
- dagr_cli-2026.9.0/targets/odin/src/dagr_reader.odin +378 -0
- dagr_cli-2026.9.0/targets/odin/src/dagr_writer.odin +888 -0
- dagr_cli-2026.9.0/targets/typescript/src/dagr_reader.ts +810 -0
- dagr_cli-2026.9.0/targets/typescript/src/dagr_writer.ts +944 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
---------------------------------------------------------------------------
|
|
206
|
+
|
|
207
|
+
Copyright 2026 Maxim Zaks
|
|
208
|
+
|
|
209
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
210
|
+
this software except in compliance with the License. You may obtain a copy of
|
|
211
|
+
the License at
|
|
212
|
+
|
|
213
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
214
|
+
|
|
215
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
216
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
217
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
218
|
+
specific language governing permissions and limitations under the License.
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
---------------------------------------------------------------------------
|
|
222
|
+
DAGR GENERATED OUTPUT EXCEPTION
|
|
223
|
+
Version 1.0
|
|
224
|
+
---------------------------------------------------------------------------
|
|
225
|
+
|
|
226
|
+
In plain language: Dagr is a code generator. Code it emits for you is yours to
|
|
227
|
+
use however you like. You do not have to ship this license with it, credit
|
|
228
|
+
Dagr in it, or take on any other obligation because of it.
|
|
229
|
+
|
|
230
|
+
The formal terms follow.
|
|
231
|
+
|
|
232
|
+
1. Definitions.
|
|
233
|
+
|
|
234
|
+
"Generators" means the Dagr code generators, schema DSL, command-line tools
|
|
235
|
+
and supporting tooling distributed in this repository.
|
|
236
|
+
|
|
237
|
+
"Generated Output" means source code, data files, schemas, test fixtures and
|
|
238
|
+
documentation produced by running the Generators, including any portion of
|
|
239
|
+
the runtime source embedded in the Generators that the Generators copy,
|
|
240
|
+
verbatim or with substitution, into their output.
|
|
241
|
+
|
|
242
|
+
2. Grant of exception.
|
|
243
|
+
|
|
244
|
+
As an exception to the conditions stated in Section 4 of the License, the
|
|
245
|
+
copyright holder grants You permission to reproduce, prepare derivative
|
|
246
|
+
works of, publicly display, publicly perform, sublicense and distribute
|
|
247
|
+
Generated Output, in Source or Object form, with or without modification,
|
|
248
|
+
for any purpose, without complying with any of the conditions in Section 4
|
|
249
|
+
of the License. In particular, You are not required to:
|
|
250
|
+
|
|
251
|
+
(a) include a copy of the License with Generated Output;
|
|
252
|
+
(b) reproduce the contents of any NOTICE file in Generated Output or in
|
|
253
|
+
any work incorporating it;
|
|
254
|
+
(c) carry prominent notices stating that You changed Generated Output; or
|
|
255
|
+
(d) attribute Dagr or the copyright holder in Generated Output, in any
|
|
256
|
+
work incorporating it, or in any documentation accompanying either.
|
|
257
|
+
|
|
258
|
+
Generated Output may be combined with works under any license, including
|
|
259
|
+
proprietary licenses, and may be distributed under terms of Your choosing.
|
|
260
|
+
|
|
261
|
+
3. Patent grant preserved.
|
|
262
|
+
|
|
263
|
+
Nothing in this exception limits or revokes the grant of patent license in
|
|
264
|
+
Section 3 of the License. That grant continues to apply to the Generators
|
|
265
|
+
and to Generated Output, together with the termination conditions stated in
|
|
266
|
+
that Section.
|
|
267
|
+
|
|
268
|
+
4. Warranty and liability.
|
|
269
|
+
|
|
270
|
+
Sections 7 and 8 of the License (Disclaimer of Warranty; Limitation of
|
|
271
|
+
Liability) apply to Generated Output as they apply to the Generators.
|
|
272
|
+
|
|
273
|
+
5. Scope.
|
|
274
|
+
|
|
275
|
+
This exception applies only to Generated Output. The Generators themselves
|
|
276
|
+
remain licensed under the Apache License, Version 2.0 without exception;
|
|
277
|
+
copying, modifying and distributing the Generators is governed solely by
|
|
278
|
+
that License.
|
|
279
|
+
|
|
280
|
+
6. Marking.
|
|
281
|
+
|
|
282
|
+
No marking of Generated Output is required. This exception is not a
|
|
283
|
+
registered SPDX License Exception, so there is no standard SPDX expression
|
|
284
|
+
for it; where a machine-readable marker is wanted, referencing this file by
|
|
285
|
+
name is sufficient.
|
|
286
|
+
|
|
287
|
+
---------------------------------------------------------------------------
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dagr-cli
|
|
3
|
+
Version: 2026.9.0
|
|
4
|
+
Summary: Dagr — data-graph binary serialization: schema DSL, code generators for Swift, Rust, TypeScript, Go, Mojo, Odin and Python, and receipt/compatibility tooling
|
|
5
|
+
Author: Maxim Zaks
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://codeberg.org/mzaks/dagr
|
|
8
|
+
Project-URL: Repository, https://codeberg.org/mzaks/dagr
|
|
9
|
+
Project-URL: Changelog, https://codeberg.org/mzaks/dagr/src/branch/main/CHANGELOG.md
|
|
10
|
+
Keywords: serialization,binary-format,code-generation,arena,graph,zero-copy
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Rust
|
|
15
|
+
Classifier: Programming Language :: JavaScript
|
|
16
|
+
Classifier: Programming Language :: Go
|
|
17
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
18
|
+
Classifier: Topic :: System :: Archiving
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Provides-Extra: asn1
|
|
23
|
+
Requires-Dist: asn1tools; extra == "asn1"
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# Dagr
|
|
27
|
+
|
|
28
|
+
**Dagr** ("Data Graph") is a binary serialization format for **data graphs** — object graphs
|
|
29
|
+
with cycles and shared nodes — and a set of **code generators** that emit a complete,
|
|
30
|
+
self-contained implementation of your schema for Swift, Rust, TypeScript, Go, Mojo, Odin and
|
|
31
|
+
Python.
|
|
32
|
+
|
|
33
|
+
You describe a graph once, in a small Python DSL:
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from dagr.dsl import DataGraph, Node, Enum, t, required
|
|
37
|
+
from dagr.config import Library, Swift, Rust
|
|
38
|
+
|
|
39
|
+
address_book = DataGraph("AddressBook", root_type=t.ref("Book"), node_types=[
|
|
40
|
+
Node("Book", fields=["people" >> t.ref("Person").array]),
|
|
41
|
+
Node("Person", fields=[
|
|
42
|
+
"name" >> t.utf8 >> required,
|
|
43
|
+
"age" >> t.u8,
|
|
44
|
+
"friends" >> t.ref("Person").array, # cycles and shared nodes are fine
|
|
45
|
+
"status" >> t.ref("Status"),
|
|
46
|
+
]),
|
|
47
|
+
Enum("Status", ["single", "married", "widowed"]),
|
|
48
|
+
])
|
|
49
|
+
|
|
50
|
+
library = Library("AddressBook", schemas=[address_book], targets=[
|
|
51
|
+
Swift(out="gen/swift", features=["lazy", "path_query", "explain"]),
|
|
52
|
+
Rust(out="gen/rust", features=["lazy", "path_query"]),
|
|
53
|
+
], wire_format_version=1)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`dagr build` then generates, per language, an **arena**-backed typed API (no reference
|
|
57
|
+
cycles to leak, value-type handles), byte-exact serialization and restore, and optionally
|
|
58
|
+
zero-allocation **lazy accessors**, **path queries** that read one field straight out of a
|
|
59
|
+
buffer, and an **explain** tool that annotates every byte. The generated code has no runtime
|
|
60
|
+
dependency — the runtime is emitted alongside it.
|
|
61
|
+
|
|
62
|
+
## Why Dagr
|
|
63
|
+
|
|
64
|
+
- **Graphs, not trees.** Cycles, back-references and shared nodes serialize naturally; the
|
|
65
|
+
arena model is what makes that safe in every target language.
|
|
66
|
+
- **One schema, seven languages, identical bytes.** Swift, Rust, TypeScript, Go, Mojo, Odin
|
|
67
|
+
and Python read and write the same buffers; a cross-language test corpus of ~1000 fixture
|
|
68
|
+
permutations gates every change byte-for-byte.
|
|
69
|
+
- **Four node layouts to choose from.** Regular (vtable, evolvable), packed (compact),
|
|
70
|
+
frozen (fixed-offset, O(1) reads) and frozen+packed — per node type, per schema
|
|
71
|
+
(`spec/16-choosing-a-node-layout.md`).
|
|
72
|
+
- **More than graphs.** `DataSink` is an append-only record stream with the same type system
|
|
73
|
+
(logs, event streams, attestable audit trails); `SharedBuffer` is a fixed-layout overlay for
|
|
74
|
+
IPC, GPU and no-allocation embedded use, with seqlock, ring and double-buffer strategies.
|
|
75
|
+
- **Tooling around the format.** Schema import from `.proto`, FlatBuffers, JSON Schema and
|
|
76
|
+
ASN.1; generation receipts and compatibility checks (`dagr check`); a browser schema editor
|
|
77
|
+
(`dagr ui`); self-contained HTML explorers for any buffer; git diff and three-way merge
|
|
78
|
+
drivers; an ImHex pattern exporter; a fuzzer; Arrow producers.
|
|
79
|
+
|
|
80
|
+
## Install
|
|
81
|
+
|
|
82
|
+
The tool is pure Python 3.9+ with no dependencies.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install dagr-cli # or: uv tool install dagr-cli; from a checkout: pip install -e .
|
|
86
|
+
dagr init --name my_schema # scaffolds schema.py + pyproject.toml
|
|
87
|
+
dagr build # generates every target in Library.targets, writes dagr.lock.json
|
|
88
|
+
dagr check # diffs the schema against the committed receipt
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Compiling and running the generated code needs the respective toolchain (Swift 6.2, Rust
|
|
92
|
+
1.85+, Node 20+, Go 1.22+, Mojo 1.0 via pixi, Odin). Generating never does.
|
|
93
|
+
|
|
94
|
+
## Targets
|
|
95
|
+
|
|
96
|
+
| Target | Arena + serde | Lazy | Path query | Explain | DataSink | SharedBuffer | Notes |
|
|
97
|
+
|---|---|---|---|---|---|---|---|
|
|
98
|
+
| Swift | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | primary target |
|
|
99
|
+
| Rust | ✓ | ✓ | ✓ | ✓ (tooling) | ✓ | ✓ | primary target; `no_std` tiers, Arrow, fuzz, git tools |
|
|
100
|
+
| TypeScript | ✓ | ✓ | – | – | ✓ | ✓ | HTML explorers are generated TS |
|
|
101
|
+
| Go | ✓ | ✓ | – | – | ✓ | ✓ | direct builder; `io.Writer` sinks; `sync/atomic` SharedBuffer strategies |
|
|
102
|
+
| Mojo | ✓ | ✓ | ✓ | – | ✓ | ✓ (+GPU) | |
|
|
103
|
+
| Odin | ✓ | ✓ | – | – | ✓ | ✓ | |
|
|
104
|
+
| Python | ✓ (reflective) | – | – | – | ✓ | ✓ (numpy zero-copy) | plus a native Arrow target |
|
|
105
|
+
|
|
106
|
+
## Documentation
|
|
107
|
+
|
|
108
|
+
- `spec/` — the numbered wire-format specification and design plans; start with
|
|
109
|
+
`spec/README.md`, then `spec/01-motivation-for-arenas.md`.
|
|
110
|
+
- `docs/technical-feature-overview.md` — every feature with an engineering assessment.
|
|
111
|
+
- `examples/` — worked examples: an attested audit log, JWT-shaped tokens, a structured log
|
|
112
|
+
sink, a package registry, stress graphs, a Swift↔Rust FFI demo.
|
|
113
|
+
- `CONTRIBUTING.md` — repository layout, toolchains, and the generate → test loop.
|
|
114
|
+
|
|
115
|
+
## Repository layout
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
dagr/ the Python package: DSL, config, CLI, code generators, importers, runtime, web UI
|
|
119
|
+
spec/ numbered specification documents
|
|
120
|
+
targets/ per-language runtimes, example packages and generated test crates
|
|
121
|
+
tests/ test generators, runners, unit tests, fixture schemas and (generated) fixture corpora
|
|
122
|
+
examples/ worked examples built with `dagr build`
|
|
123
|
+
benchmarks/ micro-benchmarks
|
|
124
|
+
site/ showcase site and spec-document generators
|
|
125
|
+
docs/ prose documentation, blog posts, images
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Generated code is not committed. After cloning, run `./regen_all.sh` once to emit every
|
|
129
|
+
generated source, fixture and test suite (see `CONTRIBUTING.md`).
|
|
130
|
+
|
|
131
|
+
## Status
|
|
132
|
+
|
|
133
|
+
Dagr is used in production-style projects by its author and is versioned by CalVer
|
|
134
|
+
(`2026.9.0`); the wire format is versioned separately per schema (`wire_format_version`) and
|
|
135
|
+
checked by `dagr check`. Swift and Rust are the most complete targets; see `CHANGELOG.md` for
|
|
136
|
+
what changed and `spec/30-deferred-codegen-gaps.md` for known gaps per target.
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
Apache License 2.0 — see `LICENSE`.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Dagr
|
|
2
|
+
|
|
3
|
+
**Dagr** ("Data Graph") is a binary serialization format for **data graphs** — object graphs
|
|
4
|
+
with cycles and shared nodes — and a set of **code generators** that emit a complete,
|
|
5
|
+
self-contained implementation of your schema for Swift, Rust, TypeScript, Go, Mojo, Odin and
|
|
6
|
+
Python.
|
|
7
|
+
|
|
8
|
+
You describe a graph once, in a small Python DSL:
|
|
9
|
+
|
|
10
|
+
```python
|
|
11
|
+
from dagr.dsl import DataGraph, Node, Enum, t, required
|
|
12
|
+
from dagr.config import Library, Swift, Rust
|
|
13
|
+
|
|
14
|
+
address_book = DataGraph("AddressBook", root_type=t.ref("Book"), node_types=[
|
|
15
|
+
Node("Book", fields=["people" >> t.ref("Person").array]),
|
|
16
|
+
Node("Person", fields=[
|
|
17
|
+
"name" >> t.utf8 >> required,
|
|
18
|
+
"age" >> t.u8,
|
|
19
|
+
"friends" >> t.ref("Person").array, # cycles and shared nodes are fine
|
|
20
|
+
"status" >> t.ref("Status"),
|
|
21
|
+
]),
|
|
22
|
+
Enum("Status", ["single", "married", "widowed"]),
|
|
23
|
+
])
|
|
24
|
+
|
|
25
|
+
library = Library("AddressBook", schemas=[address_book], targets=[
|
|
26
|
+
Swift(out="gen/swift", features=["lazy", "path_query", "explain"]),
|
|
27
|
+
Rust(out="gen/rust", features=["lazy", "path_query"]),
|
|
28
|
+
], wire_format_version=1)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`dagr build` then generates, per language, an **arena**-backed typed API (no reference
|
|
32
|
+
cycles to leak, value-type handles), byte-exact serialization and restore, and optionally
|
|
33
|
+
zero-allocation **lazy accessors**, **path queries** that read one field straight out of a
|
|
34
|
+
buffer, and an **explain** tool that annotates every byte. The generated code has no runtime
|
|
35
|
+
dependency — the runtime is emitted alongside it.
|
|
36
|
+
|
|
37
|
+
## Why Dagr
|
|
38
|
+
|
|
39
|
+
- **Graphs, not trees.** Cycles, back-references and shared nodes serialize naturally; the
|
|
40
|
+
arena model is what makes that safe in every target language.
|
|
41
|
+
- **One schema, seven languages, identical bytes.** Swift, Rust, TypeScript, Go, Mojo, Odin
|
|
42
|
+
and Python read and write the same buffers; a cross-language test corpus of ~1000 fixture
|
|
43
|
+
permutations gates every change byte-for-byte.
|
|
44
|
+
- **Four node layouts to choose from.** Regular (vtable, evolvable), packed (compact),
|
|
45
|
+
frozen (fixed-offset, O(1) reads) and frozen+packed — per node type, per schema
|
|
46
|
+
(`spec/16-choosing-a-node-layout.md`).
|
|
47
|
+
- **More than graphs.** `DataSink` is an append-only record stream with the same type system
|
|
48
|
+
(logs, event streams, attestable audit trails); `SharedBuffer` is a fixed-layout overlay for
|
|
49
|
+
IPC, GPU and no-allocation embedded use, with seqlock, ring and double-buffer strategies.
|
|
50
|
+
- **Tooling around the format.** Schema import from `.proto`, FlatBuffers, JSON Schema and
|
|
51
|
+
ASN.1; generation receipts and compatibility checks (`dagr check`); a browser schema editor
|
|
52
|
+
(`dagr ui`); self-contained HTML explorers for any buffer; git diff and three-way merge
|
|
53
|
+
drivers; an ImHex pattern exporter; a fuzzer; Arrow producers.
|
|
54
|
+
|
|
55
|
+
## Install
|
|
56
|
+
|
|
57
|
+
The tool is pure Python 3.9+ with no dependencies.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install dagr-cli # or: uv tool install dagr-cli; from a checkout: pip install -e .
|
|
61
|
+
dagr init --name my_schema # scaffolds schema.py + pyproject.toml
|
|
62
|
+
dagr build # generates every target in Library.targets, writes dagr.lock.json
|
|
63
|
+
dagr check # diffs the schema against the committed receipt
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Compiling and running the generated code needs the respective toolchain (Swift 6.2, Rust
|
|
67
|
+
1.85+, Node 20+, Go 1.22+, Mojo 1.0 via pixi, Odin). Generating never does.
|
|
68
|
+
|
|
69
|
+
## Targets
|
|
70
|
+
|
|
71
|
+
| Target | Arena + serde | Lazy | Path query | Explain | DataSink | SharedBuffer | Notes |
|
|
72
|
+
|---|---|---|---|---|---|---|---|
|
|
73
|
+
| Swift | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | primary target |
|
|
74
|
+
| Rust | ✓ | ✓ | ✓ | ✓ (tooling) | ✓ | ✓ | primary target; `no_std` tiers, Arrow, fuzz, git tools |
|
|
75
|
+
| TypeScript | ✓ | ✓ | – | – | ✓ | ✓ | HTML explorers are generated TS |
|
|
76
|
+
| Go | ✓ | ✓ | – | – | ✓ | ✓ | direct builder; `io.Writer` sinks; `sync/atomic` SharedBuffer strategies |
|
|
77
|
+
| Mojo | ✓ | ✓ | ✓ | – | ✓ | ✓ (+GPU) | |
|
|
78
|
+
| Odin | ✓ | ✓ | – | – | ✓ | ✓ | |
|
|
79
|
+
| Python | ✓ (reflective) | – | – | – | ✓ | ✓ (numpy zero-copy) | plus a native Arrow target |
|
|
80
|
+
|
|
81
|
+
## Documentation
|
|
82
|
+
|
|
83
|
+
- `spec/` — the numbered wire-format specification and design plans; start with
|
|
84
|
+
`spec/README.md`, then `spec/01-motivation-for-arenas.md`.
|
|
85
|
+
- `docs/technical-feature-overview.md` — every feature with an engineering assessment.
|
|
86
|
+
- `examples/` — worked examples: an attested audit log, JWT-shaped tokens, a structured log
|
|
87
|
+
sink, a package registry, stress graphs, a Swift↔Rust FFI demo.
|
|
88
|
+
- `CONTRIBUTING.md` — repository layout, toolchains, and the generate → test loop.
|
|
89
|
+
|
|
90
|
+
## Repository layout
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
dagr/ the Python package: DSL, config, CLI, code generators, importers, runtime, web UI
|
|
94
|
+
spec/ numbered specification documents
|
|
95
|
+
targets/ per-language runtimes, example packages and generated test crates
|
|
96
|
+
tests/ test generators, runners, unit tests, fixture schemas and (generated) fixture corpora
|
|
97
|
+
examples/ worked examples built with `dagr build`
|
|
98
|
+
benchmarks/ micro-benchmarks
|
|
99
|
+
site/ showcase site and spec-document generators
|
|
100
|
+
docs/ prose documentation, blog posts, images
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Generated code is not committed. After cloning, run `./regen_all.sh` once to emit every
|
|
104
|
+
generated source, fixture and test suite (see `CONTRIBUTING.md`).
|
|
105
|
+
|
|
106
|
+
## Status
|
|
107
|
+
|
|
108
|
+
Dagr is used in production-style projects by its author and is versioned by CalVer
|
|
109
|
+
(`2026.9.0`); the wire format is versioned separately per schema (`wire_format_version`) and
|
|
110
|
+
checked by `dagr check`. Swift and Rust are the most complete targets; see `CHANGELOG.md` for
|
|
111
|
+
what changed and `spec/30-deferred-codegen-gaps.md` for known gaps per target.
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
Apache License 2.0 — see `LICENSE`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Dagr — data-graph binary serialization: schema DSL, code generators, and tooling.
|
|
2
|
+
|
|
3
|
+
Public schema-authoring surface: ``dagr.dsl`` and ``dagr.config``. Everything under
|
|
4
|
+
``dagr.codegen`` is the generator implementation; ``dagr.runtime`` is the reflective
|
|
5
|
+
pure-Python runtime that generated Python modules import. This module deliberately
|
|
6
|
+
imports nothing so that the shipped copy of the package inside a ``dagr build --target
|
|
7
|
+
python`` output stays self-contained.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
__version__ = "2026.9.0"
|