All Projects → alejandrogallo → rooki

alejandrogallo / rooki

Licence: GPL-3.0 License
A stupid simple script runner supporting c, c++, rust, haskell and virtually anything

Programming Languages

shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to rooki

C
Compile and execute C "scripts" in one go!
Stars: ✭ 1,920 (+7284.62%)
Mutual labels:  gcc, clang, tcc
cdetect
🔬 Detect which compiler and compiler version a Linux executable (in the ELF format) was compiled with
Stars: ✭ 23 (-11.54%)
Mutual labels:  gcc, clang, tcc
hmg
💝 My personal Gentoo/Linux configuration backup files
Stars: ✭ 16 (-38.46%)
Mutual labels:  gcc, clang
xcross
"Zero Setup" cross-compilation for C/C++. Supports numerous architectures, build systems, C standard libraries, vcpkg, and Conan.
Stars: ✭ 29 (+11.54%)
Mutual labels:  gcc, clang
C-Cpp-Coverage-for-CLion
Get coverage data in CLion using gcov or llvm-cov
Stars: ✭ 37 (+42.31%)
Mutual labels:  gcc, clang
Fixed point
C++ Binary Fixed-Point Arithmetic
Stars: ✭ 199 (+665.38%)
Mutual labels:  gcc, clang
Cmake Scripts
A selection of useful scripts for use in CMake projects, include code coverage, sanitizers, and dependency graph generation.
Stars: ✭ 202 (+676.92%)
Mutual labels:  gcc, clang
perses
Language-agnostic program reducer.
Stars: ✭ 57 (+119.23%)
Mutual labels:  gcc, clang
Arm Cmake Toolchains
CMake toolchain configurations for ARM
Stars: ✭ 148 (+469.23%)
Mutual labels:  gcc, clang
rebuild
Zero-dependency, reproducible build environments
Stars: ✭ 48 (+84.62%)
Mutual labels:  gcc, clang
c-compiler-security
Security-related flags and options for C compilers
Stars: ✭ 125 (+380.77%)
Mutual labels:  gcc, clang
cpp-compiler-options
Compilation options for different versions of Clang, GCC and MSVC. Provided a generator and different file formats (cmake, xmake, meson, premake5, bjam/b2, ...)
Stars: ✭ 19 (-26.92%)
Mutual labels:  gcc, clang
Polymcu
An open framework for micro-controller software
Stars: ✭ 173 (+565.38%)
Mutual labels:  gcc, clang
Libosmscout
Libosmscout is a C++ library for offline map rendering, routing and location lookup based on OpenStreetMap data
Stars: ✭ 159 (+511.54%)
Mutual labels:  gcc, clang
Sol2
Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
Stars: ✭ 2,791 (+10634.62%)
Mutual labels:  gcc, clang
FrameOfReference
C++ library to pack and unpack vectors of integers having a small range of values using a technique called Frame of Reference
Stars: ✭ 36 (+38.46%)
Mutual labels:  gcc, clang
Vector
➿ A supercharged std::vector implementation (minus Allocator)
Stars: ✭ 118 (+353.85%)
Mutual labels:  gcc, clang
Embedded Ide
IDE for C embedded development centered on bare-metal ARM systems
Stars: ✭ 127 (+388.46%)
Mutual labels:  gcc, clang
minilib
A c standard system library with a focus on size, headeronly, "singlefile", intended for static linking. 187 Bytes for "Hello World"(regular elf), compiled with the standard gcc toolchain.
Stars: ✭ 29 (+11.54%)
Mutual labels:  gcc, clang
ci playground
Playground for Cloud CI development for C++
Stars: ✭ 23 (-11.54%)
Mutual labels:  gcc, clang

rooki

A stupid simple script runner supporting c, c++, rust, haskell and virtually anything

Rooki is written in 20 lines of bash, and has a very flexible functionality.

How does it work?

You just write comments as rooki instructions, the only instruction that you have to define is the rooki:spell, which will be run in the shell. Otherwise you can define any flag you want with the name you want for instance in a c file, the following

// rooki:someflag -I$(pwd)
// rooki:someflag -I$HOME

will define a shell variable someflag with the value

someflag="-I$(pwd) -I$HOME"

which later can be used in the rooki:spell section as

// rooki:someflag -I$(pwd)
// rooki:someflag -I$HOME
// rooki:spell cc $someflag $f -o $bin

There are some general variables already defined:

Variable Explanation Example
bin Path to the created binary rooki:spell gcc $f -o $bin
f Path to the temporary source file that will be compiled // rooki:spell gcc $f -o $bin
src Path to the source file, the caller rooki:include -I$(dirname $src)/include
config_folder Path to rooki config folder

What rooki does when you do rooki yourscript is the following

  • Create a temporal file and save the path in the variable f.
  • Create a bin path out of the md5 hash of the source script, the bin will be stored in $XDG_CONFIG_HOME/rooki/. In the case that your XDG_CONFIG_HOME is not defined, it will be stored in ~/.config/rooki/.
  • Remove the shbang (#!/usr/bin/env rooki) on top of your script (if there is any) and copy the script to $f without the shbang.
  • Read the rooki: flags stored in text in your script.
  • Expand shell constructs within these flags, environment variables and general shell commands within.
  • Run the rooki:spell construct, which should be creating a binary in the path $bin.

Quick start

For instance to write a c++ script called hello.cxx just create an executable file hello.cxx and write

#!/usr/bin/env rooki
// rooki:flags -pedantic -std=c++11
// rooki:flags -x c++
// rooki:include -I/usr/include
// rooki:include -I$HOME/.local/include
// rooki:spell g++ $flags $include $f -o $bin

#include <iostream>

int main(int argc, char *argv[])
{
  std::cout << "Hello world" << std::endl;
  return 0;
}

then do

./test.cxx
# or
rooki test.cxx

if you want to see exactly what rooki is doing then set the environment variable ROOKI_DEBUG like this

ROOKI_DEBUG=1 ./test.cxx
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].