wirely 0.1.2__tar.gz → 0.1.3__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.
Files changed (355) hide show
  1. {wirely-0.1.2 → wirely-0.1.3}/CHANGELOG.md +36 -1
  2. {wirely-0.1.2/wirely.egg-info → wirely-0.1.3}/PKG-INFO +37 -8
  3. {wirely-0.1.2 → wirely-0.1.3}/README.md +34 -7
  4. {wirely-0.1.2 → wirely-0.1.3}/doc/README.md +6 -2
  5. {wirely-0.1.2 → wirely-0.1.3}/doc/bytecode-format.md +64 -72
  6. wirely-0.1.3/doc/compiler-stages.md +112 -0
  7. wirely-0.1.3/doc/diagram-layout.md +163 -0
  8. {wirely-0.1.2 → wirely-0.1.3}/doc/language.md +275 -117
  9. {wirely-0.1.2 → wirely-0.1.3}/doc/libraries.md +25 -16
  10. {wirely-0.1.2 → wirely-0.1.3}/doc/native-python.md +27 -24
  11. wirely-0.1.3/doc/tests.md +71 -0
  12. {wirely-0.1.2 → wirely-0.1.3}/doc/value-types.md +16 -16
  13. {wirely-0.1.2 → wirely-0.1.3}/doc/wirely-style.md +6 -2
  14. {wirely-0.1.2 → wirely-0.1.3}/examples/delay.wrl +1 -1
  15. {wirely-0.1.2 → wirely-0.1.3}/examples/test.wrl +5 -5
  16. {wirely-0.1.2 → wirely-0.1.3}/pyproject.toml +3 -2
  17. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/arithmetic.wrl +1 -1
  18. wirely-0.1.3/test/compiler/assertions.wrl +84 -0
  19. wirely-0.1.3/test/compiler/attributes.wrl +152 -0
  20. wirely-0.1.3/test/compiler/bitwise.wrl +106 -0
  21. wirely-0.1.3/test/compiler/blocks.wrl +146 -0
  22. wirely-0.1.3/test/compiler/connection_order.wrl +73 -0
  23. wirely-0.1.3/test/compiler/constant_expressions.wrl +79 -0
  24. wirely-0.1.3/test/compiler/length.wrl +121 -0
  25. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/library_settings.wrl +6 -6
  26. wirely-0.1.3/test/compiler/multi_procedures.wrl +102 -0
  27. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/runtime_limits.wrl +6 -0
  28. wirely-0.1.3/test/compiler/static_sources.wrl +33 -0
  29. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/syntax.wrl +42 -2
  30. wirely-0.1.3/test/compiler/type_stages.wrl +28 -0
  31. wirely-0.1.3/test/misc/grammar.py +10 -0
  32. wirely-0.1.3/test/negative/assertions.wrl +215 -0
  33. wirely-0.1.3/test/negative/attributes.wrl +331 -0
  34. wirely-0.1.3/test/negative/bitwise.wrl +135 -0
  35. wirely-0.1.3/test/negative/blocks.wrl +296 -0
  36. wirely-0.1.3/test/negative/connections.wrl +234 -0
  37. wirely-0.1.3/test/negative/constant_expressions.wrl +84 -0
  38. {wirely-0.1.2 → wirely-0.1.3}/test/negative/constants.wrl +28 -17
  39. {wirely-0.1.2 → wirely-0.1.3}/test/negative/enum_declarations.wrl +16 -0
  40. {wirely-0.1.2 → wirely-0.1.3}/test/negative/integer_literals.wrl +1 -1
  41. wirely-0.1.3/test/negative/length.wrl +156 -0
  42. {wirely-0.1.2 → wirely-0.1.3}/test/negative/library_settings.wrl +2 -2
  43. wirely-0.1.3/test/negative/multi_procedures.wrl +184 -0
  44. {wirely-0.1.2 → wirely-0.1.3}/test/negative/native_functions.wrl +5 -2
  45. {wirely-0.1.2 → wirely-0.1.3}/test/negative/native_initializers.wrl +12 -6
  46. {wirely-0.1.2 → wirely-0.1.3}/test/negative/native_procedures.wrl +8 -0
  47. wirely-0.1.3/test/negative/node_declarations.wrl +177 -0
  48. {wirely-0.1.2 → wirely-0.1.3}/test/negative/node_types.wrl +9 -7
  49. {wirely-0.1.2 → wirely-0.1.3}/test/negative/option_properties.wrl +4 -4
  50. {wirely-0.1.2 → wirely-0.1.3}/test/negative/optional_forwarding.wrl +0 -19
  51. {wirely-0.1.2 → wirely-0.1.3}/test/negative/optional_outputs.wrl +4 -4
  52. {wirely-0.1.2 → wirely-0.1.3}/test/negative/options.wrl +13 -8
  53. {wirely-0.1.2 → wirely-0.1.3}/test/negative/parameters.wrl +2 -0
  54. wirely-0.1.3/test/negative/path.wrl +19 -0
  55. {wirely-0.1.2 → wirely-0.1.3}/test/negative/prepared_configuration.wrl +1 -1
  56. wirely-0.1.3/test/negative/procedure_ports.wrl +225 -0
  57. {wirely-0.1.2 → wirely-0.1.3}/test/negative/procedures.wrl +74 -40
  58. {wirely-0.1.2 → wirely-0.1.3}/test/negative/resource_connections.wrl +10 -11
  59. {wirely-0.1.2 → wirely-0.1.3}/test/negative/resource_declarations.wrl +55 -0
  60. {wirely-0.1.2 → wirely-0.1.3}/test/negative/runtime_limits.wrl +2 -1
  61. {wirely-0.1.2 → wirely-0.1.3}/test/negative/state_connections.wrl +33 -8
  62. {wirely-0.1.2 → wirely-0.1.3}/test/negative/structs.wrl +23 -0
  63. {wirely-0.1.2 → wirely-0.1.3}/test/negative/syntax_lists.wrl +1 -1
  64. {wirely-0.1.2 → wirely-0.1.3}/test/negative/type_comparisons.wrl +0 -43
  65. {wirely-0.1.2 → wirely-0.1.3}/test/negative/weak_keywords.wrl +2 -2
  66. wirely-0.1.3/test/repo/files.py +28 -0
  67. wirely-0.1.3/test/unit/analysis.py +214 -0
  68. wirely-0.1.3/test/unit/compiler_api.py +74 -0
  69. {wirely-0.1.2 → wirely-0.1.3}/test/unit/container.py +4 -0
  70. wirely-0.1.3/test/unit/editing.py +581 -0
  71. wirely-0.1.3/test/unit/editor.py +229 -0
  72. wirely-0.1.3/test/unit/editor_export.py +56 -0
  73. wirely-0.1.3/test/unit/editor_widgets.py +511 -0
  74. wirely-0.1.3/test/unit/editor_workspace.py +348 -0
  75. wirely-0.1.3/test/unit/engine_wakeup.py +64 -0
  76. wirely-0.1.3/test/unit/engine_wakeup.wrl +4 -0
  77. {wirely-0.1.2 → wirely-0.1.3}/test/unit/instructions.py +79 -11
  78. {wirely-0.1.2 → wirely-0.1.3}/test/unit/library_configuration.py +29 -25
  79. wirely-0.1.3/test/unit/monotonic_timestamp.py +78 -0
  80. {wirely-0.1.2 → wirely-0.1.3}/test/unit/native_interface.py +135 -111
  81. {wirely-0.1.2 → wirely-0.1.3}/test/unit/native_values.py +14 -10
  82. {wirely-0.1.2 → wirely-0.1.3}/test/unit/negative_cases.py +98 -6
  83. wirely-0.1.3/test/unit/outline.py +121 -0
  84. {wirely-0.1.2 → wirely-0.1.3}/test/unit/procedures.py +156 -2
  85. {wirely-0.1.2 → wirely-0.1.3}/test/unit/procedures.wrl +163 -0
  86. {wirely-0.1.2 → wirely-0.1.3}/test/unit/resources.py +46 -19
  87. {wirely-0.1.2 → wirely-0.1.3}/test/unit/runtime_program.py +32 -6
  88. {wirely-0.1.2 → wirely-0.1.3}/test/unit/serialization.py +13 -9
  89. wirely-0.1.3/test/unit/shuffle.py +161 -0
  90. {wirely-0.1.2 → wirely-0.1.3}/test/unit/state_connections.py +130 -44
  91. wirely-0.1.3/test/unit/static_sources.py +41 -0
  92. wirely-0.1.3/test/unit/static_sources.wrl +36 -0
  93. {wirely-0.1.2 → wirely-0.1.3}/test/unit/test_resources.py +3 -3
  94. wirely-0.1.3/test/unit/test_runner.py +93 -0
  95. {wirely-0.1.2 → wirely-0.1.3}/test/unit/types.py +4 -0
  96. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/abb.py +4 -0
  97. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/and.py +4 -0
  98. wirely-0.1.3/test/wrl/bitwise.py +51 -0
  99. wirely-0.1.3/test/wrl/bitwise.wrl +99 -0
  100. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/csv.py +16 -16
  101. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/delay.py +4 -0
  102. {wirely-0.1.2/test/unit → wirely-0.1.3/test/wrl}/equality.py +4 -0
  103. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/flipflop.py +22 -22
  104. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/knx_time.py +1 -1
  105. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/knx_time.wrl +1 -1
  106. wirely-0.1.3/test/wrl/length.py +23 -0
  107. wirely-0.1.3/test/wrl/length.wrl +50 -0
  108. wirely-0.1.3/test/wrl/multi_forward.py +17 -0
  109. wirely-0.1.3/test/wrl/multi_forward.wrl +34 -0
  110. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/option.py +4 -0
  111. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/std.py +4 -0
  112. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/time.py +84 -69
  113. wirely-0.1.3/test/wrl/time.wrl +28 -0
  114. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/two_n.py +14 -14
  115. wirely-0.1.3/tools/run-tests +39 -0
  116. {wirely-0.1.2 → wirely-0.1.3}/wirely/__main__.py +11 -0
  117. {wirely-0.1.2 → wirely-0.1.3}/wirely/cli/client.py +10 -10
  118. {wirely-0.1.2 → wirely-0.1.3}/wirely/cli/compile_command.py +3 -3
  119. wirely-0.1.3/wirely/cli/edit.py +12 -0
  120. wirely-0.1.3/wirely/cli/export_image.py +37 -0
  121. {wirely-0.1.2 → wirely-0.1.3}/wirely/cli/graphviz.py +28 -28
  122. {wirely-0.1.2 → wirely-0.1.3}/wirely/cli/run.py +17 -18
  123. {wirely-0.1.2 → wirely-0.1.3}/wirely/cli/service.py +3 -4
  124. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/__init__.py +35 -47
  125. wirely-0.1.3/wirely/compiler/analysis.py +400 -0
  126. wirely-0.1.3/wirely/compiler/ast/__init__.py +90 -0
  127. wirely-0.1.3/wirely/compiler/ast/base.py +147 -0
  128. wirely-0.1.3/wirely/compiler/ast/functions.py +67 -0
  129. wirely-0.1.3/wirely/compiler/ast/library.py +82 -0
  130. wirely-0.1.3/wirely/compiler/ast/nodes.py +270 -0
  131. wirely-0.1.3/wirely/compiler/ast/parameter_declarations.py +108 -0
  132. wirely-0.1.3/wirely/compiler/ast/ports.py +106 -0
  133. wirely-0.1.3/wirely/compiler/ast/procedures.py +365 -0
  134. wirely-0.1.3/wirely/compiler/ast/scope.py +236 -0
  135. wirely-0.1.3/wirely/compiler/ast/specifiers.py +120 -0
  136. wirely-0.1.3/wirely/compiler/ast/type_declarations.py +193 -0
  137. wirely-0.1.3/wirely/compiler/ast/values.py +378 -0
  138. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/attributes.py +118 -40
  139. wirely-0.1.3/wirely/compiler/coordinator.py +165 -0
  140. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/diagnostics.py +14 -3
  141. wirely-0.1.3/wirely/compiler/editing.py +1166 -0
  142. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/expressions.py +681 -193
  143. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/function_implementations/knx.py +7 -7
  144. wirely-0.1.3/wirely/compiler/graph.py +334 -0
  145. wirely-0.1.3/wirely/compiler/instance.py +587 -0
  146. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/model.py +43 -26
  147. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/native_functions.py +20 -20
  148. wirely-0.1.3/wirely/compiler/node_type.py +385 -0
  149. wirely-0.1.3/wirely/compiler/outline.py +661 -0
  150. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/parameters.py +17 -16
  151. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/parser.py +80 -65
  152. wirely-0.1.3/wirely/compiler/program.py +488 -0
  153. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/shuffle.py +20 -12
  154. wirely-0.1.3/wirely/compiler/stages.py +10 -0
  155. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/static_bindings.py +4 -4
  156. wirely-0.1.3/wirely/compiler/support.py +396 -0
  157. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/types.py +46 -46
  158. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/value.py +45 -13
  159. wirely-0.1.3/wirely/compiler/wirely.lark +307 -0
  160. wirely-0.1.3/wirely/editor/__init__.py +5 -0
  161. wirely-0.1.3/wirely/editor/app.py +632 -0
  162. wirely-0.1.3/wirely/editor/export.py +77 -0
  163. wirely-0.1.3/wirely/editor/graph_model.py +367 -0
  164. wirely-0.1.3/wirely/editor/graph_view.py +873 -0
  165. wirely-0.1.3/wirely/editor/grid.py +18 -0
  166. wirely-0.1.3/wirely/editor/layout.py +191 -0
  167. wirely-0.1.3/wirely/editor/palette.py +124 -0
  168. wirely-0.1.3/wirely/editor/program.py +195 -0
  169. wirely-0.1.3/wirely/editor/properties.py +97 -0
  170. wirely-0.1.3/wirely/editor/sync.py +219 -0
  171. wirely-0.1.3/wirely/editor/text_view.py +310 -0
  172. wirely-0.1.3/wirely/editor/workspace.py +407 -0
  173. {wirely-0.1.2 → wirely-0.1.3}/wirely/knx/connection_config.py +2 -2
  174. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/csv.wrl +3 -2
  175. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/gpio.wrl +1 -0
  176. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/knx.wrl +8 -3
  177. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/memory.wrl +1 -1
  178. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/mqtt.wrl +7 -3
  179. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/process.wrl +1 -0
  180. wirely-0.1.2/wirely/lib/time.wrl → wirely-0.1.3/wirely/lib/schedule.wrl +6 -50
  181. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/std.wrl +15 -3
  182. wirely-0.1.3/wirely/lib/timer.wrl +59 -0
  183. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/two_n.wrl +9 -4
  184. {wirely-0.1.2 → wirely-0.1.3}/wirely/native/__init__.py +11 -10
  185. {wirely-0.1.2 → wirely-0.1.3}/wirely/native/abb_jra.py +6 -6
  186. {wirely-0.1.2 → wirely-0.1.3}/wirely/native/csv.py +6 -6
  187. {wirely-0.1.2 → wirely-0.1.3}/wirely/native/gpio.py +3 -3
  188. {wirely-0.1.2 → wirely-0.1.3}/wirely/native/knx.py +10 -10
  189. {wirely-0.1.2 → wirely-0.1.3}/wirely/native/memory.py +8 -8
  190. {wirely-0.1.2 → wirely-0.1.3}/wirely/native/mqtt.py +8 -8
  191. {wirely-0.1.2 → wirely-0.1.3}/wirely/native/process.py +4 -4
  192. wirely-0.1.2/wirely/native/time.py → wirely-0.1.3/wirely/native/schedule.py +12 -92
  193. {wirely-0.1.2 → wirely-0.1.3}/wirely/native/std.py +21 -36
  194. wirely-0.1.3/wirely/native/test_library.py +13 -0
  195. wirely-0.1.3/wirely/native/timer.py +96 -0
  196. {wirely-0.1.2 → wirely-0.1.3}/wirely/native/two_n.py +18 -18
  197. {wirely-0.1.2 → wirely-0.1.3}/wirely/program/__init__.py +2 -2
  198. {wirely-0.1.2 → wirely-0.1.3}/wirely/program/procedures.py +3 -0
  199. {wirely-0.1.2 → wirely-0.1.3}/wirely/program/program.py +49 -42
  200. {wirely-0.1.2 → wirely-0.1.3}/wirely/program/validation.py +36 -13
  201. {wirely-0.1.2 → wirely-0.1.3}/wirely/runtime/contexts.py +26 -22
  202. {wirely-0.1.2 → wirely-0.1.3}/wirely/runtime/engine.py +67 -58
  203. {wirely-0.1.2 → wirely-0.1.3}/wirely/runtime/linking.py +3 -3
  204. {wirely-0.1.2 → wirely-0.1.3}/wirely/runtime/procedures.py +10 -10
  205. {wirely-0.1.2 → wirely-0.1.3}/wirely/test.py +176 -114
  206. {wirely-0.1.2 → wirely-0.1.3}/wirely/types/__init__.py +39 -0
  207. {wirely-0.1.2 → wirely-0.1.3}/wirely/types/time.py +1 -1
  208. {wirely-0.1.2 → wirely-0.1.3/wirely.egg-info}/PKG-INFO +37 -8
  209. {wirely-0.1.2 → wirely-0.1.3}/wirely.egg-info/SOURCES.txt +83 -27
  210. {wirely-0.1.2 → wirely-0.1.3}/wirely.egg-info/requires.txt +3 -0
  211. wirely-0.1.2/test/compiler/assertions.wrl +0 -37
  212. wirely-0.1.2/test/compiler/attributes.wrl +0 -97
  213. wirely-0.1.2/test/negative/assertions.wrl +0 -110
  214. wirely-0.1.2/test/negative/attributes.wrl +0 -211
  215. wirely-0.1.2/test/negative/connections.wrl +0 -119
  216. wirely-0.1.2/test/negative/node_declarations.wrl +0 -47
  217. wirely-0.1.2/test/negative/path.wrl +0 -46
  218. wirely-0.1.2/test/negative/procedure_bindings.wrl +0 -112
  219. wirely-0.1.2/test/unit/attribute_editing.py +0 -151
  220. wirely-0.1.2/test/unit/attribute_editing.wrl +0 -1
  221. wirely-0.1.2/test/unit/container.wrl +0 -1
  222. wirely-0.1.2/test/unit/instructions.wrl +0 -1
  223. wirely-0.1.2/test/unit/library_configuration.wrl +0 -1
  224. wirely-0.1.2/test/unit/native_interface.wrl +0 -1
  225. wirely-0.1.2/test/unit/negative_cases.wrl +0 -1
  226. wirely-0.1.2/test/unit/resources.wrl +0 -1
  227. wirely-0.1.2/test/unit/runtime_program.wrl +0 -20
  228. wirely-0.1.2/test/unit/serialization.wrl +0 -1
  229. wirely-0.1.2/test/unit/shuffle.py +0 -110
  230. wirely-0.1.2/test/unit/shuffle.wrl +0 -1
  231. wirely-0.1.2/test/unit/state_connections.wrl +0 -1
  232. wirely-0.1.2/test/unit/test_resources.wrl +0 -1
  233. wirely-0.1.2/test/unit/types.wrl +0 -1
  234. wirely-0.1.2/test/wrl/time.wrl +0 -24
  235. wirely-0.1.2/tools/run-tests +0 -78
  236. wirely-0.1.2/wirely/compiler/ast.py +0 -1960
  237. wirely-0.1.2/wirely/compiler/attribute_editing.py +0 -305
  238. wirely-0.1.2/wirely/compiler/block.py +0 -563
  239. wirely-0.1.2/wirely/compiler/block_type.py +0 -347
  240. wirely-0.1.2/wirely/compiler/blocks.lark +0 -257
  241. wirely-0.1.2/wirely/compiler/node.py +0 -167
  242. wirely-0.1.2/wirely/compiler/program.py +0 -378
  243. wirely-0.1.2/wirely/compiler/support.py +0 -283
  244. wirely-0.1.2/wirely/native/test_library.py +0 -13
  245. {wirely-0.1.2 → wirely-0.1.3}/LICENSE +0 -0
  246. {wirely-0.1.2 → wirely-0.1.3}/MANIFEST.in +0 -0
  247. {wirely-0.1.2 → wirely-0.1.3}/doc/control-protocol.md +0 -0
  248. {wirely-0.1.2 → wirely-0.1.3}/doc/python-style.md +0 -0
  249. {wirely-0.1.2 → wirely-0.1.3}/examples/flipflop.wrl +0 -0
  250. {wirely-0.1.2 → wirely-0.1.3}/examples/gpio.wrl +0 -0
  251. {wirely-0.1.2 → wirely-0.1.3}/examples/knx.wrl +0 -0
  252. {wirely-0.1.2 → wirely-0.1.3}/setup.cfg +0 -0
  253. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/constants.wrl +0 -0
  254. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/conversions.wrl +0 -0
  255. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/durations.wrl +0 -0
  256. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/equality.wrl +0 -0
  257. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/literals.wrl +0 -0
  258. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/namespaces.wrl +0 -0
  259. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/native_functions.wrl +0 -0
  260. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/options.wrl +0 -0
  261. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/ordering.wrl +0 -0
  262. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/parameters.wrl +0 -0
  263. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/path.wrl +0 -0
  264. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/prepared_configuration.wrl +0 -0
  265. {wirely-0.1.2/test/wrl → wirely-0.1.3/test/compiler}/simple.wrl +0 -0
  266. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/structs.wrl +0 -0
  267. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/time_of_day.wrl +0 -0
  268. {wirely-0.1.2 → wirely-0.1.3}/test/compiler/types.wrl +0 -0
  269. {wirely-0.1.2 → wirely-0.1.3}/test/negative/arithmetic.wrl +0 -0
  270. {wirely-0.1.2 → wirely-0.1.3}/test/negative/conversions.wrl +0 -0
  271. {wirely-0.1.2 → wirely-0.1.3}/test/negative/durations.wrl +0 -0
  272. {wirely-0.1.2 → wirely-0.1.3}/test/negative/enum_literals.wrl +0 -0
  273. {wirely-0.1.2 → wirely-0.1.3}/test/negative/monotonic_time.wrl +0 -0
  274. {wirely-0.1.2 → wirely-0.1.3}/test/negative/native_values.wrl +0 -0
  275. {wirely-0.1.2 → wirely-0.1.3}/test/negative/option_literals.wrl +0 -0
  276. {wirely-0.1.2 → wirely-0.1.3}/test/negative/resource_value_types.wrl +0 -0
  277. {wirely-0.1.2 → wirely-0.1.3}/test/negative/runtime_types.wrl +0 -0
  278. {wirely-0.1.2 → wirely-0.1.3}/test/negative/string_literals.wrl +0 -0
  279. {wirely-0.1.2 → wirely-0.1.3}/test/negative/time_of_day.wrl +0 -0
  280. {wirely-0.1.2 → wirely-0.1.3}/test/negative/unit_literals.wrl +0 -0
  281. {wirely-0.1.2 → wirely-0.1.3}/test/unit/control.py +0 -0
  282. {wirely-0.1.2 → wirely-0.1.3}/test/unit/control.wrl +0 -0
  283. {wirely-0.1.2 → wirely-0.1.3}/test/unit/native_values.wrl +0 -0
  284. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/abb.wrl +0 -0
  285. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/and.wrl +0 -0
  286. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/csv.wrl +0 -0
  287. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/delay.wrl +0 -0
  288. {wirely-0.1.2/test/unit → wirely-0.1.3/test/wrl}/equality.wrl +0 -0
  289. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/flipflop.wrl +0 -0
  290. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/gpio.py +0 -0
  291. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/gpio.wrl +0 -0
  292. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/knx.py +0 -0
  293. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/knx.wrl +0 -0
  294. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/mqtt.py +0 -0
  295. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/mqtt.wrl +0 -0
  296. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/option.wrl +0 -0
  297. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/process.py +0 -0
  298. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/process.wrl +0 -0
  299. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/std.wrl +0 -0
  300. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/two_n.wrl +0 -0
  301. {wirely-0.1.2 → wirely-0.1.3}/test/wrl/username_password.txt +0 -0
  302. {wirely-0.1.2 → wirely-0.1.3}/tools/build-pex +0 -0
  303. {wirely-0.1.2 → wirely-0.1.3}/tools/git_write_wd_tree.py +0 -0
  304. {wirely-0.1.2 → wirely-0.1.3}/tools/run-tests-dependencies +0 -0
  305. {wirely-0.1.2 → wirely-0.1.3}/tools/setup-venv +0 -0
  306. {wirely-0.1.2 → wirely-0.1.3}/tools/test-gitlab-ci +0 -0
  307. {wirely-0.1.2 → wirely-0.1.3}/tools/wirely +0 -0
  308. {wirely-0.1.2 → wirely-0.1.3}/wirely/__init__.py +0 -0
  309. {wirely-0.1.2 → wirely-0.1.3}/wirely/cli/__init__.py +0 -0
  310. {wirely-0.1.2 → wirely-0.1.3}/wirely/cli/objdump.py +0 -0
  311. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/function_implementations/__init__.py +0 -0
  312. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/function_implementations/csv.py +0 -0
  313. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/function_implementations/mqtt.py +0 -0
  314. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/function_implementations/path.py +0 -0
  315. /wirely-0.1.2/wirely/compiler/function_implementations/time.py → /wirely-0.1.3/wirely/compiler/function_implementations/schedule.py +0 -0
  316. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/function_implementations/test.py +0 -0
  317. {wirely-0.1.2 → wirely-0.1.3}/wirely/compiler/function_implementations/two_n.py +0 -0
  318. {wirely-0.1.2 → wirely-0.1.3}/wirely/control/__init__.py +0 -0
  319. {wirely-0.1.2 → wirely-0.1.3}/wirely/control/client.py +0 -0
  320. {wirely-0.1.2 → wirely-0.1.3}/wirely/control/controller.py +0 -0
  321. {wirely-0.1.2 → wirely-0.1.3}/wirely/control/framing.py +0 -0
  322. {wirely-0.1.2 → wirely-0.1.3}/wirely/control/messages.py +0 -0
  323. {wirely-0.1.2 → wirely-0.1.3}/wirely/control/server.py +0 -0
  324. {wirely-0.1.2 → wirely-0.1.3}/wirely/functions/__init__.py +0 -0
  325. {wirely-0.1.2 → wirely-0.1.3}/wirely/functions/duration.py +0 -0
  326. {wirely-0.1.2 → wirely-0.1.3}/wirely/functions/monotonic_time.py +0 -0
  327. {wirely-0.1.2 → wirely-0.1.3}/wirely/functions/test_library.py +0 -0
  328. {wirely-0.1.2 → wirely-0.1.3}/wirely/functions/time_of_day.py +0 -0
  329. {wirely-0.1.2 → wirely-0.1.3}/wirely/knx/__init__.py +0 -0
  330. {wirely-0.1.2 → wirely-0.1.3}/wirely/knx/connection_adapter.py +0 -0
  331. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/abb_jra.wrl +0 -0
  332. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/matter.wrl +0 -0
  333. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/path.wrl +0 -0
  334. {wirely-0.1.2 → wirely-0.1.3}/wirely/lib/test.wrl +0 -0
  335. {wirely-0.1.2 → wirely-0.1.3}/wirely/misc/__init__.py +0 -0
  336. {wirely-0.1.2 → wirely-0.1.3}/wirely/misc/service.py +0 -0
  337. {wirely-0.1.2 → wirely-0.1.3}/wirely/misc/state_directory.py +0 -0
  338. {wirely-0.1.2 → wirely-0.1.3}/wirely/program/container.py +0 -0
  339. {wirely-0.1.2 → wirely-0.1.3}/wirely/program/limits.py +0 -0
  340. {wirely-0.1.2 → wirely-0.1.3}/wirely/runtime/__init__.py +0 -0
  341. {wirely-0.1.2 → wirely-0.1.3}/wirely/runtime/time_snapshot.py +0 -0
  342. {wirely-0.1.2 → wirely-0.1.3}/wirely/two_n/__init__.py +0 -0
  343. {wirely-0.1.2 → wirely-0.1.3}/wirely/two_n/cert.py +0 -0
  344. {wirely-0.1.2 → wirely-0.1.3}/wirely/two_n/client.py +0 -0
  345. {wirely-0.1.2 → wirely-0.1.3}/wirely/two_n/fake_server.py +0 -0
  346. {wirely-0.1.2 → wirely-0.1.3}/wirely/two_n/grab_images.py +0 -0
  347. {wirely-0.1.2 → wirely-0.1.3}/wirely/types/option.py +0 -0
  348. {wirely-0.1.2 → wirely-0.1.3}/wirely/types/serialization.py +0 -0
  349. {wirely-0.1.2 → wirely-0.1.3}/wirely/types/struct.py +0 -0
  350. {wirely-0.1.2 → wirely-0.1.3}/wirely/types/unit.py +0 -0
  351. {wirely-0.1.2 → wirely-0.1.3}/wirely/types/value_types.py +0 -0
  352. {wirely-0.1.2 → wirely-0.1.3}/wirely/util.py +0 -0
  353. {wirely-0.1.2 → wirely-0.1.3}/wirely.egg-info/dependency_links.txt +0 -0
  354. {wirely-0.1.2 → wirely-0.1.3}/wirely.egg-info/entry_points.txt +0 -0
  355. {wirely-0.1.2 → wirely-0.1.3}/wirely.egg-info/top_level.txt +0 -0
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.3 - 2026-10-12
4
+
5
+ ### Breaking changes and migration
6
+
7
+ #### Schedule and Timer namespaces
8
+
9
+ Replace `Time` with `Schedule` for `IsInDailyInterval`, `TriggerAt`,
10
+ `TimeOfDayMinute`, and `IsValidDailyInterval`, and with `Timer` for
11
+ `DebounceStable` and `MonotonicTimeReached`.
12
+
13
+ ### Added
14
+
15
+ - `Timer.MonotonicTimestamp` emits the step's monotonic time while an input
16
+ event is present.
17
+ - Bitwise operators `&`, `|`, `^`, `!`, `<<`, and `>>` for integers.
18
+ - Procedure ports can be declared with a type and wired with `connect`.
19
+ Refer to a port as `procedure.port`, also in reference ports of other
20
+ procedures:
21
+
22
+ ```wirely
23
+ procedure invert
24
+ depends on value: value boolean
25
+ produces inverted: value boolean
26
+ {
27
+ inverted = !value;
28
+ }
29
+ connect default input -> invert.value;
30
+ connect invert.inverted -> default output;
31
+ ```
32
+ - Connections can target temporaries and state; state takes its value from
33
+ a procedure output port. Reference output ports can target child inputs.
34
+ - `wirely edit` edits programs as source text and as diagrams, kept in
35
+ sync. `wirely export-image` draws a diagram as a PDF or PNG file. Install
36
+ the `editor` extra to use them.
37
+
3
38
  ## 0.1.2 - 2026-10-10
