Skip to content

Rough Book

random musings

Menu
  • About Me
  • Contact
  • Projects
    • bAdkOde
    • CherryBlossom
    • FXCalendar
    • Sulekha
Menu

CherryBlossom

I don't know what it is about haikus that makes them so neat. Maybe it's because they're made up of prime numbers (3 lines, 5 syllables, 7 syllables, 5 syllables, a total of 17 syllables), or maybe it's because you have so much beauty, artistry and emotion neatly packaged in just three lines. Either way, I think they are pretty neat.

I think I first got the idea to write a language based on haikus around two weeks ago when I was reading about esoteric languages. I was going over the Shakespeare Programming Language (SPL) (which I first heard about from a slashdot post a few years ago) when I started thinking about variations on the same theme (that is, prose or poetry as program code). I then thought "What if a haiku could also be program code?". Thus, the idea of CherryBlossom was conceived. Initially, I was stumped as to how I could transform a haiku into program code. The structure of a haiku is rather rigid, and I couldn't think of an easy way to make a language (with variables, functions, and flow-control) because of that rigidity. In comparison, SPL is much more free-flowing since it's prose. In haiku, you are limited to the number of syllables and lines. Then I thought, "What if the language was minimalistic?". In that case, all I need to do is figure out a way to map words to a small instruction set! When talking about languages with small (although not too small) instruction sets, there is no better candidate than Brainfuck, which is a Turing-Complete language with only eight instructions. With that in mind, I finally had an idea about CherryBlossom's implementation.

Like I mentioned before, the idea behind CherryBlossom is pretty simple. Brainfuck instructions are mapped to words that convey the meaning or essence of the Brainfuck instruction. For example, the > instruction, which moves the pointer forward conveys an essence of moving forward, or up. Hence it makes sense to map it to words that convey a similar meaning. With that idea, I came up with the following mappings:

