mistydemeo/xenoglossia


Robust(?) string manipulation language

License: Other

Language: Python


Xenoglossia

A programming language specifically designed such that ASTs generated by markov chain are likely to produce programs with meaningful effects

— mcc (@mcclure111) July 11, 2015

Xenoglossia is a simple string manipulation language, akin to sed. It was created with the goal of producing surprising, fun-to-read programs which can be generated in novel manners by a computer.

An introduction to the language and its syntax can be found in the design document, and the documentation of the builtin functions can currently be found in the docstrings of the builtins module.

Installation

You can install this package using Python's pip package manager:

pip install xenoglossia

If you use Mac OS X, you can also install it using Homebrew:

brew install mistydemeo/formulae/xenoglossia

Clone the repository, and then run:

python setup.py install

Usage

Xenoglossia will install an executable named xg. To run a program, call xg --input STRING "xenoglossia program"; for example:

xg --input "This is the input string" "sub 'input' 'output'"

You can also pipe input into stdin:

echo "This is the input string" | xg "sub 'input' 'output'"

Sample programs

Replace two words in a sentence:

gsub "favorite" "favourite" gsub "color" "colour"

Rearrange the words in a sentence, then capitalize the new sentence:

burst " " shuffle capitalize

TODO

  • Add support for user-supplied modules of functions

Known bugs

  • Illegal function identifiers (for example, identifiers beginning with a number) are only flagged for the first function call in a series; otherwise the function call is simply skipped during parsing.

Project Statistics

Sourcerank 5
Repository Size 336 KB
Stars 26
Forks 3
Watchers 3
Open issues 1
Dependencies 0
Contributors 5
Tags 2
Created
Last updated
Last pushed

Top Contributors See all

Misty De Méo danielle Asherah Connor Jessica Stokes Rob Rix

Recent Tags See all

v0.2 September 10, 2015
v0.1 September 10, 2015

Interesting Forks See all

robrix/xenoglossia
Robust(?) string manipulation language
Python - Other - Last pushed - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2017-11-24 19:43:38 UTC

Login to resync this repository