4
39
 
5
40
  ### Breaking changes and migration
@@ -171,7 +206,7 @@ Replace integration-specific connector kinds in custom node declarations:
171
206
  | `two_n_device` | `resource TwoN.Device` |
172
207
 
173
208
  Custom libraries can declare their own opaque resources with
174
- `resource type Name;`. See [resource connectors](doc/language.md#opaque-resource-connectors).
209
+ `resource type Name;`. See [resource connectors](doc/language.md#opaque-resource-ports).
175
210
 
176
211
  #### Runtime types
177
212
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wirely
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Node-based language and runtime for low-level home automation
5
5
  Author: Steffen Kieß
6
6
  License: MIT
@@ -23,6 +23,8 @@ Provides-Extra: graphviz
23
23
  Requires-Dist: graphviz>=0.20.1; extra == "graphviz"
24
24
  Provides-Extra: gpio
25
25
  Requires-Dist: gpiod<3,>=2.1; extra == "gpio"
26
+ Provides-Extra: editor
27
+ Requires-Dist: PySide6-Essentials>=6.8; extra == "editor"
26
28
  Provides-Extra: all
27
29
  Requires-Dist: wirely[gpio,graphviz,knx,mqtt,two-n]; extra == "all"
28
30
  Provides-Extra: test
@@ -79,8 +81,35 @@ python3 -m pip install 'wirely[two-n]' # 2N devices
79
81
  python3 -m pip install 'wirely[graphviz]' # show-graph
80
82
  python3 -m pip install 'wirely[gpio]' # GPIO
81
83
  python3 -m pip install 'wirely[all]' # all optional integrations
84
+ python3 -m pip install 'wirely[editor]' # graphical editor
82
85
  ```
83
86
 
87
+ `wirely edit program.wrl` opens a program in a graphical editor with tabs
88
+ for its source files and diagrams. Edits in either view update the other.
89
+ Right-click a tab to split the view, move it to another pane, or detach it
90
+ into a window. You can also drag tabs between panes, onto pane edges to
91
+ split, or outside the editor to detach. Closing a detached window returns
92
+ its tabs to the main window. Layouts last for the current session.
93
+ A diagram is read-only while its source has syntax errors. In a diagram:
94
+
95
+ - Drag a node to store its position in the source; right-click it and choose
96
+ Reset to Automatic Position to remove it again. Use View → Snap to Grid
97
+ to toggle snapping for all diagrams. A selected group snaps its movement
98
+ while keeping its relative positions.
99
+ - Drag from a port to another port to connect them. Drag a connection away
100
+ from an input to move or remove it.
101
+ - Press Delete to remove the selection and F2 to rename it.
102
+ - Right-click the background to add nodes and declarations.
103
+ - Double-click a node to open the diagram of its node type.
104
+ - Press Ctrl+E to show the source of the selection, and Ctrl+Shift+E in the
105
+ source to show the element at the cursor in its diagram.
106
+
107
+ `wirely export-image program.wrl -o diagram.pdf` draws the program diagram as
108
+ the editor shows it, as a PDF or PNG file. Use `--scope Name` for the diagram
109
+ of a node type and `--scale` for the PNG resolution. Diagrams use the DejaVu
110
+ Sans font, or a fallback font if it is not installed. See
111
+ [diagram layout](doc/diagram-layout.md) for how layouts are stored.
112
+
84
113
  The `test` extra adds dependencies used only by the test suite. Install
85
114
  `wirely[all,test]` to include both integrations and test dependencies.
86
115
 
@@ -92,7 +121,7 @@ checkout launchers:
92
121
 
93
122
  ```
94
123
  tools/setup-venv
95
- tools/wirely compile test/wrl/simple.wrl
124
+ tools/wirely compile test/compiler/simple.wrl
96
125
  tools/run-tests
97
126
  ```
98
127
 
@@ -105,16 +134,16 @@ Pass test names to run a selection, and add `--timings` to list durations
105
134
  slowest first:
106
135
 
107
136
  ```
108
- tools/run-tests --timings unit/types unit/equality
137
+ tools/run-tests --timings unit/types wrl/equality
109
138
  ```
110
139
 
111
140
  To check that compilation does not depend on declaration order, set
112
141
  `WIRELY_COMPILER_SHUFFLE_SEED` to an integer. The compiler then shuffles
113
- declarations, node parameters, struct literal fields, and procedure
114
- bindings with that seed; connections keep their relative order. Also set
115
- `WIRELY_COMPILER_SHUFFLE_LAYOUT=1` to shuffle struct fields and enum
116
- members, which changes serialization and enum default values. Negative
117
- tests may report different diagnostics in this mode.
142
+ declarations, node parameters, struct literal fields, procedure ports,
143
+ and `uses` bindings with that seed; connections keep their relative order.
144
+ Also set `WIRELY_COMPILER_SHUFFLE_LAYOUT=1` to shuffle struct fields and
145
+ enum members, which changes serialization and enum default values.
146
+ Negative tests may report different diagnostics in this mode.
118
147
 
119
148
  ```
120
149
  WIRELY_COMPILER_SHUFFLE_SEED=1 tools/run-tests
@@ -43,8 +43,35 @@ python3 -m pip install 'wirely[two-n]' # 2N devices
43
43
  python3 -m pip install 'wirely[graphviz]' # show-graph
44
44
  python3 -m pip install 'wirely[gpio]' # GPIO
45
45
  python3 -m pip install 'wirely[all]' # all optional integrations
46
+ python3 -m pip install 'wirely[editor]' # graphical editor
46
47
  ```
47
48
 
49
+ `wirely edit program.wrl` opens a program in a graphical editor with tabs
50
+ for its source files and diagrams. Edits in either view update the other.
51
+ Right-click a tab to split the view, move it to another pane, or detach it
52
+ into a window. You can also drag tabs between panes, onto pane edges to
53
+ split, or outside the editor to detach. Closing a detached window returns
54
+ its tabs to the main window. Layouts last for the current session.
55
+ A diagram is read-only while its source has syntax errors. In a diagram:
56
+
57
+ - Drag a node to store its position in the source; right-click it and choose
58
+ Reset to Automatic Position to remove it again. Use View → Snap to Grid
59
+ to toggle snapping for all diagrams. A selected group snaps its movement
60
+ while keeping its relative positions.
61
+ - Drag from a port to another port to connect them. Drag a connection away
62
+ from an input to move or remove it.
63
+ - Press Delete to remove the selection and F2 to rename it.
64
+ - Right-click the background to add nodes and declarations.
65
+ - Double-click a node to open the diagram of its node type.
66
+ - Press Ctrl+E to show the source of the selection, and Ctrl+Shift+E in the
67
+ source to show the element at the cursor in its diagram.
68
+
69
+ `wirely export-image program.wrl -o diagram.pdf` draws the program diagram as
70
+ the editor shows it, as a PDF or PNG file. Use `--scope Name` for the diagram
71
+ of a node type and `--scale` for the PNG resolution. Diagrams use the DejaVu
72
+ Sans font, or a fallback font if it is not installed. See
73
+ [diagram layout](doc/diagram-layout.md) for how layouts are stored.
74
+
48
75
  The `test` extra adds dependencies used only by the test suite. Install
49
76
  `wirely[all,test]` to include both integrations and test dependencies.
50
77
 
@@ -56,7 +83,7 @@ checkout launchers:
56
83
 
57
84
  ```
58
85
  tools/setup-venv
59
- tools/wirely compile test/wrl/simple.wrl
86
+ tools/wirely compile test/compiler/simple.wrl
60
87
  tools/run-tests
61
88
  ```
62
89
 
@@ -69,16 +96,16 @@ Pass test names to run a selection, and add `--timings` to list durations
69
96
  slowest first:
70
97
 
71
98
  ```
72
- tools/run-tests --timings unit/types unit/equality
99
+ tools/run-tests --timings unit/types wrl/equality
73
100
  ```
74
101
 
75
102
  To check that compilation does not depend on declaration order, set
76
103
  `WIRELY_COMPILER_SHUFFLE_SEED` to an integer. The compiler then shuffles
77
- declarations, node parameters, struct literal fields, and procedure
78
- bindings with that seed; connections keep their relative order. Also set
79
- `WIRELY_COMPILER_SHUFFLE_LAYOUT=1` to shuffle struct fields and enum
80
- members, which changes serialization and enum default values. Negative
81
- tests may report different diagnostics in this mode.
104
+ declarations, node parameters, struct literal fields, procedure ports,
105
+ and `uses` bindings with that seed; connections keep their relative order.
106
+ Also set `WIRELY_COMPILER_SHUFFLE_LAYOUT=1` to shuffle struct fields and
107
+ enum members, which changes serialization and enum default values.
108
+ Negative tests may report different diagnostics in this mode.
82
109
 
83
110
  ```
84
111
  WIRELY_COMPILER_SHUFFLE_SEED=1 tools/run-tests
@@ -4,14 +4,18 @@ Wirely programs are graphs of typed nodes written in `.wrl` files. Start with
4
4
  the [language guide](language.md) to learn how to declare nodes and connect
5
5
  them. Then use the [library reference](libraries.md) to find the nodes supplied
6
6
  with Wirely. The [value type reference](value-types.md) describes the types
7
- used by parameters, connectors, and state.
7
+ used by parameters, ports, and state.
8
8
 
9
9
  The [binary program format proposal](bytecode-format.md) describes program
10
10
  tables, value encodings, and optional debugging information.
11
11
 
12
12
  For `.wrl` formatting and naming, follow the
13
- [Wirely style guide](wirely-style.md).
13
+ [Wirely style guide](wirely-style.md). The [diagram layout](diagram-layout.md)
14
+ document defines how diagrams of programs are laid out and stored.
14
15
 
15
16
  To implement nodes and procedures in Python, use the
16
17
  [native Python implementation guide](native-python.md). For Python
17
18
  contributions, follow the [Python style guide](python-style.md).
19
+
20
+ For compiler development, read the [compiler stages guide](compiler-stages.md).
21
+ For test categories, execution, and authoring, read the [test guide](tests.md).
@@ -95,13 +95,11 @@ their contents.
95
95
  | [`ResourceInterfaces`](#resourceinterfaces) | `ResourceInterface` | Table |
96
96
  | [`StaticBindings`](#staticbindings) | `StaticBinding` | Table |
97
97
  | [`ResourceInputs`](#resourceinputs) | `ResourceInput` | Table |
98
- | [`ResourceProviders`](#resourceproviders) | `ResourceProvider` | Table |
99
98
  | [`Stages`](#stages) | `Stage` | Table |
100
99
  | [`Procedures`](#procedures) | `Procedure` | Table |
101
100
  | [`NativeProcedures`](#nativeprocedures) | `NativeProcedure` | Table |
102
101
  | [`InputInterfaces`](#inputinterfaces) | `InputInterface` | Table |
103
102
  | [`ValueInputs`](#valueinputs) | `ValueInput` | Table |
104
- | [`InputSources`](#inputsources) | `InputSource` | Table |
105
103
  | [`Outputs`](#outputs) | `Output` | Table |
106
104
  | [`ProcedureBodies`](#procedurebodies) | `ProcedureBody` | Table |
107
105
  | [`NativeFunctions`](#nativefunctions) | `NativeFunction` | Table |
@@ -381,12 +379,12 @@ struct type Variable {
381
379
  ```
382
380
 
383
381
  Static values describe the resolved values bound by `uses` clauses of
384
- native procedures and initializers, and constants read by procedure
385
- bodies. Bindings and `const` operands reference these entries, which can
386
- be shared for equal typed values. Their data and referenced payloads are
387
- stored in `ProgramData`. Only values bound by `uses` clauses or read by
388
- procedure bodies are stored; node parameters, constants, and expressions
389
- supply those values.
382
+ native procedures and initializers, constants read by procedure bodies,
383
+ and parameters and constants connected to procedure inputs. Bindings,
384
+ `const` operands, and static input sources reference these entries, which
385
+ can be shared for equal typed values. Their data and referenced payloads
386
+ are stored in `ProgramData`. Only values used in one of these ways are
387
+ stored; node parameters, constants, and expressions supply those values.
390
388
 
391
389
  ### ProgramData
392
390
 
@@ -525,14 +523,11 @@ struct type ResourceInterface {
525
523
  Name: StringRef,
526
524
  // Qualified resource type name in Names, such as KNX.Bus.
527
525
  Type: StringRef,
528
- // 0 = one provider, 1 = ordered provider list.
529
- IsList: uint8,
530
526
  }
531
527
  ```
532
528
 
533
- Each range contains unique names in UTF-8 bytewise lexical order. Resource
534
- outputs have `IsList = 0`. Until resource outputs are named in the
535
- language, a node type's default output is named `default`.
529
+ Each range contains unique names in UTF-8 bytewise lexical order.
530
+ A node type's default resource output is named `default`.
536
531
 
537
532
  ### StaticBindings
538
533
 
@@ -555,27 +550,11 @@ bound option value.
555
550
  ### ResourceInputs
556
551
 
557
552
  ```wirely
558
- // Binds native state providers to one resource interface.
553
+ // Binds one native state provider to one resource interface.
559
554
  // ResourceInputs table.
560
555
  struct type ResourceInput {
561
556
  // Index into ResourceInterfaces; the resource input being bound.
562
557
  Interface: Ref,
563
- // Range into ResourceProviders.
564
- Providers: Range,
565
- }
566
- ```
567
-
568
- The interface belongs to the native state type's
569
- `ResourceInputInterfaces` range for construction or the native
570
- procedure's `ResourceInputInterfaces` range for procedure calls. An
571
- interface with `IsList = 0` has one provider; with `IsList = 1`, the
572
- providers form an ordered sequence, which can be empty.
573
-
574
- ### ResourceProviders
575
-
576
- ```wirely
577
- // One resource provided by a native state. ResourceProviders table.
578
- struct type ResourceProvider {
579
558
  // Index into NativeStates.
580
559
  NativeState: Ref,
581
560
  // Index within the provider type's ResourceOutputInterfaces range.
@@ -583,8 +562,10 @@ struct type ResourceProvider {
583
562
  }
584
563
  ```
585
564
 
586
- The provided resource has the type of the resource interface it is bound
587
- to.
565
+ The interface belongs to the native state type's
566
+ `ResourceInputInterfaces` range for construction or the native
567
+ procedure's `ResourceInputInterfaces` range for procedure calls.
568
+ Each input binds one provider with the resource type of that interface.
588
569
 
589
570
  ## Execution
590
571
 
@@ -674,8 +655,6 @@ duplicates.
674
655
  struct type InputInterface {
675
656
  // Input name in Names.
676
657
  Name: StringRef,
677
- // 0 = one connection, 1 = ordered connection list.
678
- IsList: uint8,
679
658
  }
680
659
  ```
681
660
 
@@ -684,35 +663,29 @@ Each range contains unique names in UTF-8 bytewise lexical order.
684
663
  ### ValueInputs
685
664
 
686
665
  ```wirely
687
- // Binds variable sources to one procedure input. ValueInputs table.
666
+ // Binds one variable or static value to a procedure input.
667
+ // ValueInputs table.
688
668
  struct type ValueInput {
689
669
  // Index into InputInterfaces; the input being bound. No entry for
690
670
  // procedure bodies.
691
671
  Interface: OptionalRef,
692
- // Range into InputSources.
693
- Sources: Range,
694
- }
695
- ```
696
-
697
- The interface belongs to the native procedure's `InputInterfaces` range.
698
- An interface with `IsList = 0` has one source; with `IsList = 1`, the
699
- sources form an ordered sequence, which can be empty.
700
-
701
- ### InputSources
702
-
703
- ```wirely
704
- // One variable supplying a procedure input. InputSources table.
705
- struct type InputSource {
706
- // Old state, new state, or temporaries.
672
+ // Old state, new state, temporaries, or static values.
707
673
  Bank: uint8,
708
- // Index into StateVariables or Temporaries, selected by Bank.
674
+ // Index into StateVariables, Temporaries, or StaticValues, selected by
675
+ // Bank.
709
676
  Variable: Ref,
710
677
  }
711
678
  ```
712
679
 
680
+ For native calls, the interface belongs to the native procedure's
681
+ `InputInterfaces` range. Each value input binds exactly one source.
682
+ Procedure body inputs follow dependency declaration order; multi value
683
+ inputs expand into scalar inputs in connection order.
684
+
713
685
  An old-state input reads the step's old-state snapshot. A new-state input
714
686
  reads the state value written earlier in the step. A temporary input reads
715
- a temporary computed during the step.
687
+ a temporary computed during the step. A static input reads a value from
688
+ `ProgramData`.
716
689
 
717
690
  Old-state inputs compare the step's old-state snapshot with the snapshot
718
691
  read by the previous step, using the variable's value-type equality.
@@ -720,8 +693,9 @@ New-state inputs compare this step's new state with the step's old state,
720
693
  which the previous step produced. Temporary inputs compare this step's
721
694
  values with the previous step's cached values. A difference requires
722
695
  procedure execution. On the first step, procedures execute without
723
- previous values. Triggers and wakeups also require execution. A skipped
724
- procedure preserves its state and temporary outputs.
696
+ previous values. Static inputs never change and are not compared.
697
+ Triggers and wakeups also require execution. A skipped procedure preserves
698
+ its state and temporary outputs.
725
699
 
726
700
  ### Outputs
727
701
 
@@ -777,6 +751,14 @@ The runtime matches the qualified names of native state types, native
777
751
  procedures, and native functions to native code, and binds interface names
778
752
  to static values, inputs, outputs, and resources. Linking also checks that
779
753
  each procedure's native state has the type its native procedure expects.
754
+
755
+ The reserved linking name for a native procedure with multi value/event
756
+ dependencies is `Namespace.BlockType:procedure.2.3.4`. The decimal suffixes
757
+ are member counts in dependency declaration order, including zero counts;
758
+ scalar and resource dependencies contribute no suffix. Native multi
759
+ value/event specialization is not currently supported. Procedure debug
760
+ symbols remain instance names such as `someblock:procedure`.
761
+
780
762
  Embedded adapters can retain numeric bindings and function pointers after
781
763
  linking. Native trigger names resolve to the same native procedure indices.
782
764
 
@@ -868,9 +850,12 @@ Each name below denotes a value operand except `field`, `offset`,
868
850
  | `MAKE_SOME destination, source` | Copy a value of type `T` into a destination of type `Option[T]` as `Some`. |
869
851
  | `GET_OPTION_VALUE destination, source` | Copy the value of `Some`, or assign the contained type's default for `None`. The destination has that contained type. |
870
852
  | `IS_SOME destination, source` | Assign a boolean indicating whether the option is `Some`. |
871
- | `NOT destination, source` | Negate a boolean. |
872
- | `AND destination, left, right` | Compute boolean conjunction. |
873
- | `OR destination, left, right` | Compute boolean disjunction. |
853
+ | `NOT destination, source` | Complement an integer within its width, or negate a boolean. |
854
+ | `AND destination, left, right` | Compute bitwise or Boolean conjunction. |
855
+ | `OR destination, left, right` | Compute bitwise or Boolean disjunction. |
856
+ | `XOR destination, left, right` | Compute bitwise or Boolean exclusive disjunction. |
857
+ | `SHIFT_LEFT destination, value, shift_count` | Shift left, discarding outgoing bits and filling with zeros. |
858
+ | `SHIFT_RIGHT destination, value, shift_count` | Shift right, extending the sign for signed integers and filling with zeros for unsigned integers. |
874
859
  | `EQUAL destination, left, right` | Compare same-type values for equality, assigning a boolean. |
875
860
  | `LESS destination, left, right` | Assign whether `left` orders before `right`. Both have the same integer type, or the same ordered built-in type. |
876
861
  | `ADD_WRAPPING`, `SUB_WRAPPING`, `MUL_WRAPPING` `destination, left, right` | Compute the integer result modulo 2^bits within the operand type's range. |
@@ -885,7 +870,12 @@ Each name below denotes a value operand except `field`, `offset`,
885
870
  | `CALL destination, function, count, arguments…` | Call a native function with `count` argument operands and assign its result. |
886
871
  | `RETURN` | End the procedure with its current output values. |
887
872
 
888
- `NOT`, `AND`, and `OR` require boolean operands and destinations.
873
+ `NOT`, `AND`, `OR`, and `XOR` require matching integer or boolean sources
874
+ and destinations. Binary operations evaluate both sources.
875
+ For shifts, `value` and the destination share one integer type;
876
+ `shift_count` is an ordinary `uint32` value operand. Counts at least the
877
+ value's width produce zero, except that right-shifting a negative signed
878
+ value produces minus one. Counts are not masked.
889
879
  Arithmetic sources share one integer type `T`. The destination has type
890
880
  `T`, or `Option[T]` for `_CHECKED` instructions. Division truncates toward
891
881
  zero, and the remainder has the dividend's sign.
@@ -970,7 +960,7 @@ same order:
970
960
  | --- | --- | --- |
971
961
  | `NodeSymbols` | `NativeStates` | Node path, such as `a.b` |
972
962
  | `StateVariableSymbols` | `StateVariables` | Variable path, such as `a.b.count` |
973
- | `TemporarySymbols` | `Temporaries` | Variable path, or for output storage the procedure symbol and output key joined by `.`, such as `a.b:run.output` |
963
+ | `TemporarySymbols` | `Temporaries` | Procedure symbol and output port joined by `.`, such as `a.b:run.output` |
974
964
  | `ProcedureSymbols` | `Procedures` | Owning node path and procedure name joined by `:`, such as `a.b:run` |
975
965
 
976
966
  Symbols identify nodes, variables, and procedures in diagnostics and when
@@ -979,21 +969,22 @@ building [state transitions](#state-transitions).
979
969
  ### VariableAliases
980
970
 
981
971
  ```wirely
982
- // An alias referring to a state or temporary variable.
972
+ // An alias referring to a state or temporary variable or a static value.
983
973
  // VariableAliases table.
984
974
  struct type VariableAlias {
985
975
  // Alias name in SymbolData.
986
976
  Name: StringRef,
987
- // Old state, new state, or temporaries.
977
+ // Old state, new state, temporaries, or static values.
988
978
  Bank: uint8,
989
- // Index into StateVariables or Temporaries, selected by Bank.
979
+ // Index into StateVariables, Temporaries, or StaticValues, selected by
980
+ // Bank.
990
981
  Variable: Ref,
991
982
  }
992
983
  ```
993
984
 
994
985
  Aliases map source names, including the inputs and outputs of nodes, to
995
- the variable that stores their value. They are sorted by UTF-8 name bytes.
996
- Multiple aliases can refer to one variable.
986
+ the variable or static value that supplies their value. They are sorted by
987
+ UTF-8 name bytes. Multiple aliases can refer to one variable.
997
988
 
998
989
  ### SymbolData
999
990
 
@@ -1073,8 +1064,8 @@ Bytes not referenced by any record are not checked. This includes bytes of
1073
1064
 
1074
1065
  Every reference fits its target: `Ref` and `OptionalRef` indices, ranges,
1075
1066
  `ByteRange` byte ranges, and `StringRef` byte ranges, whose bytes are valid
1076
- UTF-8. Small enumerated fields such as `Bank` and `IsList` have listed
1077
- values, and padding is zero.
1067
+ UTF-8. Small enumerated fields such as `Bank` have listed values, and
1068
+ padding is zero.
1078
1069
 
1079
1070
  ### Types and values
1080
1071
 
@@ -1096,7 +1087,8 @@ when lists share bytes.
1096
1087
  starts at or after the end of the previous one. Comparing each entry with
1097
1088
  its predecessor therefore shows that slots do not overlap and gives the
1098
1089
  buffer size. Their types, and those of locals, constant and immediate
1099
- operands, and native function parameters and results, are runtime types.
1090
+ operands, static input sources and aliases, and native function
1091
+ parameters and results, are runtime types.
1100
1092
 
1101
1093
  ### Names and bindings
1102
1094
 
@@ -1104,11 +1096,11 @@ Sorting turns uniqueness into a comparison with the predecessor. This
1104
1096
  applies to ranges into `InterfaceNames`, `InputInterfaces`, and
1105
1097
  `ResourceInterfaces`, to `NativeStateTypes`, `NativeProcedures`, and
1106
1098
  `NativeFunctions`, and to aliases. Bindings refer to entries in the
1107
- matching range of their native procedure or native state type, and their
1108
- source and provider counts match `IsList`. A resource provider's output
1109
- lies within its type's `ResourceOutputInterfaces` and has the resource
1110
- type of the interface it is bound to. Each symbol table has as many
1111
- entries as its target table.
1099
+ matching range of their native procedure or native state type.
1100
+ Each value input binds one source, and each resource input binds one
1101
+ provider. A resource provider's output lies within its type's
1102
+ `ResourceOutputInterfaces` and has the resource type of the interface it
1103
+ is bound to. Each symbol table has as many entries as its target table.
1112
1104
 
1113
1105
  ### Procedures and code
1114
1106
 
@@ -0,0 +1,112 @@
1
+ # Compiler stages
2
+
3
+ The compiler first builds graphs describing node types and their connections.
4
+ It then uses those graphs to generate a runtime program. Use the Python API
5
+ in two steps:
6
+
7
+ - `wirely.compiler.compile_files()` reads `.wrl` files; `compile_strs()`
8
+ accepts filename/text pairs. Both return the graph of top-level
9
+ declarations, called the global graph, after resolving declarations,
10
+ connecting ports, and checking the graphs.
11
+ - `wirely.compiler.program.compile()` takes that graph, evaluates each
12
+ instance's parameters, and generates a runtime program.
13
+
14
+ Both parts report language errors through `on_diagnostic`, or print them
15
+ when no callback is supplied, and return `None` on failure. For example,
16
+ `compile_files()` reports an unknown node type or a connection with the
17
+ wrong value type. `program.compile()` reports a failed assertion that depends
18
+ on an instance's parameters or a cycle in procedure execution dependencies.
19
+
20
+ ## Read and parse sources
21
+
22
+ 1. **Load sources.** `compile_files()` reads the requested files.
23
+ `compile_strs()` accepts their contents directly. Both include standard
24
+ library sources when `add_std` is enabled.
25
+ 2. **Parse sources.** `parser.parse_sources()` splits each file into tokens,
26
+ checks its grammar, and builds a syntax tree of declarations and
27
+ expressions. The tree retains attributes and source positions so later
28
+ stages can report errors at the relevant text.
29
+ 3. **Validate source metadata.** `validate_source_metadata()` checks file
30
+ attributes and native function name collisions.
31
+
32
+ The source outline and editing helpers use
33
+ `parser.parse_str()` directly. They stop at parsing and syntax-tree
34
+ construction, so they can read and edit files with errors that would be
35
+ detected by later compiler stages.
36
+
37
+ ## Build node type graphs
38
+
39
+ `CompilerCoordinator` runs the following stages for all declared node types,
40
+ including unused ones. Top-level declarations go through the same stages.
41
+ A type's graph describes its ports, storage, procedures, and child nodes;
42
+ parameter values can still depend on how the type will be instantiated.
43
+
44
+ 1. **`collect_declarations`.** Register names and check duplicates and
45
+ restrictions on where declarations may appear. Combine repeated namespace
46
+ blocks into the same scope. Collect nested node types for processing
47
+ independently of the types that enclose them.
48
+ 2. **`prepare_interfaces`.** Resolve parameter types, struct fields, and
49
+ function signatures. Create objects for declared node ports, procedure
50
+ ports, and local storage. A procedure port declared by reference gets its
51
+ type from the referenced port during `bind_bodies`. This stage prepares
52
+ each type's own declarations; the node instances inside its body are
53
+ resolved next.
54
+ 3. **`resolve_instance_declarations`.** Find the type of each child node and
55
+ check its parameter assignments. Keep references to enclosing parameters
56
+ for later evaluation. Record which types instantiate other types.
57
+ 4. **`check_containment_cycles`.** Reject a type that directly or indirectly
58
+ instantiates itself, including in unused types. Report the declarations
59
+ forming the cycle. Declaring a type inside another type does not itself
60
+ instantiate it.
61
+ 5. **`create_child_interfaces`.** Create child instance objects and their
62
+ input and output ports with `NodeType.create_instance_interface()`.
63
+ All child ports exist before `bind_bodies` resolves references and makes
64
+ connections. Storage and procedures inside those instances are filled in
65
+ later.
66
+ 6. **`bind_bodies`.** Resolve procedure port references and the types they
67
+ inherit. Check parameter defaults, constants, and assertion expressions.
68
+ Resolve initializer dependencies and connect ports named in procedure
69
+ dependency and output declarations. Then apply explicit `connect`
70
+ statements in their relative source order. This order preserves
71
+ multi-input ordering and the choice of storage for procedure outputs.
72
+ 7. **`validate_bodies`.** Check that procedure inputs and local storage have
73
+ sources. Reject local aliases that refer back to themselves. Each body,
74
+ including the top-level body, is now connected and checked.
75
+ 8. **`populate_instances`.** Fill in existing child instances with storage,
76
+ procedures, aliases, state-copy sources, and initializer dependencies
77
+ from their type graphs, using `NodeType.populate_instance()`. Process
78
+ child types before the types that instantiate them. Keep the same port
79
+ objects so previously established connections remain valid.
80
+
81
+ The coordinator controls this order. Creating or populating an instance
82
+ never starts another compiler stage. Each preparation operation is marked
83
+ complete only after it succeeds. Types and constants that depend on other
84
+ declarations can resolve those dependencies when first needed, with separate
85
+ checks for cycles in those references.
86
+
87
+ `wirely.compiler.analysis.analyze()` runs the stages through
88
+ `create_child_interfaces` to resolve the port and parameter types of
89
+ programs that do not compile. It continues after an error in a
90
+ declaration, instance, or parameter binding and reports all errors with
91
+ their source offsets. Its connection checks apply the rules of
92
+ `bind_bodies` to single connections without binding the program.
93
+
94
+ ## Generate the runtime program
95
+
96
+ `program.compile()` calls `program.lower_program()` with the global graph.
97
+ If there are top-level storage declarations, procedures, constants, or
98
+ assertions, it creates an instance representing those top-level declarations.
99
+
100
+ `program.specialize_instances()` visits each use of a node type. Through
101
+ `InstanceNode.specialize()`, it evaluates parameters, defaults, constants,
102
+ and assertions, resolves parameter-dependent types, and allocates state
103
+ storage. It also assigns instance paths and shares singleton instances.
104
+ For example, two nodes using the same type can have different parameter
105
+ values and separate storage even though they use the same type graph.
106
+
107
+ The remaining work in `lower_program()` maps connection sources to runtime
108
+ storage, orders procedures and native node construction after their
109
+ dependencies, translates Wirely procedure bodies into instructions, and
110
+ builds the runtime program tables. Checks that require an instance's actual
111
+ parameter values or procedure port types happen during this part of
112
+ `program.compile()`.