All Projects β†’ Beluga-lang β†’ Beluga

Beluga-lang / Beluga

Licence: GPL-3.0 license
Contextual types meet mechanized metatheory!

Programming Languages

ocaml
1615 projects
TeX
3793 projects
emacs lisp
2029 projects
shell
77523 projects
ruby
36898 projects - #4 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Beluga

dotfiles
πŸ”§ My dotfiles on ο£Ώ macOS for Neovim, Zsh, kitty, lf, etc
Stars: ✭ 90 (-43.4%)
Mutual labels:  lf
ocaml-bindlib
Efficient binder representation in OCaml
Stars: ✭ 39 (-75.47%)
Mutual labels:  hoas
dotfiles
rice repo
Stars: ✭ 71 (-55.35%)
Mutual labels:  lf
fm-nvim
πŸ—‚ Neovim plugin that lets you use your favorite terminal file managers (and fuzzy finders) from within Neovim.
Stars: ✭ 114 (-28.3%)
Mutual labels:  lf
lfimg
Image preview support for lf (list files) using Überzug
Stars: ✭ 174 (+9.43%)
Mutual labels:  lf

Beluga Build & Test

Beluga is a functional programming language designed for reasoning about formal systems. It features direct support for object-level binding constructs using higher order abstract syntax and treats contexts as first class objects.

Getting started

Prerequisites

Install the OCaml package manager (opam) by following the instructions at http://opam.ocaml.org/doc/Install.html.

Optionally, rlwrap may be installed to greatly improve the Beluga interactive mode user experience.

Installation from the opam repository

Beluga may be installed in the current opam switch using:

opam install beluga
eval $(opam env)

Alternatively, an opam switch may be created specifically for Beluga using:

mkdir Beluga
cd Beluga
opam switch create . --empty
opam install beluga
eval $(opam env)

You can now run Beluga programs using the beluga executable:

beluga path/to/program.bel

Installation from the source

To build Beluga from the source code and install it in its own opam switch:

git clone https://github.com/Beluga-lang/Beluga.git Beluga
cd Beluga
opam switch create . --empty
opam install .

The beluga executable is then accessible from the newly created opam switch.

Development

To start working on Beluga, clone the repository and create an opam switch with the dependencies installed:

git clone https://github.com/Beluga-lang/Beluga.git Beluga
cd Beluga
opam switch create . --deps-only --with-test --yes
eval $(opam env)

Use make to compile, make test to compile and run the tests, and make clean to clean the directory of compilation results. Use ./LINT to find code style errors.

To use any of the compiled executables as if they were installed from opam, use dune exec [executable]. For instance, you can run Beluga programs using the compiled development version of beluga with:

dune exec beluga path/to/program.bel

You can run a Harpoon session using the compiled development version of harpoon with:

dune exec harpoon -- --sig path/to/program.bel

See the Makefile for other available development commands.

Interactive Mode

For interactive proofs, we recommend using Harpoon. A detailed list of commands and tactics is available here.

Beluga-mode for GNU Emacs

Beluga includes a major mode for programming in Emacs. The elisp file is located in the tools directory. To configure Beluga-mode:

  1. Update your ~/.emacs or ~/.emacs.d/init.el file with the lines written below. XEmacs users must update ~/.emacs or ~/.xemacs/init.el with the same text. Create any of these files if they do not exist already.

    • You should replace path/to/beluga with the actual path of the Beluga directory.
      (add-to-list 'load-path "path/to/beluga/tools/")
      (load "beluga-mode.el")
      
    • 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.
  2. Restart Emacs. Emacs will now launch in Beluga-mode automatically when you open a Beluga program.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].