Skip to content

New Version of prosaic

June 9, 2014

prosaic has evolved from unmaintainable piles of Perl and then Javascript to the pristine world of symbolic evaluation with a rewrite in a relatively young lisp-like language called Hy. Along with a cleaner and saner codebase, prosaic has a short explanatory readme, its first documentation to ever exist.

One can check out the new release on Github. If you’re more interested in poetry, here’s a series created using the previous version of prosaic based on thirty one cyberpunk novels.

Hy compiles to Python, making prosaic importable and programmatically callable from either Hy or Python. It also supports a simple command line interface:

    hy __init__.hy load some_text0.txt some_mongo_db_name
    hy __init__.hy load some_text1.txt some_mongo_db_name
    hy __init__.hy load some_text2.txt some_mongo_db_name

    hy __init__.hy create templates/haiku.json some_mongo_db_name

The above example adds three text files (presumably containing prose or poetry in English) to a MongoDB database and then asks prosaic to generate a poem using the haiku template, which looks like this:


Templates support the following keys:

  • syllables: number of desired syllables for the given line
  • keyword: line that matches string keyword
  • fuzzy: line that occurs near a line with string keyword
  • rhyme: letter indicating line’s place within a rhyme scheme.

A naive sonnet might look like this:

[{"rhyme": "A", "keyword":"vamplate"},
 {"rhyme": "B", "keyword":"stiletto"},
 {"rhyme": "A"},
 {"rhyme": "B", "fuzzy": "steed"},
 {"rhyme": "C", "fuzzy": "steed"},
 {"rhyme": "D"},
 {"rhyme": "C"},
 {"rhyme": "D", "keyword": "buckler"},
 {"rhyme": "E", "fuzzy": "buckler"},
 {"rhyme": "F"},
 {"rhyme": "E"},
 {"rhyme": "F"},
 {"rhyme": "G", "syllables": 10, "keyword": "giant"},
 {"rhyme": "G", "syllables": 10, "keyword": "dragon"}]

Keys can be mixed and matched ad nauseum for a given line.

The goal of this rewrite was to be able to run prosaic using threads to improve performance and to allow prosaic to be embedded within other, potentially web based, applications.

Ultimately, prosaic is still a hacked-up art project with a user base countable on one set of fingers. Don’t expect much in the way of support or usability, but do feel free to open issues on Github or send me an email if you have questions about it.

As always with open source software, patches are welcome.


my personal blog has more poetry (non-cyberpunk cut-up and fully human poetry). i say inane things at @nate_smith.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: