| """ |
| TD Lang β Domain-specific language for Time Dilation project. |
| |
| Compiles .td files into Python code that calls td_fuse. |
| Write simple scripts instead of complex Python. |
| |
| Architecture: |
| td_lang/ |
| βββ __init__.py <- This file |
| βββ __main__.py <- Entry point for python -m td_lang |
| βββ grammar.py <- Lark grammar + parse tree transformer |
| βββ ast_nodes.py <- Dataclass AST nodes for each command |
| βββ compiler.py <- AST -> Python code generation |
| βββ executor.py <- Run compiled code, track lineage |
| βββ cli.py <- Command-line interface |
| βββ errors.py <- Custom exceptions |
| βββ examples/ |
| βββ demo_merge.td <- Basic merge example |
| βββ demo_heal.td <- Merge + heal example |
| βββ demo_full.td <- Full pipeline with gates + budget |
| βββ demo_loop.td <- Self-improvement loop example |
| βββ demo_phase3.td <- Fork/edit/prune/reset example |
| βββ demo_phase4.td <- Contracts + snapshot + report example |
| |
| Phase 1: load, merge, heal, eval, commit |
| Phase 2: diagnose, synth, train, debate |
| Phase 3: fork, reset, prune, edit |
| Phase 4: snapshot, report, data_contract, reward_contract |
| Phase 5: CLI polish, --version, info command, --verbose |
| Phase 6: fuse, absorb (easy merge) |
| Phase 7: repeat, if/else (loop control) |
| Phase 8: setup, on_error, notify, save (autopilot) |
| Phase 9: schedule (time-based execution) |
| Phase 10: download, log, compare, verify (toolbox) |
| Phase 11: vote, prompt, distill, rollback (intelligence) |
| Phase 12: curriculum, star, best_of, exploit (RL & fine-tuning) |
| Phase 13: arena (real RL with memory, curiosity, anti-lying, cross-check) |
| Engine upgrades: QLoRA training, self-contained eval, model-generated synth problems |
| Mega diagnose: self-diagnosis + domain profiling + layer speed testing |
| |
| Designed from interviews test_14 (10 commands) and test_17 (ForgeSpec 2.0). |
| """ |
|
|
| from .grammar import parse_td_file, parse_td_string |
| from .compiler import compile_program |
| from .executor import TDExecutor, check_td_file, compile_td_file, run_td_file |
|
|
| __version__ = "0.2.0" |
| __author__ = "Milan (TD Project)" |
|
|
| __all__ = [ |
| "parse_td_file", |
| "parse_td_string", |
| "compile_program", |
| "TDExecutor", |
| "check_td_file", |
| "compile_td_file", |
| "run_td_file", |
| "__version__", |
| "__author__", |
| ] |
|
|