{"id":47757326,"url":"https://github.com/dontpanic92/protosept","last_synced_at":"2026-04-03T04:37:40.643Z","repository":{"id":345030358,"uuid":"978244740","full_name":"dontpanic92/protosept","owner":"dontpanic92","description":"The Protosept Programming Language","archived":false,"fork":false,"pushed_at":"2026-03-25T16:48:03.000Z","size":1615,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-25T21:44:52.524Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dontpanic92.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-05T17:31:33.000Z","updated_at":"2026-03-25T16:48:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dontpanic92/protosept","commit_stats":null,"previous_names":["dontpanic92/protosept"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dontpanic92/protosept","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dontpanic92%2Fprotosept","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dontpanic92%2Fprotosept/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dontpanic92%2Fprotosept/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dontpanic92%2Fprotosept/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dontpanic92","download_url":"https://codeload.github.com/dontpanic92/protosept/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dontpanic92%2Fprotosept/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31333745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T03:20:36.090Z","status":"ssl_error","status_checked_at":"2026-04-03T03:20:35.133Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-03T04:37:37.986Z","updated_at":"2026-04-03T04:37:40.638Z","avatar_url":"https://github.com/dontpanic92.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Protosept Programming Language\n\nProtosept is a statically-typed, scripting-oriented language.\nThis repository contains a Rust implementation of a compiler + bytecode interpreter, a minimal CLI, and a VS Code extension for basic language support.\n\n## Language goals and features\n\n- Language spec (draft): `specs/protosept-language.md`\n- CLI argument behavior spec: `specs/p7-cli.md`\n\n\nProtosept’s design centers on making code easy to review and reason about, especially in AI coding era:\n\n- **Statically typed, scripting feel**: lightweight syntax and fast iteration, backed by compile-time type checking.\n- **Auditability-first**: syntax and semantics aim to make intent, data flow, and “what happens at runtime” obvious during human review.\n- **Explicit data semantics**: signatures distinguish plain values (`T`), borrowed views (`ref\u003cT\u003e`), and owned GC-heap handles (`box\u003cT\u003e`).\n- **Correctness by default**: nullability is explicit (e.g. `?T`), and the language favors making error-prone behavior visible at the type level.\n- **Tooling-friendly**: the compiler can support shorthands for authoring, while tooling can canonize code to a more explicit, unambiguous form for review.\n- **Embedding/host interop**: the ownership/borrowing model is meant to map cleanly onto host systems for predictable integration.\n\n### Feature tour (snippet)\n\nThe syntax below is intended to showcase the “shape” of the language (and largely matches what’s exercised in `tests/`).\n\n```p7\n// Values vs borrows vs heap handles\nfn add_one(x: ref\u003cint\u003e) -\u003e int {\n  *x + 1\n}\n\n// Protos (structural interfaces) + dynamic dispatch via box\u003cProto\u003e\nproto Printable {\n  fn print(self: ref\u003cPrintable\u003e) -\u003e int;\n}\n\nfn use_printable(p: box\u003cPrintable\u003e) -\u003e int {\n  p.print()\n}\n\n// Different concrete types can be used where a `Printable` is expected.\n// Conformance is checked structurally (required methods + signatures).\nstruct Dog(\n  pub name: string,\n) {\n  pub fn print(self: ref\u003cDog\u003e) -\u003e int {\n    42\n  }\n}\n\n// Explicit proto conformance declaration. Compiler will ensure Cat implements Printable.\nstruct[Printable] Cat(\n  pub name: string,\n) {\n  pub fn print(self: ref\u003cCat\u003e) -\u003e int {\n    99\n  }\n}\n\n// Enums + pattern matching\nenum ErrorType(\n  ErrorA,\n  ErrorB,\n  ErrorC\n);\n\nfn[throws] thrower(code: int) -\u003e int {\n  if code == 1 { throw ErrorType.ErrorA; }\n  if code == 2 { throw ErrorType.ErrorB; }\n  if code == 3 { throw ErrorType.ErrorC; }\n  7\n}\n\nfn main() -\u003e int {\n  // Explicit nullability + coalescing\n  let maybe: ?int = null;\n  let base = maybe ?? 10;\n\n  // Borrowing (ref) and deref. `\u0026base` is a short hand of `ref(base)`\n  let bumped = add_one(\u0026base);\n\n  // Heap allocation (box) + cast to protocol for dynamic dispatch\n  // Sigil ^Dog is a short hand of `box(Dog)`\n  let dog = ^Dog(name = \"Rex\");\n  let cat = ^Cat(name = \"Mittens\");\n\n  // box\u003cCat\u003e can be implicitly upcast to box\u003cPrintable\u003e since the conformance is explictly declared\n  let printed = use_printable(dog as ^Printable) + use_printable(cat);\n\n  // try/else with pattern matching on thrown values\n  let recovered = try thrower(3) else {\n    _: ErrorType.ErrorA =\u003e 1,\n    _: ErrorType.ErrorB =\u003e 2,\n    _: _ =\u003e 999,\n  };\n\n  bumped + printed + recovered\n}\n```\n\n## Workspace layout\n\n- `p7/` — core library crate: lexer/parser/semantic analysis, bytecode, interpreter.\n- `p7-cli/` — CLI binary crate. Builds the `p7` executable.\n- `unp7/` — helper crate used for disassembly/debugging.\n- `std/` — standard library modules (loaded by the CLI for `import std.*`).\n- `tests/` — `.p7` test files run by the CLI test harness.\n- `p7-vscode/` — VS Code extension (syntax highlighting + language config).\n\n## Build\n\nRequires a recent Rust toolchain (this workspace uses `edition = \"2024\"`).\n\n```bash\ncargo build\n```\n\nTo build an optimized binary:\n\n```bash\ncargo build --release\n```\n\n## CLI (p7)\n\nThe CLI binary is `p7` (from the `p7-cli` crate).\n\nRun via Cargo:\n\n```bash\ncargo run -p p7-cli -- --help\n```\n\n### Run a script\n\nDirect script mode (Python-like):\n\n```bash\ncargo run -p p7-cli -- path/to/script.p7\n```\n\nNotes:\n\n- The CLI currently compiles and runs the script using entrypoint function name `main`.\n  Your script should define `fn main() { ... }`.\n- Tokens after the script path are forwarded as “script args” per the CLI spec, but the runtime does not currently expose argv to the program.\n\n### Subcommands\n\n- `run`: explicit run mode; requires `--` to forward script args\n\n```bash\ncargo run -p p7-cli -- run path/to/script.p7 -- --any -args you-want\n```\n\n- `repl`: starts a minimal REPL shell (evaluation is not implemented yet)\n\n```bash\ncargo run -p p7-cli -- repl\n```\n\n- `version`:\n\n```bash\ncargo run -p p7-cli -- version\n```\n\n### Standard library resolution\n\nWhen the CLI resolves imports:\n\n- `import std.*` loads from the repository’s `std/` directory (found relative to the `p7` executable).\n- Other module paths are resolved relative to the directory of the entry script.\n- `import builtin` is always available (bundled into the `p7` crate).\n\n## Tests\n\nThe CLI has a small test harness (`p7 test`) that scans `.p7` files for functions tagged with `@test(...)` and executes them.\n\nRun all tests in `tests/`:\n\n```bash\ncargo run -p p7-cli -- test\n```\n\nRun a single test file:\n\n```bash\ncargo run -p p7-cli -- test tests/test_basic_operations.p7\n```\n\nCompile-fail tests: add a line starting with `// compile_fail` anywhere in the `.p7` file.\n\n## VS Code extension\n\nThe VS Code extension lives in `p7-vscode/` and currently provides:\n\n- `.p7` language registration\n- basic bracket/comment configuration\n- a TextMate grammar for syntax highlighting\n\n## License\n\nMIT. See `LICENSE`.\n\nTo try it locally, open `p7-vscode/` in VS Code and use the extension development workflow (Run → Start Debugging).\n\n## Status / known limitations\n\nThis is an early-stage implementation.\nA few notable current limitations (non-exhaustive):\n\n- REPL does not evaluate code yet.\n- Script argument forwarding exists at the CLI level, but argv is not surfaced inside the runtime.\n- The CLI does not currently print the return value of `main`.\n\nFor intended semantics and design goals, see `specs/protosept-language.md`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdontpanic92%2Fprotosept","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdontpanic92%2Fprotosept","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdontpanic92%2Fprotosept/lists"}