Skip to content

Add v0.1 skeleton: spec, parser/runtime, CLI, hello example, tests, CI#2

Closed
minglong51 wants to merge 2 commits into
mainfrom
codex/add-v0.1-project-skeleton-for-threadlang
Closed

Add v0.1 skeleton: spec, parser/runtime, CLI, hello example, tests, CI#2
minglong51 wants to merge 2 commits into
mainfrom
codex/add-v0.1-project-skeleton-for-threadlang

Conversation

@minglong51

Copy link
Copy Markdown
Owner

Motivation

  • Provide a minimal, well-structured v0.1 interpreter skeleton for ThreadLang to enable deterministic parsing and traceable runtime behavior.
  • Support only the small language subset required to run the included hello example so future work can safely extend features.
  • Make the project runnable and testable locally and in CI with no third-party runtime dependencies for v0.1.

Description

  • Added packaging (pyproject.toml), a console script thread (src/threadlang/cli.py), and package exports (src/threadlang/__init__.py).
  • Implemented dataclass AST nodes in src/threadlang/ast.py (Program, ContextAssign, Emit, StringLiteral, VariableRef, Concat).
  • Implemented a minimal deterministic parser in src/threadlang/parser.py supporting thread Name { ... }, context { key = "string" }, emit text { ... }, context.<key>, inputs.<key>, and + concatenation, plus placeholder handling for inputs/rules/steps blocks.
  • Implemented runtime in src/threadlang/runtime.py that evaluates the AST and returns RunResult(output, trace) with trace events (parse_ok, context_set, emit).
  • Added docs (docs/spec.md, docs/grammar.ebnf), example program (examples/hello.thread), golden test (tests/test_golden_hello.py), and GitHub Actions workflow (.github/workflows/ci.yml).
  • Updated README.md with local run/test instructions and the hello example command.

Testing

  • Attempted python -m pip install -e . which failed in this environment due to network/proxy restrictions when resolving build dependencies.
  • python -m pip install -e . --no-build-isolation succeeded in this environment.
  • python -m pytest passed (1 test), and the golden test tests/test_golden_hello.py asserts result.output == "Hello, world!" and a trace sequence ["parse_ok", "context_set", "emit"].
  • Executing the CLI example thread run examples/hello.thread --inputs name=world produced Hello, world! as expected.

Codex Task

@minglong51

Copy link
Copy Markdown
Owner Author

Superseded — main has long since shipped past this v0.1 skeleton (v0.8 as of June 2026). Closing stale PR.

@minglong51 minglong51 closed this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant