Rand Stats

App::Crag

zef:librasteve

raku App::Crag

Calculator using RAku Grammars for the command line

THIS APPLICATION IS PROVDED "AS IS" WITHOUT WARRANTY OR LIABILITY.

THIS APPLICATION IS NOT INTENDED FOR USE IN MISSION CRITICAL APPLICATIONS

Install (Linux)

> curl https://rakubrew.org/install-on-perl.sh | sh
> rakubrew download
> rakubrew switch
> raku -v    #check your raku version
> zef install App::Crag --/test

See https://raku.org/install for other Raku installation options

Usage

Use the crag command:

crag [--help] <cmd>

Use the crag REPL:

crag

use 'exit' to exit the REPL

For LLM::DWIM features, you will need e.g. a Gemini App Key

Examples

Usage:
    crag [--help] <cmd>
    -or-
    crag -> REPL
Examples:
    [1] (1.6km / (60 * 60 * 1s)).in: <mph>       #0.99mph
    [2] $m=95kg; $a=^<9.81 m/s^2>; $m*$a         #931.95N
    [3] ^<12.5 ft ±3%> .in: <mm>                 #3810mm ±114.3
    [4] $λ=2.5nm; $ν=c/$λ; $ν.norm               #119.91PHz
    [5] $c=^<37 °C>; $f=^<98.6 °F>; $f cmp $c    #Same
    [6] @physics-constants-symbols.join: "\n"    # ...
    [7] ?^<TNT energy in J/kg>                   #4184000J/kg
    [8] US$42 .in: <£>                           #31.41GBP
More info:
    - https://github.com/librasteve/raku-Physics-Measure.git
    - https://github.com/librasteve/raku-Physics-Unit.git
    - https://github.com/librasteve/raku-Physics-Error.git
    - https://github.com/librasteve/raku-Physics-Constants.git
    - https://github.com/raku-community-modules/Slang-Roman
    - https://github.com/bduggan/raku-llm-dwim
    - https://github.com/antononcube/Raku-Math-NumberTheory
    - https://github.com/raku-community-modules/Color
    - https://github.com/holli-holzer/perl6-Color-Names
- crag goes '^<value units [±error]>' => 'Physics::Measure.new: :$value, :$units :$error' )
- crag goes sub r( $x = 0.01 ) { $Physics::Measure::round-val = $x }
- crag goes ```subst( '§|(.+?)|' => 'Q|$0|.AST.EVAL' )```
- crag goes ```subst( 'c<(.+?)>' => 'Color.new(:rgb(COLORS<$0><rgb>))' )```
- crag goes '?<something>' => dwim )
- crag goes '?^<something in units>' => dwim => 'Physics::Measure.new: value => dwim, :$units' )
- echo RAKULANG='en_US' for us gallons, pints, mpg, etc.
- zef install Physics::Units --force-install to refresh currency rates

More Info

copyright(c) 2023-2026 Henley Cloud Consulting Ltd.