{"id":13412740,"url":"https://github.com/ichiban/prolog","last_synced_at":"2026-01-22T07:38:39.440Z","repository":{"id":37051827,"uuid":"309559034","full_name":"ichiban/prolog","owner":"ichiban","description":"The only reasonable scripting engine for Go.","archived":false,"fork":false,"pushed_at":"2024-07-09T10:25:31.000Z","size":2776,"stargazers_count":561,"open_issues_count":15,"forks_count":27,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-07-31T20:51:22.309Z","etag":null,"topics":["go","golang","interpreter","logic-programming","prolog"],"latest_commit_sha":null,"homepage":"","language":"Go","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/ichiban.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}},"created_at":"2020-11-03T03:16:31.000Z","updated_at":"2024-07-30T06:58:04.000Z","dependencies_parsed_at":"2023-02-19T13:31:16.148Z","dependency_job_id":"c120dd1c-05cf-475b-bb20-8a284b6f13e2","html_url":"https://github.com/ichiban/prolog","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/ichiban/prolog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ichiban%2Fprolog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ichiban%2Fprolog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ichiban%2Fprolog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ichiban%2Fprolog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ichiban","download_url":"https://codeload.github.com/ichiban/prolog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ichiban%2Fprolog/sbom","scorecard":{"id":480269,"data":{"date":"2025-08-11","repo":{"name":"github.com/ichiban/prolog","commit":"6375564ab31421106e3e1d727e4c0274750cfcd7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 3/15 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/ichiban/prolog/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/ichiban/prolog/go.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/ichiban/prolog/go.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2021-0227 / GHSA-3vm4-22fp-5rfm","Warn: Project is vulnerable to: GO-2022-0968 / GHSA-gwc9-m7rh-j2ww","Warn: Project is vulnerable to: GO-2021-0356 / GHSA-8c26-wmh5-6g9v","Warn: Project is vulnerable to: GO-2024-2961","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8","Warn: Project is vulnerable to: GO-2022-0603 / GHSA-hp87-p4gw-j4gq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T16:25:33.180Z","repository_id":37051827,"created_at":"2025-08-19T16:25:33.181Z","updated_at":"2025-08-19T16:25:33.181Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28658107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","golang","interpreter","logic-programming","prolog"],"created_at":"2024-07-30T20:01:28.576Z","updated_at":"2026-01-22T07:38:39.425Z","avatar_url":"https://github.com/ichiban.png","language":"Go","readme":"# ![prolog - the only reasonable scripting engine for Go](prolog.gif)\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/ichiban/prolog.svg)](https://pkg.go.dev/github.com/ichiban/prolog)\n[![Actions Status](https://github.com/ichiban/prolog/actions/workflows/go.yml/badge.svg)](https://github.com/ichiban/prolog/actions)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ichiban/prolog)](https://goreportcard.com/report/github.com/ichiban/prolog)\n[![codecov](https://codecov.io/gh/ichiban/prolog/branch/main/graph/badge.svg?token=2FC3PZY7LN)](https://codecov.io/gh/ichiban/prolog)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\n## What is this?\n\n`ichiban/prolog` is an embeddable **ISO Prolog** interpreter in **Go**.\n\n- **Standards-compliant:**\n  - [ISO/IEC 13211-1:1995 Information technology — Programming languages — Prolog — Part 1: General core](https://www.iso.org/standard/21413.html)\n  - [A Prologue for Prolog](http://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue)\n  - [DCGs](https://www.complang.tuwien.ac.at/ulrich/iso-prolog/dcgs/dcgsdraft-2019-06-03.pdf)\n- **Easy to integrate:** `database/sql`-like Go API\n- **Highly customizable:**\n  - Sandboxing\n  - Custom predicates in Go\n  - Custom terms (data types) in Go\n\n## Comparison with Other Libraries\n\n|             | **prolog**             | otto            | go-lua          |\n| ----------- | ---------------------- | --------------- | --------------- |\n| Language    | ISO Prolog             | ECMA Script     | Lua             |\n| Paradigm    | 🎓 Logic               | Object-oriented | Object-oriented |\n| Go API      | 😻 `database/sql`-like | original        | original        |\n| Declarative | ✅                     | ❌              | ❌              |\n| Sandboxing  | ✅                     | ❌              | ✅              |\n\n## Getting started\n\n### Install latest version\n\n```console\ngo get -u github.com/ichiban/prolog\n```\n\n### Usage\n\n#### Instantiate an interpreter\n\n```go\np := prolog.New(os.Stdin, os.Stdout) // Or `prolog.New(nil, nil)` if you don't need user_input/user_output.\n```\n\nOr, if you want a sandbox interpreter without any built-in predicates:\n\n```go\n// See examples/sandboxing/main.go for details.\np := new(prolog.Interpreter)\n```\n\n#### Load a Prolog program\n\n```go\nif err := p.Exec(`\n\thuman(socrates).       % This is a fact.\n\tmortal(X) :- human(X). % This is a rule.\n`); err != nil {\n\tpanic(err)\n}\n```\n\nSimilar to `database/sql`, you can use placeholder `?` to insert Go data as Prolog data.\n\n```go\nif err := p.Exec(`human(?).`, \"socrates\"); err != nil { // Same as p.Exec(`human(\"socrates\").`)\n\tpanic(err)\n}\n```\n\n#### Run the Prolog program\n\n```go\nsols, err := p.Query(`mortal(?).`, \"socrates\") // Same as p.Query(`mortal(\"socrates\").`)\nif err != nil {\n\tpanic(err)\n}\ndefer sols.Close()\n\n// Iterates over solutions.\nfor sols.Next() {\n\tfmt.Printf(\"Yes.\\n\") // ==\u003e Yes.\n}\n\n// Check if an error occurred while querying.\nif err := sols.Err(); err != nil {\n\tpanic(err)\n}\n```\n\nOr, if you want to query for the variable values for each solution:\n\n```go\nsols, err := p.Query(`mortal(Who).`)\nif err != nil {\n\tpanic(err)\n}\ndefer sols.Close()\n\n// Iterates over solutions.\nfor sols.Next() {\n\t// Prepare a struct with fields which name corresponds with a variable in the query.\n\tvar s struct {\n\t\tWho string\n\t}\n\tif err := sols.Scan(\u0026s); err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Printf(\"Who = %s\\n\", s.Who) // ==\u003e Who = socrates\n}\n\n// Check if an error occurred while querying.\nif err := sols.Err(); err != nil {\n\tpanic(err)\n}\n```\n\n## The Default Language\n\n`ichiban/prolog` adheres the ISO standard and comes with the ISO predicates as well as the Prologue for Prolog and DCG predicates.\n\nSee [the Wiki](https://github.com/ichiban/prolog/wiki) for the directives and the built-in predicates.\n\n### Top Level\n\n`1pl` is an experimental top level command for testing the default language and its compliance to the ISO standard.\n\nYou can install it with `go install`:\n\n```console\ngo install github.com/ichiban/prolog/cmd/1pl@latest\n```\n\nThen, you can enter the top level with `1pl`:\n\n```console\n$(go env GOPATH)/bin/1pl [\u003cfile\u003e...]\n```\n\n## Extensions\n\n- **[predicates](https://github.com/guregu/predicates):** Native predicates for ichiban/prolog.\n- **[kagomelog](https://github.com/ichiban/kagomelog):** a Japanese morphological analyzing predicate.\n\n## License\n\nDistributed under the MIT license. See `LICENSE` for more information.\n\n## Contributing\n\nSee `ARCHITECTURE.md` for architecture details.\n\n1. Fork it (https://github.com/ichiban/prolog/fork)\n2. Create your feature branch (git checkout -b feature/fooBar)\n3. Commit your changes (git commit -am 'Add some fooBar')\n4. Push to the branch (git push origin feature/fooBar)\n5. Create a new Pull Request\n\n## Acknowledgments\n\nWe would like to extend our thanks to the following individuals for their contributions to this project:\n\n- [guregu](https://github.com/guregu) for contributing code and ideas\n- [Markus Triska](https://github.com/triska) for his deep knowledge and insights on modern Prolog, as evidenced by his insightful comments on issues\n- [Prof. Ulrich Neumerkel](https://github.com/UWN) for valuable guidance, his [works on ISO standards](http://www.complang.tuwien.ac.at/ulrich/iso-prolog/), [the Prologue for Prolog](http://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue), and DCGs.\n\nWe are grateful for the support and contributions of everyone involved in this project. Arigatou gozaimasu!\n","funding_links":[],"categories":["可嵌入的脚本语言","Embeddable Scripting Languages","Relational Databases","Go"],"sub_categories":["检索及分析资料库","Search and Analytic Databases","Advanced Console UIs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fichiban%2Fprolog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fichiban%2Fprolog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fichiban%2Fprolog/lists"}