Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.
/ clank Public archive

A simple CLI that runs your C++ code JIT

License

Notifications You must be signed in to change notification settings

ryanccn/clank

Repository files navigation

clank

A simple CLI that runs your C++ code just in time.

Built with Deno.

👾 Installation

$ deno install -Af -n "clank" https://deno.land/x/clank/mod.ts

Alternatively, you can download a binary from the releases page. The upgrade command does work in the standalone binary.

🔥 Usage

# Basic help text:
$ clank

# Run a C++ script:
$ clank hello.cpp

# See juicy debug info:
$ CLANK_DEBUG=1 clank hello.cpp

# Inspect the cache:
$ clank cache list

# Clear the cache:
$ clank cache clean

# Prune the cache (limit it to 0.5 GB):
$ clank cache prune

# Add autocompletion to your shell:
$ source <(clank completions bash)        # bash => ~/.bashrc
$ source (clank completions fish | psub)  # fish => ~/.config/fish/config.fish
$ source <(clank completions zsh)         # zsh  => ~/.zshrc

# Upgrade clank:
$ clank upgrade

🚀 Features

  • Passthrough stdin, stdout and stderr
  • Prints status code and corresponding signal
  • A cache based on unique hashes of files
  • Smart deletion of cached files to keep cache size under 0.5 GB
  • Configure which compiler to use
  • Passing options directly to compilers
  • An incredibly convenient upgrade command
  • Shell autocompletion support
  • Looks great

🚧 Roadmap

  • Config file
  • Smarter deletion algo
  • Options to compiler
  • Configure which compiler to use
  • More tests

🧑‍💻 Development

The Velociraptor script runner is used for productivity.

# Build native binaries
$ vr build

# Install your local version of clank as `clank-dev`
$ vr install-dev

# Run tests
$ vr test