> (move pointer forward) above, ahead, atmosphere, bird, birds, flew, flies, flight, float, floated, floating, floats, fly, flew, flying, forward, front, heaven, heavenly, height, high, higher, hill, hillside, hilltop, mountain, mountainside, mountaintop, push, pushed, pushes, pushing, rise, rises, rising, sky, top, up, upward, upwards (words that convey a sense of forward or upward motion, flying, or height)
< (move pointer backward) back, backward, backwards, behind, below, dip, down, downwards, earth, fall, falling, falls, fell, ground, grounded, land, landed, landing, lands, low, lower, lowered, lowering, lowers, pull, rain, rained, rainfall, raining, rains, reverse, sink, sinking, sinks, snake, snow, snowed, snowfall, snowing, snows, valley, waterfall (words that convey a sense of backward or downard motion, falling, or depth)
+ (increment value at current memory location) alive, add, added, adding, adds, beautified, beautifies, beautiful, beautify, beautifying, beauty, butterfly, butterflies, big, bigger, bloom, bloomed, blooming, blooms, blossom, blossoming, blossoms, caress, caressed, caresses, caressing, cherry-blossom, cherry-blossoms, dawn, day, daybreak, days, dove, doves, dream, dreaming, dreams, dreamy, fat, fattening, fatty, field, fields, fire, flower, flowered, flowering, flowers, fragrance, fragrant, gain, gained, gains, get, gets, getting, good, grew, grow, growing, grows, had, happiness, happy, have, having, heal, healed, healing, heals, heat, heated, heats, hot, jasmine, learn, learning, learns, life, live, love, loved, lovely, loves, loving, lush, many, money, more, morning, new, own, owned, owning, owns, pleased, pleasing, pleasure, positive, pretty, rainbow, rainbows, remember, remembered, remembering, remembers, rose, roses, rosy, smile, smiled, smiles, smiling, spring, steam, steamed, steams, steamy, summer, sun, sunlight, sunlit, sunray, sunrays, sunshine, sweet, sweeten, sweetened, sweeter, sweetly, sweets, warm, warmth, wealth (words that convey a sense of gaining, beauty, increasing, or anything positive)
- (decrement value at current memory location) alone, autumn, anger, angry, bad, barren, break, broke, broken, cold, cool, chill, chilled, chills, chilly, cried, cry, crying, dark, darkening, darker, dead, death, desolate, desolation, depressed, depressing, desert, deserts, die, dies, dusk, dying, evening, evil, fear, fearful, few, fog, fogged, foggy, forget, forgetful, forgetting, forgot, forgotten, forsake, forsaken, freeze, freezing, freezes, froze, frozen, fright, frighten, frightened, frightening, gloom, gloomy, greed, greedy, ice, icy, less, lessen, lessened, lone, lonely, lonesome, lose, losing, loss, lost, melancholy, miss, missed, misses, missing, mist, mistake, mistaken, misted, mists, misty, moon, moonlight, moonlit, moonshine, nothing, night, nightfall, nightmare, old, pain, painful, poor, poverty, rage, remove, removes, removing, sad, sadness, scream, screamed, screams, screaming, shrank, shrink, shrinking, shrinks, shrunk, small, smaller, sorrow, sorrowful, tear, tearful, teary, thin, thins, thinned, thinning, ugliness, ugly, winter, wither, withering, withers, wound, wounded, wounds (words that convey a sense of loss, sadness, decreasing, or anything negative)
[ (jump forward past the matching ] if the value at the pointer is zero) if, why, when, where, how, who, what, inspect, puzzle, question, mull, riddle, decide, branch, branched, branches, branching, mulled, mulling, mulls, decides, deciding, decided, contemplate, contemplating, contemplation, contemplated, contemplates, think, thinking, thought, thinks, choose, chose, choosing, chooses, wonder, wondered, wondering, wonders (words that convey a sense of introspection or conditionality)
] (jump backward to the matching [ unless the value at the pointer is zero) return, home, reunite, returns, returned, returning, reunited, reunites, reuinting, acknowledge, acknowledges, acknowledged, acknowledging, acknowledgement, homecoming, retreat, retreating, retreats, retreated, restore, restoring, restored, restores, revisit, revisited, revisiting, revisits, rebound, rebounded, rebounding, rebounds, boomerang (words that convey a sense of returning)
. (print the ASCII character represented by the value at the pointer) answer, answered, answering, answers, art, artist, author, birdsong, book, brook, creek, display, displaying, displays, flow, flowing, flows, gave, give, giving, laugh, laughed, laughing, laughs, laughter, letter, melodious, melody, music, paint, painter, painting, paints, picture, poem, poet, present, respond, result, river, riverside, said, say, saying, says, show, showed, showing, shows, sang, sight, sing, singer, singing, sings, speak, speaker, speaking, speaks, spoke, stream, view, views, window, word, words, write, writer, writes, writing, wrote (words that convey a sense of speaking or saying)
, (input a value and store the ASCII character of that value at the pointer) absorb, absorbed, absorbing, absorbs, accepted, accepting, accepts, annex, annexed, annexes, annexing, ask, asked, asking, asks, attract, attracted, attracting, attracts, conquer, conquered, conquering, conquers, ditch, fill, filled, filling, fills, hear, hearing, hears, hole, in, indoor, indoors, inside, knew, know, knowing, knowledge, knows, learn, learned, learning, learns, lesson, lessons, question, questioned, questioning, questions, read, reader, reading, reads, receive, received, receives, receiving, suck, sucked, sucking, sucks, taken, takes, taking, taught, teach, teacher, teaching, took, vortex, whirlpool (words that convey a sense of questioning, learning or taking something in)
NOP (instructions that don't do anything) about, all, and, am, an, at, a, any, are, because, be, by, came, can, come, could, did, do, does, every, everything, for, from, go, he, her, hers, here, him, his, in, i, is, it, man, me, mine, my, no, now, of, one, on, or, our, ours, she, should, some, such, that, them, then, the, their, theirs, there, they, this, to, to, us, was, went, were, will, with, woman, would, yes, you, your, yours (these are words that I added so that it would be easier to write haikus, since it's hard to construct sentences or phrases without these words)
Pages: 1 2 3

10 thoughts on “CherryBlossom”

  1. TheMoonMaster says:
    March 14, 2010 at 8:17 pm

    This really is amazing. Now I can express myself AND make beautiful code all in one. Great work.

    Reply
  2. vivin says:
    March 14, 2010 at 8:31 pm

    @TheMoonMaster
    Thanks! That was the idea 😉 heh!

    Reply
  3. Pingback: uberVU - social comments
  4. Tushar Dadlani says:
    May 28, 2010 at 11:57 am

    This is really cool!! BrainF**k was pretty much a disaster.

    Reply
  5. vivin says:
    May 29, 2010 at 12:13 pm

    @Tushar Dadlani
    Haha, thanks! Yeah I think that the intent with Brainfuck!

    Reply
  6. anon says:
    June 14, 2010 at 3:23 pm

    Saw your shameless plug on SO 🙂

    This is so cool! I wish I had come up with something like this. I love it.

    Reply
  7. vivin says:
    June 14, 2010 at 3:30 pm

    @anon
    Thank you! 😀 It was definitely during some moments of boredom (and probably a little insanity) that I came up with this.

    Reply
  8. A says:
    August 26, 2010 at 1:21 pm

    Hey, this is really interesting! I’m kind of new to programming, and I really want to try this out. Could you just explain how Im supposed to set up and run the interpreter?

    Reply
  9. vivin says:
    September 3, 2010 at 8:12 am

    @A
    You need to download Perl and install a few modules. If you’re on Ubuntu, Perl should already be installed. You can start up CPAN by typing “cpan” and then installing the following modules.

    GetOpt::Mixed
    Term::ReadKey
    Lingua::EN::Syllable

    For Windows, there are some other options. You can install Strawberry Perl and use cpan to install the above modules.

    You say that you’re new to programming; I would suggest not starting off with CherryBlossom. It is a Brainf*ck analog after all and Brainf*ck isn’t designed to be easy 🙂

    Reply
  10. Pingback: Let’s Get Brainfucked! | Cyber Crud

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Archives

  • February 2023
  • April 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • June 2017
  • March 2017
  • November 2016
  • August 2016
  • July 2016
  • June 2016
  • February 2016
  • August 2015
  • July 2014
  • June 2014
  • March 2014
  • December 2013
  • November 2013
  • September 2013
  • July 2013
  • June 2013
  • March 2013
  • February 2013
  • January 2013
  • October 2012
  • July 2012
  • June 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • July 2011
  • June 2011
  • May 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • August 2008
  • March 2008
  • February 2008
  • November 2007
  • July 2007
  • June 2007
  • May 2007
  • March 2007
  • December 2006
  • October 2006
  • September 2006
  • August 2006
  • June 2006
  • April 2006
  • March 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • February 2005
  • October 2004
  • September 2004
  • August 2004
  • July 2004
  • June 2004
  • May 2004
  • April 2004
  • March 2004
  • February 2004
  • January 2004
  • December 2003
  • November 2003
  • October 2003
  • September 2003
  • July 2003
  • June 2003
  • May 2003
  • March 2003
  • February 2003
  • January 2003
  • December 2002
  • November 2002
  • October 2002
  • September 2002
  • August 2002
  • July 2002
  • June 2002
  • May 2002
  • April 2002
  • February 2002
  • September 2001
  • August 2001
  • April 2001
  • March 2001
  • February 2001
  • January 2001
  • December 2000
  • November 2000
  • October 2000
  • August 2000
  • July 2000
  • June 2000
  • May 2000
  • March 2000
  • January 2000
  • December 1999
  • November 1999
  • October 1999
  • September 1999
©2023 Rough Book | Built using WordPress and Responsive Blogily theme by Superb
All original content on these pages is fingerprinted and certified by Digiprove