{"id":13787718,"url":"https://github.com/Beluga-lang/Beluga","last_synced_at":"2025-05-12T01:31:37.003Z","repository":{"id":32042754,"uuid":"35614265","full_name":"Beluga-lang/Beluga","owner":"Beluga-lang","description":"Contextual types meet mechanized metatheory!","archived":false,"fork":false,"pushed_at":"2024-07-29T11:51:58.000Z","size":19115,"stargazers_count":184,"open_issues_count":65,"forks_count":16,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-18T01:39:12.529Z","etag":null,"topics":["beluga","dependent-types","hoas","lf","ocaml"],"latest_commit_sha":null,"homepage":"http://complogic.cs.mcgill.ca/beluga/","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Beluga-lang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-14T14:00:29.000Z","updated_at":"2024-08-28T19:34:29.000Z","dependencies_parsed_at":"2023-11-07T02:16:24.016Z","dependency_job_id":"d28308cf-0c91-47db-b0de-17c12e08a032","html_url":"https://github.com/Beluga-lang/Beluga","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beluga-lang%2FBeluga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beluga-lang%2FBeluga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beluga-lang%2FBeluga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beluga-lang%2FBeluga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Beluga-lang","download_url":"https://codeload.github.com/Beluga-lang/Beluga/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253659372,"owners_count":21943627,"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":["beluga","dependent-types","hoas","lf","ocaml"],"created_at":"2024-08-03T21:00:28.415Z","updated_at":"2025-05-12T01:31:36.123Z","avatar_url":"https://github.com/Beluga-lang.png","language":"OCaml","funding_links":[],"categories":["OCaml","Functional"],"sub_categories":[],"readme":"# [Beluga](http://complogic.cs.mcgill.ca/beluga/ \"Beluga home page\")  [![Build \u0026 Test](https://github.com/Beluga-lang/Beluga/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/Beluga-lang/Beluga/actions/workflows/build-and-test.yml)\n\n[Beluga](http://complogic.cs.mcgill.ca/beluga/ \"Beluga home page\") is a functional programming language designed for reasoning about formal systems.\nIt features direct support for object-level binding constructs using higher order abstract syntax and treats contexts as first class objects.\n\n## Getting started\n\n### Prerequisites\n\nInstall the OCaml package manager ([opam](http://opam.ocaml.org/)) by following the instructions at \u003chttp://opam.ocaml.org/doc/Install.html\u003e.\n\nOptionally, [`rlwrap`](https://github.com/hanslub42/rlwrap) may be installed to greatly improve the Beluga interactive mode user experience.\n\n### Installation from the opam repository\n\nStable releases of Beluga are published on the opam repository, but they may not have the most recent features and bugfixes.\n\nBeluga may be installed in the current opam switch using:\n\n```bash\n# Install `beluga` and `harpoon` in `$OPAM_SWITCH_PREFIX/bin`\nopam install beluga\n\n# Add `$OPAM_SWITCH_PREFIX/bin` to the `PATH` environment variable in the current shell\neval $(opam env)\n```\n\nAlternatively, to avoid dependency conflicts, an opam switch may be created specifically for Beluga using:\n\n```bash\nmkdir Beluga\ncd Beluga\nopam switch create . --empty\nopam install beluga\neval $(opam env)\n```\n\nYou can now run Beluga programs using the `beluga` or `harpoon` executables:\n\n```bash\nbeluga path/to/program.bel\nharpoon --sig path/to/program.bel\n```\n\nUse `opam remove beluga` to uninstall the executables.\n\n### Installation from the source\n\nThe latest version of Beluga may be built and installed as follows, without the test dependencies.\nWith this configuration, the unit and integration tests cannot be run with `make test`.\n\nTo build Beluga from the source code and install it in its own opam switch:\n\n```bash\ngit clone https://github.com/Beluga-lang/Beluga.git Beluga\ncd Beluga\nmake setup-install\nmake install\n```\n\nYou can now run Beluga programs using the `beluga` or `harpoon` executables from the newly created opam switch environment in the `Beluga` directory.\nMake sure your shell has the correct opam switch environment variables using `eval $(opam env --switch=. --set-switch)` in the `Beluga` directory.\n\n```bash\nbeluga path/to/program.bel\nharpoon --sig path/to/program.bel\n```\n\nUse `make uninstall` to uninstall the executables.\n\n### Development\n\nThe latest version of Beluga may be built and installed as follows, with the test dependencies.\nWith this configuration, the unit and integration tests can be run with `make test`.\nIf you already have an opam switch for Beluga without the test dependencies installed as above, then you can install them with `opam install ./beluga.opam --locked --deps-only --with-test --with-doc`.\nAlternatively, you can remove the existing opam switch with `opam switch remove .`.\n\nTo start working on Beluga, clone the repository and run the `make setup-development` command to create an opam switch for Beluga with the necessary dependencies:\n\n```bash\ngit clone https://github.com/Beluga-lang/Beluga.git Beluga\ncd Beluga\nmake setup-development\neval $(opam env)\n```\n\nUse `make` to compile the production version of Beluga, `make test` to compile and run the tests, and `make clean` to clean the directory of compilation results.\nUse `./LINT` to find code style errors.\n\nTo build and use any of the compiled executables as if they were installed from opam, use `dune exec [executable]`.\nFor instance, you can build and run the development version of `beluga` with:\n\n```bash\ndune exec beluga path/to/program.bel\n```\n\nLikewise, you can build and run the development version of `harpoon` with:\n\n```bash\ndune exec harpoon -- --sig path/to/program.bel\n```\n\nSee the [`Makefile`](./Makefile) for other available development commands.\n\n## Interactive Mode\n\nFor interactive proofs, we recommend using [Harpoon](https://beluga-lang.readthedocs.io/en/latest/harpoon/index.html).\nA detailed list of commands and tactics is available [here](https://beluga-lang.readthedocs.io/en/latest/harpoon/interactive-reference.html).\n\n## Beluga-mode for GNU Emacs\n\nBeluga includes a major mode for programming in Emacs.\nThe elisp file is located in the [tools](./tools) directory.\nTo configure Beluga-mode:\n\n1. Update your `~/.emacs` or `~/.emacs.d/init.el` file with the lines written below.\n   XEmacs users must update `~/.emacs` or `~/.xemacs/init.el` with the same text.\n   Create any of these files if they do not exist already.\n   * You should replace `path/to/beluga` with the actual path of the Beluga directory.\n     ```\n     (add-to-list 'load-path \"path/to/beluga/tools/\")\n     (load \"beluga-mode.el\")\n     ```\n   * NOTE: Feel free to move the beluga-mode.el file to another directory so long as you add its location to the Emacs load-path.\n\n2. Restart Emacs.\n   Emacs will now launch in Beluga-mode automatically when you open a Beluga program.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBeluga-lang%2FBeluga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBeluga-lang%2FBeluga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBeluga-lang%2FBeluga/lists"}