PANINI

Hindi Programming System FAQ (2004 lineage) · WASM lowering · not a copilot last-mile note

FAQ

People have asked the same two questions for twenty years: “is this just #define?” and “can’t you just run it through wabt?” Both flatten the work. These answers do not.

1. Hindawi — is it #define je if?

No. That was the FAQ ten to fifteen years ago, and it is still the FAQ. A preprocessor macro is not a localized programming language.

After gcc -E, every vernacular token is gone. The translation unit never knew Hindi, Punjabi, or Bangla existed. Diagnostics name while / if. gdb’s break main is English. nm and .debug_str hold ASCII, not the author’s letters.

Hindawi changes the lexer. The 2004 path is:

Unicode  →  ACII  →  Romenagri (ASCII-7 kernel)  →  shaili lex (h2c / h2cpp / …)  →  gcc

Romenagri is a reversible kernel so gdb can still speak at the lowest layer. Identifiers round-trip. Keywords are kernel mappings, not macros. Script, language, and standard are three axes. #define cannot reach the script axis; the lexer must.

The negative example is in the tree: examples/faq/define_is_not_a_lexer.c. The bar is HindiC.uhin (2004, GPL). Done means a deliberate syntax error, gdb, and nm still answer in the programmer’s language. See WHY_DEFINE_IS_NOT_LOCALIZATION.md.

Line two of a Guru program is not decoration. #समावेश <मानकपन.स> is #include . If that line vanishes, the preprocessor was stripping C angle-includes. That was a bug. It is fixed: only the Shaili pragma <शैली गुरु> is stripped.

2. Why is that more complex than a keyword table?

3. The copilot said “just run wat2wasm / wasmtime.” What is it missing?

It starts after the compiler. It assumes WAT already exists, then packages it with an external toolkit. That is the cheap end of:

Source → AST → typed IR → postfix / RPN → WAT → binary → instantiate

We already instantiate. compute(5) = 25 is proven. The copilot’s own sample does not run:

copilot WAT  →  instantiate REJECT
  not enough arguments on the stack for i32.mul (need 2, got 0)

named WAT    →  compute(5) = 25

Its module used invalid (local $loc_0 i32 $loc_1 i32), unnamed (param i32), and flat instructions that are not S-expressions. If a parser had bound $loc_0 as a local, index 0 is the argument and $loc_0 would be 0: compute(5) would be 20, not 25. The comment “Output: 25” was not executed.

External tools (brew install wabt, pip install wabt, wasmtime) are a desktop toolchain. This estate ships on GitHub Pages. The emitter is PANINI (src/panini/backends/wasm.pni). The assembler is in-tree (runtime/wat2wasm.js). WebAssembly.instantiate is the W3C engine already in the browser.

The three WASM hurdles the copilot never named:

  1. Stack machine — every expression lowers post-order, not one demo line.
  2. Strict i32/i64/f32/f64 — C promotions become explicit nodes.
  3. One linear memory — $heap is calloc, $sp grows down, pointers are i32 offsets.

goto (Maṇḍūkapluti) is still on the C interpreter. WASM is structured. A br_table dispatcher is the next lowering, not wabt.

Hindi C flattens to the same AST, then to the same module. Representation stays off the binary. The copilot has no ILM path.

Live: wasm.html. Spec: WASM.md.

4. Notebook: Shaili Guru, C++, lex, Bhāṣā

Guru / समावेश
The second line after the Shaili pragma is the include. Host must show #include . A regex that deleted every <…> was eating it. Only <शैली …> is stripped now.
Hindi C++
HindiC++.uhin was not in docs/demos. Fetch returned an HTML 404 and the editor loaded markup. The demo is now docs/demos/HindiCPP.uhin (शैली श्रेणी). The loader refuses HTML.
Lex / Yacc / Bhāṣā
Retrieved samples exist (HindiLEX.uhin, HindiYACC.uhin). In-browser run of lex/yacc is still a host dump plus a gap label — not a fake interpreter. Language demos: 18 retrieved Guru files under docs/demos/langs/. Kashmiri, Santali, Manipuri, Sindhi Guru files are not invented; they wait in deposits.

5. May I Google-Translate the site?

Yes — the page chrome. No — the programming languages. Every pre, code, and textarea is marked notranslate. The selector in the header sends the URL to Google Translate with that contract. Keyword tables and .uhin stay in the author’s letters. People may still submit corrected prose in deposits/i18n.

6. What does “every turn” mean?

See PROCESS.md. Each cycle: grow examples/, update architect prompts and CONTEXT, fix named bugs, zip. Do not leave a working note only in chat.

Wikipedia: Hindawi Programming System · TechWelkin 2011 · PANINI poster, Zenodo