Commit Graph

5 Commits

Author SHA1 Message Date
Will Anderson f2202e0e5e Merge worktree-agent: add struct literals, generics, print/log builtins 2026-04-28 11:51:02 -05:00
Will Anderson 977a2cd654 Add struct literals, generics, log/print stdlib registration, activate DB wiring
- Register print/println/log/print_err in TypeEnv::with_builtins() with polymorphic (Unknown) param type so any value type is accepted without spurious warnings
- Add StructLit expr to AST + parser (uppercase-IDENT { ... } syntax), BuildStruct bytecode instruction + Struct value to runtime
- Add type_params to FnDef AST node and TypeParam variant to TypeExpr; parser parses <T, E> generics; type checker treats TypeParam as Unknown (universal type)
- Rewrite interpreter to support user-defined function calls via call stack (Frame + return_ip); dispatch_builtin handles print/println/log/print_err/__build_list__
- Fix engram_activate_search to unwrap { results: [...] } response envelope from /search; use std::net for sync HTTP to avoid reqwest dependency
- Add run-file command to CLI for single-file execution without el.toml
- Fix worktree engram-crypto path dep
2026-04-28 11:36:25 -05:00
Will Anderson c427a0adc0 finish engram-lang: protocols, decorators, imports, Result, closures, stdlib, integration tests 2026-04-27 20:22:23 -05:00
Will Anderson 316c0a85ce Add server-side builtins, import system, and http_serve for Neuron Code rewrite
- Import resolution: resolve_imports() pre-processes import statements by
  reading and concatenating referenced .el files before compilation
- http_serve builtin: tiny_http-based server on configurable port; POST
  /axon/message stores request in __request__ state, invokes handle_request
  entry point via sub-interpreter, reads __response__ state for reply
- New builtins: blake3_hash, uuid_new, fs_list_recursive, fs_mkdir, fs_exists,
  path_join, path_parent, str_trim, str_contains, str_replace, str_starts_with,
  str_ends_with, str_last_index_of, json_get, json_array_push, json_array_len,
  now_millis, http_get, http_post, int_to_str
- Catch-all arms in el-types and el-compiler for new AST variants (Import,
  ProtocolDef, ImplDef, Closure, Try, MapLiteral, TypeExpr::Result, TypeExpr::Map)
- Parser: decorators field on FnDef, import/protocol/impl parsing
2026-04-27 20:08:55 -05:00
Will Anderson 0a36a454f9 feat: unified testing framework — unit and e2e same syntax, seed-based graph testing, debugger infrastructure
- 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
2026-04-27 19:11:59 -05:00