Skip to content

Commit 90712a6

Browse files
Refactor code
1 parent ba68e1b commit 90712a6

9 files changed

Lines changed: 216 additions & 582 deletions

File tree

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Automaginarium is a configurable universe generator for cellular automata. It extends the spirit of [Cellcosmos](https://github.com/multilingualprogramming/cellcosmos): instead of exploring only the 256 elementary Wolfram rules, it opens the rule space itself.
44

5-
The project is designed to demonstrate the expressive power of the Multilingual programming language. The canonical automata concepts are written in French Multilingual source, while JavaScript is kept as a thin browser layer for loading JSON configurations, drawing to canvas, and wiring only the essential interface events.
5+
The project is designed to demonstrate the expressive power of the Multilingual programming language. The canonical automata concepts are written in French Multilingual source, while JavaScript is kept as a thin browser layer for loading presets and JSON, drawing to canvas, generating optional rule tables, wiring the preset gallery, and handling only the essential interface events.
66

77
## Vision
88

@@ -34,7 +34,6 @@ The repository currently includes:
3434
- a canonical French Multilingual core in `src/automate_universel.ml`
3535
- a small JavaScript adapter in `public/automate-core.js` that mirrors the current core until the Multilingual/WASM build pipeline is wired
3636
- a canvas UI in `public/app.mjs`
37-
- a small progressive-enhancement layer in `public/ui.mjs`
3837
- copied Cellcosmos heritage references in `public/metrics.js` and `src/cellcosmos_primitives_heritage.ml`
3938
- example configurations and a JSON schema in `examples/`
4039
- migration and architecture documentation in `docs/`
@@ -116,5 +115,5 @@ Where source code is directly adapted, comments identify Cellcosmos as the origi
116115

117116
1. Compile more of `src/automate_universel.ml` through the Multilingual toolchain to WebAssembly or generated JavaScript.
118117
2. Replace more of `public/automate-core.js` with generated calls into the French core.
119-
3. Keep trimming browser-side helpers that do not strengthen the multilingual model.
118+
3. Keep trimming browser-side helpers that do not strengthen the multilingual model or the static deployment story.
120119
4. Add more generated rule spaces: totalistic, symmetric, genetic, stochastic, and multi-channel examples.

docs/architecture.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ Automaginarium is split into four layers:
66
examples/*.json declarative universes
77
src/automate_universel.ml canonical French Multilingual automata core
88
public/automate-core.js temporary browser adapter mirroring the core
9-
public/app.mjs DOM events, canvas drawing, preset loading
10-
public/ui.mjs small progressive-enhancement UI bridge
9+
public/app.mjs essential DOM events, canvas drawing, preset loading
1110
```
1211

1312
The intended stable boundary is the configuration object. The UI should not know Wolfram-specific details except where it offers a preset shortcut.
1413

14+
The browser layer is intentionally narrow: one module applies configuration objects, delegates evolution to the core bridge, renders the resulting universe, and wires a static preset gallery. Presentation-only concerns such as tab systems, mirrored form state, and client-side gallery choreography are not part of the long-term architecture.
15+
1516
Canonical JSON-array rule keys use forms such as `"[0,1,0]"`, rather than concatenated keys such as `"010"`. The browser adapter still accepts older Cellcosmos-style keys as a compatibility fallback.
1617

1718
The packed Multilingual/WASM bridge keeps the full French core as the canonical configuration and evolution model, while `src/automate_packed_wasm.ml` exposes a narrow numeric ABI for browser calls. The browser prefers `window.AutomaginariumPacked` when available and falls back to JavaScript only where rich JSON orchestration is still needed.

docs/gallery.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Preset Gallery
22

3-
The browser-rendered preset gallery uses the same Automaginarium configuration model as the main canvas.
3+
The preset gallery uses the same Automaginarium configuration model as the main canvas, but it is now authored directly in `public/index.html` and wired with a minimal click handler from `public/app.mjs`.
44

55
Current preset families:
66

@@ -11,7 +11,13 @@ Current preset families:
1111
- named-symbol table rules
1212
- multi-channel color examples
1313

14-
The gallery intentionally uses real generated thumbnails rather than static images. This keeps presets honest: if an example configuration breaks, the gallery breaks visibly and the smoke tests catch the missing file.
14+
The gallery intentionally stays lightweight:
15+
16+
- cards are static markup
17+
- labels and short descriptions are part of the document
18+
- clicks load the referenced JSON preset into the main laboratory
19+
20+
This preserves discoverability without requiring client-side thumbnail generation or a separate gallery state machine.
1521

1622
The static check is:
1723

0 commit comments

Comments
 (0)