{"id":23251474,"url":"https://github.com/dplassgit/d2lang","last_synced_at":"2025-08-20T09:31:16.797Z","repository":{"id":62810639,"uuid":"363751535","full_name":"dplassgit/d2lang","owner":"dplassgit","description":"D2 is a strongly-typed, statically-typed, (mostly) inferred-type compiled language. ","archived":false,"fork":false,"pushed_at":"2024-05-22T23:59:23.000Z","size":15847,"stargazers_count":3,"open_issues_count":47,"forks_count":2,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2024-05-23T00:22:20.605Z","etag":null,"topics":["compiler","language","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Java","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/dplassgit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2021-05-02T21:15:25.000Z","updated_at":"2024-05-23T00:22:23.233Z","dependencies_parsed_at":"2023-10-15T02:05:22.499Z","dependency_job_id":"32527ee4-d6dd-462e-af64-c9a3523f18ca","html_url":"https://github.com/dplassgit/d2lang","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dplassgit%2Fd2lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dplassgit%2Fd2lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dplassgit%2Fd2lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dplassgit%2Fd2lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dplassgit","download_url":"https://codeload.github.com/dplassgit/d2lang/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230408116,"owners_count":18220977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["compiler","language","programming-language"],"created_at":"2024-12-19T09:18:30.039Z","updated_at":"2024-12-19T09:18:30.685Z","avatar_url":"https://github.com/dplassgit.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# d2lang\n\nD2 (d2lang) is a strongly-typed, statically-typed, inferred-type compiled language. \nIts syntax draws from C, Java and Python.\n\nThe D2 compiler currently compiles to X64 assembly language only. It uses\n`nasm` and `gcc` to assemble and link, respectively, to Windows executables.\n\nThere are hooks to support other architectures; the intermediate language\nis (mostly) target-agnostic and a 8085 backend is partially implemented.\n\nSee the [overview](docs/overview.md) for a more comprehensive description of the \ntypes, control structures, operators and statements in D2.\n\n**NOTE: D2 is not related in ANY way to [\"The D Programming Language\"](https://dlang.org/)\nexcept by coincidence of name.**\n\n\u003ctt\u003eA \u003ca href=\"http://www.plasstech.com/a-plass-program\"\u003ePLASS\u003c/a\u003e Program\u003c/tt\u003e\n\n\n## Contributing\n\nSee the [contributor's guide](CONTRIBUTING.md).\n\n\n### Installing\n\nThe following 4 are required:\n\n1. [bazel](https://github.com/bazelbuild/bazel)\n\n2. [nasm](https://www.nasm.us/)\n\n3. [gcc](https://gcc.gnu.org/install/binaries.html)\n\n4. Java 11 or higher\n\n5. Optional: Eclipse and git bash shell (mingw64)\n\n\n### Running Tests\n\nRun `bazel test ...` from the root directory.\n\n\n## Running the compiler\n\nSee [docs/running.md](docs/running.md).\n\n\n## Caveats\n\nOnly compiles to Intel x64. Only links against the Windows version of the `gcc`\nC Runtime Library. Can only use `nasm` and `gcc`. \n\nThere are [various bugs](https://github.com/dplassgit/d2lang/labels/bug).\n\n\n## Language sample\n\nCanonical hello world:\n\n```\nprintln \"Hello world\"\n```\n\n[Tower of Hanoi](samples/hanoi.d)\n\n```\n// Ported from toy (http://www.graysage.com/cg/Compilers/Toy/hanoi.toy)\n\nPEGS = [\"\", \"left\", \"center\", \"right\"]\n\nprintPeg: proc(peg: int) {\n  print PEGS[peg]\n}\n\nhanoi: proc(n: int, fromPeg: int, usingPeg: int, toPeg: int) {\n  if n != 0 {\n    hanoi(n - 1, fromPeg, toPeg, usingPeg)\n    print \"Move disk from \"\n    printPeg(fromPeg)\n    print \" peg to \"\n    printPeg(toPeg)\n    println \" peg\"\n    hanoi(n - 1, usingPeg, fromPeg, toPeg)\n  }\n}\n\nn = 5 // defines global\nhanoi(n, 1, 2, 3)\n```\n\nSee more [samples](samples)\n\n\n## Why did I build D2?\n\nSee [docs/history](docs/history.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdplassgit%2Fd2lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdplassgit%2Fd2lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdplassgit%2Fd2lang/lists"}