examples/html-page.el demonstrates HTML template syntax:
- <!doctype html> prefix handling
- Attribute values (static and interpolated)
- {#each list as item} iteration
- Auto-escaped interpolation via {expr}
- Self-closing void elements (meta, br, etc.)
Rebuilt dist/platform/elc from modified compiler source. The new
binary is self-hosted from the HTML-capable compiler source and
passes the standard identity check.
No native_js or native_js_call anywhere. Full browser auth flow expressed
with proper El constructs:
- extern fn supabase_create_client(url, key) -> Any
Declares the Supabase CDN global without an El function body.
- client.auth.signInWithOtp(opts)
Direct method call chain on Any-typed value. The client is built by
calling the extern fn; .auth field access and .signInWithOtp(opts)
method call emit clean JS without any escape hatch.
- try { ... } catch (err: Any) { ... }
Wraps the auth call; unexpected runtime errors are caught and shown
to the user rather than crashing silently.
- fn(event: Any) -> Void { ... }
Inline anonymous function literals for DOM event listeners instead
of named forward-declared callbacks.
The rewrite is the proof: every browser JavaScript pattern used in a
real auth flow can now be expressed structurally in El.
Iteration 5:
? nil-propagation: Field and Index handlers in js_cg_expr now detect when
the object expression is a Try node (the AST node for postfix `?`).
When detected, emit JS optional chaining: `(expr)?.["field"] ?? null`.
The `?? null` normalizes JS undefined to El's null. A bare `expr?` not
followed by field/index still passes through unchanged.
browser-auth.el: a realistic 130-line example demonstrating:
- @async function with Supabase via native_js_call
- DOM bridge: get/set value/text/attr, add/remove class, show/hide
- local_storage_get/set for session hints
- window_on_load for initialization
- window_set to expose functions to the browser global scope
- set_timeout for transient state, is_valid_email for input validation
Compiles cleanly with elc --target=js --bundle
Spec updated: status promoted to Phase 4 / ~80% coverage, nil-prop
status updated, new example referenced.
- el_runtime.js: add 19 dom_* builtins (browser-only, throw in Node),
window_set/window_get for exposing El functions to the browser global
scope, and native_js/native_js_call escape hatches for third-party libs
- codegen-js.el: destructure all new builtins in generated preamble; add
@async decorator support that emits async function + await at call sites
for known-async HTTP builtins and user-declared @async functions; pre-
registration pass ensures forward calls to @async functions get await
- spec/codegen-js.md: mark Phase 3 (DOM bridge) implemented, document
@async approach and its limitations, update builtin table and status
- examples/browser-counter.el: canonical example showing dom_get_element,
dom_set_text, dom_is_null, window_set, and state_set/get
1. Parser+codegen: bare reassignment `x = expr` inside an if-body
was compiling to three orphan expressions with no store. Now
emits a real assignment.
2. Runtime json_get: dot-path segments that are all digits now
correctly traverse array indices. `json_get(s, "0.field")` works.
3. Runtime HTTP writer: response bodies starting with
`{"__status__":<int>,...}` now set the HTTP status header to
that value and strip the marker from the served body. Existing
404/401/503 paths in product code now produce real status codes
instead of HTTP 200 with the status hidden in the body.
Self-host fixed point holds: gen2 == gen3 byte-identical.
Snapshot tagged at dist/platform/elc.20260502-1231-self-host.
Backlog: bl-c121edda
- New crate el-test: test discovery, in-memory graph seeding, assertion evaluator, TestRunner, TestReport with human/JSON/JUnit XML output
- New keywords: test, seed, assert, target — fully integrated into lexer, parser, codegen, type-checker
- Parser extensions: TestDef, SeedStmt, Assert AST nodes; seed blocks handle type: as field name (keyword-as-ident in seed context)
- Debugger: DebugEvent, Debugger, StepMode, StackFrame in el-compiler — breakpoints, step-over, step-into, step-out
- CLI: el test-file <file.el> runs tests; el test integrates with project; el debug attaches debugger; --output json|junit for CI
- 52 new tests in el-test covering discovery, graph seeding, assertion evaluation, pass/fail/error/skip, report generation, JUnit XML
- Example: examples/hello-project/src/tests.el — 6 unit tests pass, 1 e2e test correctly skipped without ENGRAM_URL