NaPoGenMo / NaPoGenMo2015

National Poetry Generation Month 2015
14 stars 3 forks source link

0x04 is the cruelest month #9

Open cpressey opened 9 years ago

cpressey commented 9 years ago

Full disclosure: I already tweeted this bash one-liner which generates 30 single-stanza poems. Or 1 poem with 30 stanzas. Or something. A sample output of it runnning on my Ubuntu installation can be found in this gist, the first stanza/poem/whatever I shall quote here, because I quite like it:

unwilling wormhole's empowers righteous whim's shyer Young birthdays Heidi's flibbertigibbets credentials chorussed travel piloting now's Hull reappointed breads overspecializing untruth clearance's Cardenas warmhearted campiest uprisings

I don't think I am quite done, however, although what else I quite plan to do I have not quite decided. Quite.

cpressey commented 9 years ago

Fizzy Drinks

i had; was a on the of the in the; upon the of his, in his i could he had! with a, began to! and i i was and the the squire he was. by the said the the captain out of the doctor as i! had been it was! there was with the in a! was the and a. at the of a like a! from the, to be for the to the and then into the; that i.

(Generated with https://gist.github.com/cpressey/c590e0a0e5b61f4b3e7c using Robert Louis Stevenson's "Treasure Island" from Project Gutenberg as the input text.)

cpressey commented 9 years ago

Expensive Shoes

BUT HENCE ----- you'll need ++++ you'll say ----- ---- SO HENCE they'll have +++++ --- + --- i'll have + AND THEN +++ ++++ ----- ++ ----

  • BUT NOW AND NOW ++ - -- ++ ---- SO NOW -- +++ +++++ they'll say you'll have -- i'll say + ++++ --- AND HENCE they'll need +++++ BUT THEN SO THEN +++ - i'll need
cpressey commented 9 years ago

Disk Full

$ for A in {1..3}; do echo; grep 'ion$' < /usr/share/dict/words | awk '{ print "forget", $1 }' | shuf | head -n 10; done

forget ruination
forget exploration
forget Hellenization
forget aversion
forget interdiction
forget erudition
forget distortion
forget operation
forget intermission
forget session

forget particularization
forget chlorination
forget masturbation
forget fulmination
forget classification
forget reunification
forget malfunction
forget implantation
forget generation
forget percussion

forget vulcanization
forget alteration
forget defamation
forget recreation
forget consumption
forget instigation
forget determination
forget reconsideration
forget devotion
forget overpopulation
cpressey commented 9 years ago

(((This doesn't "count" for NaPoGenMo 2015, because it was written in 2014, but in the interest of generated "poetry", I just now put this online. I was considering submitting it during NaNoGenMo 2014, but the thought of running it for 50K words seemed excessive. Its output did get published elsewhere, however -- but without source code.)))

cpressey commented 9 years ago

A Beatnik quine is something I'm going to shoot for. Achieve, maybe not, but shoot for, definitely.

I wrote a simple quine in Python while on the tube. It's not very "Pythonic", but then, it's not supposed to be. It's supposed to be "I haven't written a quine in years, I wonder if I remember how to do this, also, let's be pedantic about it to make it easier to see what's going on and/or translate into other languages."

Beatnik presents its own challenges. Not least of which is the fact that the one implementation I found does not correctly run the one example program I found. This is not an uncommon occurrence in esolang circles; I consider myself lucky just to have found them, as often these things just disappear when their author's website goes poof.

cpressey commented 9 years ago

Hello, world!

Soars, larkspurs, rains.
Indistinctness.
Mario snarl (nurses, natures, rules...) sensuously retries goal.
Agribusinesses' costs par lain ropes (mopes) autos' cores.
Tuner ambitiousness.
Flit.
Dour entombment.
Legals' saner kinking lapse.
Nests glint.
Dread, tied futures, dourer usual tumor grunts alter atonal
  garb tries shouldered coins.
Taste a vast lustiness.
Stile stuns gad subgroup gram lanes.
Draftee insurer road: cuckold blunt, strut sunnier.
Rely enure pantheism: arty gain groups (genies, pan) titters, tattles, nears.
Bluffer tapes?  Idle diatom stooge!
Feted antes anklets ague?  Remit goiter gout!
Doubtless teared toed alohas will dull gangs' aerials' tails' sluices;
Gusset ends!  Gawkier halo!

Enter abstruse rested loser beer guy louts.
Curtain roams lasso weir lupus stunt.
Truant bears animate talon.  Entire torte originally timer.
Redo stilt gobs.

Utter centaurs;
Urgent stars;
Usurers (dilute);
Noses;
Bones;
Brig sonar graders;
Utensil silts;
Lazies.
Fret arson veterinary rows.

Atlas grunted: "Pates, slues, sulfuric manor liaising tines,
  trailers, rep... unfair!  Instant snots!"

Sled rested until eatery fail.
Ergs fortitude
  Indent spotter
Euros enter egg.
Curious tenures.
Torus cutlasses.
Sarong torso earns cruel lags it reeled.

Engineer: "Erase handbag -- unite ratification!"

oaring oaten donkeys unsold, surer rapid saltest tags
BUTTERED TIBIA LUGS REWIRING TOILETS
anion festers raring edit epilogues.
DIRGE ROTOR.
linnet oaring.
GORE BOOTIES.
Ironed goon lists tallest sublets --
Riots,
Raucous onset.

Ignobly, runners' diet anguishes sunrise loner.
Erode mob, slier switcher!
Loaners stilt drudge pearl atoll, risking hats' ends.

Rebind sitters.

Toga epistles -- crud lard.  (Pager purse dons souls.)

glob title a curio hired rites shed suds lade grease strut arctic revs toad
unless idlers rind stilt region land GERMICIDES SULTANA GUTS gill siting leans
nice spurs
tests gloves
roused asp

Holes!  Moles!  (Sores!)
Hygienists!  Scars!  (Asses!)
Smells spell rares.

Cubs instant sing in parse goodies.
Rosin.  Unhelpful sisal acres.  Slope told.
MALENESS PASTA LAB.  "Infirmary vine," rang illiterates (beans).
Rosin sours, insults truss abalones, nailed rules, helical atlases.
Dear remodeling stings mar rents.
Sunless shiner orb (silly idol.)
Clarity disses senna.
Vagabonds sauted; sloes performed gelds.
Alter post radial lip sectioning gums.
Saint Towellings.
Larger aeons telephone stolid char, pal!
Boats Dean forsook, rosters, tunas, terrariums -- united, traced.
Nude pagoda careens.

(This is the source code. It's a Beatnik program that outputs the rather trite two-word poem "Hello, world!". Certain other programs were used to construct this program; they will be published shortly.)

eseyffarth commented 9 years ago

This is lovely!

cpressey commented 9 years ago

Why thank you!

I really should have said "certain other programs were used in the construction of this program" -- there was a certain amount of manual editing involved. All of the punctuation and formatting was hand-added, and some (maybe 3%?) of the commands were "adjusted" to improve the flow at the more awkward points.

The ultimate goal of making a quine in this will be... very, very difficult.

cpressey commented 9 years ago

Tools used to produce and run the above Beatnik program now available in this repository (public domain). The program also runs on Catatonic Porpoise's Beatnik interpreter.

cpressey commented 9 years ago

As a matter of devblogging...

You can see that Python quine I wrote devolve as it is successively refactored into a form suitable for a cruder programming language here.

However, I am now 98% certain that it is not possible to write a quine in Beatnik. It's simply too weak a language. A quine requires that you do something like this:

s = "print 's = ' + quoted(s) + ';' + newline(); print s;";
print 's = ' + quoted(s) + ';' + newline(); print s;

The second line requires that you access s twice. Beatnik has only a single stack, and each element on the stack is only one byte. You access data from the stack by popping it off the top. You can make a copy of the data on the top, but you can only place that copy... well, back on the top. You can swap the top two elements, but you can't "reach" any deeper into the stack than that.

So I don't see any way to store a string in Beatnik such that you could access the whole string without destroying it. Which you would need to do, to access it twice.

So, back to the drawing board.

MichaelPaulukonis commented 9 years ago

Is Beatnik not Turing-complete?

Doesn't mean that it is humanly-doable, though.

enkiv2 commented 9 years ago

https://esolangs.org/wiki/Beatnik#Computational_class

Since there is only a single stack for data items, and since data items are finite (integers from 0 to 255), and since it is not possible to access values from arbitrarily deep in the stack, Beatnik is not Turing-complete https://esolangs.org/wiki/Turing-complete, but it ought to be able to simulate any deterministic Push-down automaton https://esolangs.org/wiki/Push-down_automaton.

I wonder, though, if a quine is still possible, if you essentially limit it to operations 5, 9, 12, and 15 and don't bother using dictionary words (thus producing the appropriate scores in shorter words).

On Mon, Apr 13, 2015 at 3:09 PM Michael Paulukonis notifications@github.com wrote:

Is Beatnik not Turing-complete?

Doesn't mean that it is humanly-doable, though.

— Reply to this email directly or view it on GitHub https://github.com/NaPoGenMo/NaPoGenMo2015/issues/9#issuecomment-92465124 .

enkiv2 commented 9 years ago

For instance, 'xy' is scored as 12; fe as 5; xyp as 15; xe as 9.

On Mon, Apr 13, 2015 at 3:27 PM John Ohno john.ohno@gmail.com wrote:

https://esolangs.org/wiki/Beatnik#Computational_class

Since there is only a single stack for data items, and since data items are finite (integers from 0 to 255), and since it is not possible to access values from arbitrarily deep in the stack, Beatnik is not Turing-complete https://esolangs.org/wiki/Turing-complete, but it ought to be able to simulate any deterministic Push-down automaton https://esolangs.org/wiki/Push-down_automaton.

I wonder, though, if a quine is still possible, if you essentially limit it to operations 5, 9, 12, and 15 and don't bother using dictionary words (thus producing the appropriate scores in shorter words).

On Mon, Apr 13, 2015 at 3:09 PM Michael Paulukonis < notifications@github.com> wrote:

Is Beatnik not Turing-complete?

Doesn't mean that it is humanly-doable, though.

— Reply to this email directly or view it on GitHub https://github.com/NaPoGenMo/NaPoGenMo2015/issues/9#issuecomment-92465124 .

cpressey commented 9 years ago

https://esolangs.org/wiki/Beatnik#Computational_class

Indeed, I wrote that just a few days ago, after I determined it wasn't Turing-complete. For all I know, this has been well-known amongst Beatnik enthusiasts for years, and it's just that no-one bothered to note it on the wiki page.

A language doesn't have to be Turing-complete in order to have a quine -- there's some real research on this somewhere which I can dig up for anyone who is interested, but it's a bit dry and mathematical.

On the other hand, if a language is Turing-complete, it definitely has a quine (barring some pathological technicalities that are, again, kind of dry and mathematical and uninteresting, at least to me, at least at this moment.)

I won't claim that I have a watertight proof that Beatnik doesn't have a quine, but I think my analysis of the data-storage situation in my previous comment is enough to dissuade me from continuing to look for one...

...especially here in NaPoGenMo, where there are countless other vistas to explore.

I'm thinking of playing with SVG a bit, because I don't know as much about it as I'd like to, and I've always has a great fondness for concrete poetry.

enkiv2 commented 9 years ago

While it might not be possible to use beatnik to produce a quine, I imagine one could produce all sorts of other varieties of functional poetry (like a beatnik program to print a beatnik program to calculate the golden ratio to twenty decimal places, or something).

On Tue, Apr 14, 2015 at 3:18 AM Chris Pressey notifications@github.com wrote:

https://esolangs.org/wiki/Beatnik#Computational_class

Indeed, I wrote that just a few days ago, after I determined it wasn't Turing-complete. For all I know, this has been well-known amongst Beatnik enthusiasts for years, and it's just that no-one bothered to note it on the wiki page.

A language doesn't have to be Turing-complete in order to have a quine -- there's some real research on this somewhere which I can dig up for anyone who is interested, but it's a bit dry and mathematical.

On the other hand, if a language is Turing-complete, it definitely has a quine (barring some pathological technicalities that are, again, kind of dry and mathematical and uninteresting, at least to me, at least at this moment.)

I won't claim that I have a watertight proof that Beatnik doesn't have a quine, but I think my analysis of the data-storage situation in my previous comment is enough to dissuade me from continuing to look for one...

...especially here in NaPoGenMo, where there are countless other vistas to explore.

I'm thinking of playing with SVG a bit, because I don't know as much about it as I'd like to, and I've always has a great fondness for concrete poetry.

— Reply to this email directly or view it on GitHub https://github.com/NaPoGenMo/NaPoGenMo2015/issues/9#issuecomment-92671819 .

cpressey commented 9 years ago

I think the next logical step for Beatnik is "99 Bottles of Beer", which I've sketched, but I don't really feel like carrying through with (computing those jump offsets... not really difficult, but ugh. Maybe someday.)

Instead, I played with SVG. Threw together this thing which lets you type in lines of text, and constructs a concrete poem out of them. It's pretty lame actually -- er, to be more positive, there's lots of places it could be improved. Well, y'have to start somewhere. It's self-contained and short and public domain, so feel free to cannibalize it for whatever purposes.

If you want to save the generated SVG, you need to use SVG Crowbar -- there might be a simpler solution, but if so I haven't found it. Note that SVG Crowbar, in spite of describing itself as "Chrome-specific", does in fact work in Firefox (for simple SVGs like this), and in fact I have only tested this thing on Firefox so far.

eseyffarth commented 9 years ago

wow such amaze so SVG

cpressey commented 9 years ago

Heh, if I didn't have this weird obsession with reinventing the wheel, I'd probably just use d3 and not worry about constructing SVGs "by hand" like this.

One attractive thing would be to make the dimensions of the SVG be actually A4 (or 8.5"x11" for all y'all in North America) so that when the SVG is printed out on paper, it's true to scale.

But speaking of reinventing the wheel, I got distracted again! Because I played with @MichaelPaulukonis's code and it reminded me about the crazy thoughts I had about text pipelines earlier this year (the rants about which you can read in early messages on the generativetext forum if you have too much time on your hands) and I decided to ignore my own observation that generative art and software engineering don't really mix and and and

this.

The main idea (if there was one) was to write it in Javascript in a way where it could be run under node or in a web browser. It's not quite there, but it shows promise.

Really though, it's just an excuse to indulge in that quasi-algebraic thrill of writing a framework... which inevitably solves some problems well while making other problems even harder.

MichaelPaulukonis commented 9 years ago

There are also SVG to canvas libs, and from there you can go to a jpeg png gif or whathaveyou.

Also, you can now redirect the input so it's not coming from a text=box, but a command-line driven pipelined firehouse -- spray your text into it, and output a png. wheeee!

-Michael Paulukonis http://www.xradiograph.com http://goog_2112721603Interference Patterns (a blog) http://www.xradiograph.com/interference @XraysMonaLisa https://twitter.com/XraysMonaLisa http://michaelpaulukonis.com

Sent from somewhere in the Cloud (hearthrug, by the fender)

On Tue, Apr 21, 2015 at 5:25 AM, Chris Pressey notifications@github.com wrote:

I think the next logical step for Beatnik is "99 Bottle of Beer", which I've sketched, but I don't really feel like carrying through with (computing those jump offsets... not really difficult, but ugh. Maybe someday.)

Instead, I played with SVG. Threw together this thing https://cdn.rawgit.com/catseye/Dipple/a46b25e0e09fda0c240970cb060c0d3737e5e040/javascript/concrete-mixer.html which lets you type in lines of text, and constructs a concrete poem out of them. It's pretty lame actually -- er, to be more positive, there's lots of places it could be improved. Well, y'have to start somewhere. It's self-contained and short and public domain, so feel free to cannibalize it for whatever purposes.

If you want to save the generated SVG, you need to use SVG Crowbar https://nytimes.github.io/svg-crowbar/ -- there might be a simpler solution, but if so I haven't found it. Note that SVG Crowbar, in spite of describing itself as "Chrome-specific", does in fact work in Firefox (for simple SVGs like this), and in fact I have only tested this thing on Firefox so far.

— Reply to this email directly or view it on GitHub https://github.com/NaPoGenMo/NaPoGenMo2015/issues/9#issuecomment-94718887 .

cpressey commented 9 years ago

Ack! I only just found out that it's also International Pwoermd Writing Month! #pwoermds #InterNaPwoWriMo

...with only days left, anyone want to tackle a pwoermd generator (for InterNaPwoGenMo, naturally)???

cpressey commented 9 years ago

OK. I'm calling this a wrap, for now. Things I'm not proud of:

otoh... things I am proud of: