Cipherlang
Cipherlang is a scripting language for applying transforms to text.
Update
I am currently rewriting cipherlang in rust. The rust version has recently (as of 2024-10-25) surpassed the original in terms of
added features. I haven't yet uploaded the repository, but that version will be the primary implementation going forward.
Usage
- cipherlang [-iinfile] [-ooutfile] -fmethodfile [-a(comma-delimited argument list)]
Uses a local cipherlang script to transform. Arguments are required for some transforms. If -i is omitted, input is read from stdin, likewise with -o and stdout.
- cipherlang -h
Displays usage information
- cipherlang -d -fmethodfile
Compiles method, adds method file to dictionary.
Language
The cipherlang language is fairly simple. There exist five types of statements: var,
const, write, load, apply.
- var identifier
- const identifier value
- write source to destination
- load destination to source
- apply transform<argument list> to variable
Additionally, there exist operations: an operation phrase replaces a source in a write or load statement.
The syntax of an operation phrase is: variable $operation_name variable2. Operations can
be nested to an arbitrary depth.
Dictionary
Compiled method files can be stored in a global directory, located by default at ~/.ciplang/methods/
Compilation
Before interpretation, cipherlang scripts are compiled to a bytecode format, known as a method.
This method can either be stored in the dictionary or immediately interpreted. A copy of the method is cached locally for future use.
More Details
The repository can be found here
The formal specification can be found here, once it is finalized.
Cipherlang was created by xavenna. It isn't complete yet, but a functional subset of the
language has been implemented