{"id":20409426,"url":"https://github.com/jsakamoto/spprologa","last_synced_at":"2025-07-26T13:03:49.431Z","repository":{"id":66230925,"uuid":"324296470","full_name":"jsakamoto/Spprologa","owner":"jsakamoto","description":"\"Build client web apps with Prolog\" - The library to make  Single Page Prolog Applications!","archived":false,"fork":false,"pushed_at":"2021-01-05T01:43:10.000Z","size":16378,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-23T04:43:33.204Z","etag":null,"topics":["blazor","prolog","spa"],"latest_commit_sha":null,"homepage":"https://jsakamoto.github.io/Spprologa/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsakamoto.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-12-25T05:45:51.000Z","updated_at":"2025-05-03T16:12:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5266e3e-8865-4f58-b246-8e0a0e7e1010","html_url":"https://github.com/jsakamoto/Spprologa","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jsakamoto/Spprologa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FSpprologa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FSpprologa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FSpprologa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FSpprologa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsakamoto","download_url":"https://codeload.github.com/jsakamoto/Spprologa/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FSpprologa/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267171003,"owners_count":24046883,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"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":["blazor","prolog","spa"],"created_at":"2024-11-15T05:41:41.523Z","updated_at":"2025-07-26T13:03:49.238Z","avatar_url":"https://github.com/jsakamoto.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spprologa [![NuGet Package](https://img.shields.io/nuget/v/Spprologa.CSProlog.svg)](https://www.nuget.org/packages/Spprologa.CSProlog/) [![Actions Status](https://github.com/jsakamoto/Spprologa/workflows/test/badge.svg)](https://github.com/jsakamoto/Spprologa/actions?query=workflow%3Atest) [![License](https://img.shields.io/github/license/jsakamoto/Spprologa)](https://github.com/jsakamoto/Spprologa/blob/main/LICENSE)\n\n## _\"Build client web apps with Prolog.\"_\n\n_**\"Spprologa\"**_ is the open source library to make a \"**S**ingle **P**age **Prolog** **A**pplication\" built on _\"[Blazor](https://blazor.net/) WebAssembly\"_ and _\"[C#Prolog](https://github.com/jsakamoto/CSharpProlog)\"_.\n\n![fig.1](https://raw.githubusercontent.com/jsakamoto/Spprologa/main/.assets/demo-600x450.gif)\n\nPlease visit also the URL below to the live demo site.\n\n- [https://jsakamoto.github.io/Spprologa/](https://jsakamoto.github.io/Spprologa/)\n\n## Hosting model\n\nAll of the Prolog codes are **running inside of the Web browser**, not the server process.  \nThe Prolog codes are interpreted by the interpreter that runs on the Web browser's WebAssembly engine, **not transpiled to JavaScript**.\n\n\"Spprologa\" apps can be hosted on any HTTP servers that can serve static contents at least, such as GitHub Pages, Firebase, Netlify, Azure Static Web, etc.\n\n## Jump start\n\n### Requirements\n\n- .NET SDK v.5.0 or later. (see also: _[\"Download .NET\"](https://dotnet.microsoft.com/download)_)\n- Any OS platforms and versions those are supported by .NET v.5.0 or later, such as Linux distributions, macOS, and Windows.\n\n### Install project template\n\nBefore starting the \"Spprologa\" app programming, I recommend installing the \"Spprologa\" project template by the following command:\n\n```shell\n$ dotnet new -i Spprologa.Templates::0.0.1-preview.4.0.0.0\n```\n\n### Create a new \"Spprologa\" app project , and run it.\n\nOnce the installation of the project template is complete, you can create a new \"Spprologa\" application project in the current folder by the `dotnet new` command.\n\n```shell\n$ dotnet new spprologa\n```\n\nAfter creating a new \"Spprologa\" application project, executing the following command starts building and running the app. And the application's URL will be opened by a default Web browser automatically.\n\n```shell\n$ dotnet watch run\n```\n\n### Publish the project\n\nIf you want to deploy the app to a Web server, execute the `dotnet publish` command like this:\n\n```shell\n$ dotnet publish -c:Release -o path/to/output\n```\n\nAfter executing the command above, all of the contents will be generated that are required to running the app in the `path/to/output/wwwroot` folder.\n\n## Programming \"Spprologa\" application\n\n### `*.razor.prolog` files in the project are consulted automatically.\n\n```prolog\n% /Pages/Foo.razor.prolog\n%   This Prolog code file will be consulted only once\n%   when the \"Foo.razor\" component is first rendering.\n\ninput(name, \"\").\n\nbird(\"swallow\", canfly).\nbird(\"penguin\", canswim).\ncanfly(Name) :- bird(Name, canfly).\n\nclassify(Name, \"can fly\") :- canfly(Name).\nclassify(Name, \"is bird, but can't fly.\") :- bird(Name, _).\nclassify(_, \"isn't bird.\").\n\ncheck :-\n\tinput(name, Name), classify(Name, Message),\n\tretractall(message(_, _)), asserta(message(Name, Message)).\n```\n\n### Bind result of a query to DOM contents.\n\nUse **`@query(\"...\")`** to retrieve a variable value inside a solution of a query which is specified as an argument, and render it as the HTML contents.\n\n```html\n\u003c!-- /Pages/Foo.razor --\u003e\n...\n\u003cspan\u003e\n  \u003c!-- 👇 This code will render \"swallow\". --\u003e\n  @query(\"canfly(Name)\")\n\u003c/span\u003e\n```\n\n### Bind input to a fact.\n\nUse **`@fact(\"...\")`** to two way bind to an `input` element. \n\n```html\n\u003c!-- /Pages/Foo.razor --\u003e\n...\n\u003cinput @bind='@fact(\"input(name, {0})\").as_string' /\u003e\n```\n\nIf the user inputs the text \"gopher\" into the `input` element above, then all `input(name, _)` facts will be retracted, and instead the fact `input(name, \"gopher\")` will be asserted.\n\n### Bind an action to a query.\n\nUse **`@then(\"...\")`** to make the query will be called when an event is fired.\n\n```html\n\u003c!-- /Pages/Foo.razor --\u003e\n...\n\u003cbutton @onclick='@then(\"check\")'\u003eCheck\u003c/button\u003e\n```\n\nIf the user clicks the button above, the query `check` will be called.\n\n### List up facts.\n\nUse the **`\u003cCase\u003e`** component to retrieve all solutions of a query and render values of each solution to HTML contents.\n\n```html\n\u003c!-- /Pages/Foo.razor --\u003e\n...\n\u003cul\u003e\n  \u003cCase Query=\"bird(Name, Ability)\"\u003e\n    \u003cli\u003e@context[\"Name\"] - @context[\"Ability\"]\u003c/li\u003e\n  \u003c/Case\u003e\n\u003cul\u003e\n```\n\nThe above code will render to HTML as follow:\n\n```html\n\u003cul\u003e\n  \u003cli\u003eswallow - canflay\u003c/li\u003e\n  \u003cli\u003epenguin - cannotflay\u003c/li\u003e\n\u003c/ul\u003e\n```\n\n### Aside\n\nCurrently, the \"Spprologa\" is dependent on \"C#Prolog\".  \nBut the \"Spprologa\" is implemented based on pluggable architecture, so it can be replaced by the other Prolog implementation easily.\n\n\n## Important Notice\n\n### This is NOT a stable project. \n\nThis project is a ** \"proof of concept\" ** to create a single page web app using the \"Prolog\" programming language.\n\nThis project has been started by just only my interest that the \"Prolog\" can make a single page web app or not.  \nTherefore, **this project may be abandoned** after I lose interest in it.\n\nHowever, this project is distributed under the Mozilla Public License.\n\nSo anybody can **fork** and can **continue** this project freely anytime, and I will strongly welcome it.\n\n## Release Notes\n\n[Release notes is here.](https://github.com/jsakamoto/Spprologa/blob/main/RELEASE-NOTES.txt)\n\n## License\n\n[Mozilla Public License Version 2.0](https://github.com/jsakamoto/Spprologa/blob/main/LICENSE)\n\n(The source codes of sample site are distributed under [The Unlicense](https://unlicense.org/).)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsakamoto%2Fspprologa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsakamoto%2Fspprologa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsakamoto%2Fspprologa/lists"}