prose: human-readable projection renderer (iter 20a)

New crate ailang-prose with one public fn module_to_prose(&Module)
-> String. Rust-flavour with braces, =>-match-arms, mode keywords
(own/borrow), effects as trailing 'with IO', Cons(1, Nil) ctor
form, /// doc strings.

Lossy projection where the LLM can re-derive: (con T) wrap,
(fn-type ...) wrap, (term-ctor ...) wrap. Load-bearing semantic
detail stays visible (modes, effects, clone, reuse-as, doc strings,
type annotations, tail flag).

CLI: 'ail prose <file.ail.json>' prints the projection.

3 snapshot fixtures + 28 unit tests. 215-line .ail.json reduces
to ~18 lines of legible source.

20b queued: infix arithmetic, paren elision, let-inlining, do
prettify.
This commit is contained in:
2026-05-08 18:06:16 +02:00
parent d8e80cb9c5
commit a9d57c5c81
11 changed files with 1171 additions and 0 deletions
Generated
+8
View File
@@ -9,6 +9,7 @@ dependencies = [
"ailang-check",
"ailang-codegen",
"ailang-core",
"ailang-prose",
"ailang-surface",
"anyhow",
"clap",
@@ -48,6 +49,13 @@ dependencies = [
"thiserror",
]
[[package]]
name = "ailang-prose"
version = "0.0.1"
dependencies = [
"ailang-core",
]
[[package]]
name = "ailang-surface"
version = "0.0.1"