The Cutlet Utility Language

Inspired by Tcl, Cutlet is designed to be a small and simple utility language to be used by other programs and projects. Where Tcl started as a basic Tool Command Language and has, over the years, become a general programming language. Cutlet is designed to be that original utility language and only as a utility language.

Current Version: Development Git Repository: https://github.com/digitalcombine/cutlet

Sand-boxing

The entire global environment can be removed, replaced, redefined or overridden by the use of sandboxes. This effectively makes Cutlet a general parser in which to implement the task that is needed from it.

Simple Syntax

  1. It’s line oriented, one line one command.

    This is command one
    This is command two
    
  2. Each part of the command is separated by spaces.

    This command has 5 words
    function arg1 arg2 arg3
    
  3. Variables.

    A word starting with the $ character gets replaced with a variable’s value.

    global customer_name = "John Smith"
    print $customer_name
    
    local counter = 10
    print We have $counter items.
    
  4. Command substitutions.

    Square brackets, [], gets replaced with the return value from the command in them.

    local mylist = [list value1 value2 value3]
    print [$mylist join .]
      -> value1.value2.value3
    
  5. Strings and substitutions.

    Strings are denoted with the quoting characters "" and ''. Variable and command substitution can be preformed in strings.

    "Hello $client, your order [get_order $client] is ready\n"
    'Hello $client, your order [get_order $client] is ready\n'
    
  6. Blocks.

    Blocks are denoted with curly brackets, {}. They can be used as literal strings and the only part of the language that can span multiple lines.

    print {Hello World}
    
    def my_command {
      command one
      command two
    }
    
  7. Commenting the code.

    Lines starting with the # character are comment lines and are ignored by Cutlet.

    # This is a comment.
    print Hello # This is not a comment
    

Simple Implementation

Cutlet as a language doesn’t define any language constructs with the exception of variables, command and string substitutions. Things like looping, conditional branching, object orientation, procedures and functions and so on, are defined by libraries or by the encapsulating program. Even setting variable values is not defined by Cutlet and is implementation specific.