Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An experimental pipe-oriented programming language

branch: master
README.md

Plumbum

An experimental, pipe-oriented programming language, designed to fill the gap between classic Unix shell one-liners and powerful general-purpose programming languages.

Dependencies

  • Python 2.x (probably 2.6+, though I haven't tested earlier versions)
  • PyParsing (pip install pyparsing or equivalent)
  • Some modern Linux or Mac OS X

Usage

Start up a REPL
./pb.py
Eval one line
./pb.py -e '["hello","world"] | join " " | print'
Run a program
./pb.py foo.pb

Code Examples

Some 'real' code examples:

# should be self-explanatory
["hello, world!"] | print

# list literals
[2,4,1,4,2] | uniq

# lazy range literals (ala Haskell)
[4..] | zip [10,9..1] | flatten

# slurping a file, perl-ish regexen
<foo.txt> | grep /bar/ | print

# inline (lazy!) shell commands
`yes` | strip | take 10 | join "," | print

# name a pipeline, use it later
foo = uniq | sort
# slurp from standard in
<> | foo | print

For more examples, see the cases in run_tests.py or the old_test.pb file. This presentation is slightly out of date, but it should be mostly accurate in describing the language.

Something went wrong with that request. Please try again.