What it is
hop is a component-based template language that compiles to Rust. The generated code is optimized, type-safe and has no runtime dependencies.
hop is designed for building fast server-side rendered websites but can be used in any application where the target language is HTML.
When using hop, you declare your front-end code in .hop files, run the hop compiler and get .rs files out.
Installing the compiler
Install via GitHub
You can find the latest release at github.com/hoplang/hop/releases/latest.
Install via bash
bash
curl -fsSL https://hoplang.com/install.sh | bashInstall via Nix
hop is packaged as a flake. To run it without installing:
bash
nix run github:hoplang/hop/v0.2.0 -- --helpTo install it into your profile:
bash
nix profile install github:hoplang/hop/v0.2.0Or add it to your own flake and pull the compiler into a dev shell:
nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
hop.url = "github:hoplang/hop/v0.2.0";
};
outputs = { nixpkgs, flake-utils, hop, ... }:
flake-utils.lib.eachDefaultSystem (system: {
devShells.default = nixpkgs.legacyPackages.${system}.mkShell {
packages = [ hop.packages.${system}.default ];
};
});
}