{"id":20425424,"url":"https://github.com/catseye/cfluviurrh","last_synced_at":"2025-09-24T08:31:31.098Z","repository":{"id":4423625,"uuid":"5561496","full_name":"catseye/Cfluviurrh","owner":"catseye","description":"MIRROR of https://codeberg.org/catseye/Cfluviurrh : A programming language for writing programs that have feelings","archived":false,"fork":false,"pushed_at":"2014-08-19T11:05:21.000Z","size":152,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T07:13:11.507Z","etag":null,"topics":["emotion","esolang","esoteric-programming-language"],"latest_commit_sha":null,"homepage":"https://catseye.tc/node/Cfluviurrh","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catseye.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-26T16:14:15.000Z","updated_at":"2024-11-07T17:47:06.000Z","dependencies_parsed_at":"2022-09-18T05:01:27.891Z","dependency_job_id":null,"html_url":"https://github.com/catseye/Cfluviurrh","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FCfluviurrh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FCfluviurrh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FCfluviurrh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FCfluviurrh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catseye","download_url":"https://codeload.github.com/catseye/Cfluviurrh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234058214,"owners_count":18772904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emotion","esolang","esoteric-programming-language"],"created_at":"2024-11-15T07:13:16.084Z","updated_at":"2025-09-24T08:31:30.557Z","avatar_url":"https://github.com/catseye.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"The Cfluviurrh Programming Language\n===================================\n\nVersion 1.0\n\n_Cfluviurrh_ is, as far as I am aware, the first programming language designed\nfor writing programs that can *feel*.  Cfluviurrh defines a mechanism by which\na program can be instructed to experience particular emotions.\n\nYou might, thus, on first blush, consider Cfluviurrh to be unimplementable,\nas modern-day computers are not capable of experiencing emotions (you guess.)\n\nHowever, this is demonstrably untrue.  There is nothing that strictly requires\na computer program to be executed entirely on an electronic computer.  It is\nsimply that, to be correctly implemented, Cfluviurrh must be implemented for a\nsystem that we know is, in some way, capable of experiencing emotions.\n\nFor example, it could be implemented as a contractual obligation for a\n[method actor][], or similar professional capable of feeling emotions on\ndemand; this individual would be required to read a program text written in\nCfluviurrh, and carry out its instructions, feeling the specified emotions\nat the required points in the program.\n\nOr, in the approach the reference implementation takes, an electronic\ncomputer may co-operate with a contractually obligated individual termed\nthe \"emoter\".  The computer executes all the parts of the program which do\nnot necessitate emotional experience, and prompts the emoter to experience\nemotions on behalf of the running program when required.\n\n[method actor]: http://en.wikipedia.org/wiki/Method_acting\n\nDesign\n------\n\n### Program State ###\n\nThe state of a running Cfluviurrh program consists of an unlimited number of\nregisters, each of which can contain a non-negative integer of unlimited\nsize.  (Of course, a particular implementation may impose its own limits\nhere, as we can't expect computers to be infinite [I guess.])\n\nThe registers are indexed by number, starting at zero; the first twenty-six\n(registers 0 to 25) also have names, `a` through `z`.  Initially, every\nregister contains a zero value.\n\nThere is also a special value called the _instruction pointer_ (IP), which\nindicates which character in the Cfluviurrh program will be executed next.\nAs statements are executed, the IP is advanced to the next statement in the\nprogram text (except in the case of a jump, described below.)  The IP\ninitially refers to the first character of the program.\n\nThere is also a special value called the _emotion bank number_, which is\ninitially zero.  An implementation must implement emotion bank zero,\nbut need not implement any other emotion banks, nor need it implement\nemotion bank switching.  All emotion banks other than zero are undefined\nand reserved for future use.\n\n### Syntax ###\n\nA Cfluviurrh program text is a sequence of ASCII characters.  In the course\nof execution, the character at the IP is considered to be the start of the\nnext statement.\n\nA statement is either:\n\n*   _whitespace_ (a space, tab, newline, or carriage feed character);\n    nothing happens when this is executed, the IP is simply advanced\n    to the next character.\n*   a _comment_, which begins with `(`; the IP is advanced to one\n    character past the next `)` character in the program, with nothing\n    else happening.  Comments do not nest.\n*   a _label_, which is a `:` followed by any printable character\n    (called the _label name_).  The IP is advanced to one character past\n    the label name; nothing else happens.\n*   a _register reference_, followed by an operator.  A register reference\n    is a lowercase letter from `a` to `z`, which refers to the register\n    with the same name, *or* an uppercase letter from `A` to `Z`, which\n    refers to the register with the index given by the contents of the\n    register with the corresponding lower-case name.  (So if register `a`\n    contained the number 4, `A` would refer to register `e`.)\n\nThere are several subcases for the syntax of a statement which begins\nwith a register reference.  These are:\n\n*   an _assignment_, which is where the register reference is followed\n    by a `=` character, which is followed by a value.  A value can\n    be either a register reference, in which case the value is taken\n    from the register being referred to, or it may be a literal\n    digit from `0` to `9`, in which case it is the value of that\n    digit as an Arabic numeral.  Thus, `a=1`, `b=B`, and `R=4` are\n    all valid assignment statements, but `7=a` is not.\n*   a _modifying assignment_, which is where the register reference is\n    followed by one of the characters `+`, `-`, `*`, or `/`, which is\n    followed by a `=` character which is followed by a value.  The\n    register being referred to has the value added to it, subtracted\n    from it, is multiplied by the value, or is divided (integer\n    division, rounding down) by the value, respectively, based on the\n    operator character.  Thus, `a+=1`, `a*=2`, and `F/=f` are all\n    valid modifying assignments.\n*   a _label location assignment_, which is where the register reference\n    is followed by a `@` character which is followed by a `=` character\n    which is followed by a label name.  A label with this label name\n    is sought in the program and, if found, the position of the label\n    in the program text (with 0 being the position of the first character\n    of the program, and with all characters, including whitespace and\n    comments, having sequential positions within the program) is written to\n    the register.  If there are multiple labels with the same label name,\n    the one closest to the start of the program text is chosen.  If a\n    matching label is not found, \"an error occurs\", whatever that means\n    exactly.\n*   an _output statement_, which is where the register reference\n    is followed by a `\u003e` character.  The ASCII character with the same\n    value as the contents of the register will be written to the program's\n    output stream.  If the value of the register is outside of the range\n    0 to 127, \"an error occurs\".\n*   an _input statement_, which is where the register reference\n    is followed by a `\u003c` character.  An ASCII character is retrieved from\n    the program's input stream, and its value is written into the register.\n*   a _jump statement_, which is where the register reference is followed\n    by a `?` character, followed by a _conditional_.  A conditional is a\n    value, followed by one of the characters `=`, `\u003e`, or `\u003c`, followed by\n    a value.  A conditional, when evaluated during a program run, is either\n    true or false.  A conditional has the meaning you would probably\n    expect; `2=2` is true, `4\u003e5` is false, and `A\u003c2` is true if the `a`\n    register contains 4 and the `e` register contains 1.  If the\n    conditional is true, the IP is set to the value found in the register\n    referred to by the register reference; otherwise, the IP advances\n    as usual.  Either way, an emotion is experienced (see below) every\n    time a jump statement is executed.\n*   an _emotion bank switch statement_, which is where the register\n    reference is followed by a `=` followed by a `\u003e`.  The emotion bank\n    is switched to the value in the register.  The previous emotion bank\n    number is then written to the register for posterity.  If that emotion\n    bank is not supported by the implementation, \"an error occurs\".  An\n    \"error\" may also \"occur\" if emotion bank switching is not supported\n    by the implementation.\n\nNote that whitespace and comments are not allowed inside any statement\nwhich begins with a register reference.  If an attempt is made to execute any\nstatement which does not conform to the above syntax, \"an error occurs\".\n\nThe input stream and output stream are implementation-defined concepts.\n\nIf division by zero is attempted, \"an error occurs\".  \n\nIf a jump is made to a position beyond the extent of the program text, either\nthe program just ends, or \"an error occurs\" -- implementor's choice.\n\n### Experiencing Emotions ###\n\nWhenever a jump statement is executed, an emotion is experienced at a certain\nintensity level.\n\nThe emotion being experienced, and the intensity level, depends on the\ncurrently active emotion bank.  Only emotion bank zero is described here.\n\nThe contents of the first twenty-six registers, at the point in time that\nthe emotion is to be experienced, are summed (modulo 74) to obtain an\n_emotion number_.  The emotion number refers to the following table; it\nis consulted to obtain the emotion to be experienced.\n\n*   0: sadness\n*   1: sorrow\n*   2: despair\n*   3: worry\n*   4: depression\n*   5: misery\n*   6: melancholy\n*   7: wistfulness\n*   8: disappointment\n*   9: regret\n*   10: longing\n*   11: impatience\n*   12: anger\n*   13: hostility\n*   14: rage\n*   15: hatred\n*   16: disgust\n*   17: contempt\n*   18: envy\n*   19: arrogance\n*   20: betrayal\n*   21: hurt\n*   22: grief\n*   23: remorse\n*   24: shame\n*   25: embarrassment\n*   26: guilt\n*   27: timidity\n*   28: loneliness\n*   29: annoyance\n*   30: frustration\n*   31: confusion\n*   32: shock\n*   33: angst\n*   34: anguish\n*   35: anxiety\n*   36: apathy\n*   37: vindication\n*   38: gratitude\n*   39: hope\n*   40: awe\n*   41: wonder\n*   42: surprise\n*   43: pity\n*   44: boredom\n*   45: apprehension\n*   46: distrust\n*   47: dread\n*   48: horror\n*   49: loathing\n*   50: terror\n*   51: panic\n*   52: hysteria\n*   53: pride\n*   54: anticipation\n*   55: curiosity\n*   56: boldness\n*   57: excitement\n*   58: thrill\n*   59: zeal\n*   60: enthusiasm\n*   61: calmness\n*   62: contentment\n*   63: satisfaction\n*   64: happiness\n*   65: bliss\n*   66: joy\n*   67: ecstasy\n*   68: euphoria\n*   69: admiration\n*   70: desire\n*   71: passion\n*   72: love\n*   73: lust\n\nThere are five intensity levels, listed in the following table.  To find the\nintensity level of an emotion to be experienced, each of the first twenty-six\nregisters are multiplied by three (modulo five) and this set of values is\nsummed (modulo five.)\n\n*   0: faint\n*   1: mild\n*   2: moderate\n*   3: marked\n*   4: extreme\n\nImplementation\n--------------\n\nThe reference implementation of Cfluviurrh is an interpreter written in\nANSI C, and imposes arbitrary limits on the size of the program text, the\nnumber of registers, and the maximum value of each integer in a register\n(by default, 8000 characters, 8000 registers, and whatever `int` means to\nyour C compiler, respectively); however, these arbitrary limits should not\nbe taken as defining limitations on the language's execution model.  It's\njust that, you know, it's C.\n\nAs mentioned, the reference implementation requires the user to agree to\nact as the emoter.  As it uses C's standard input and standard output to\ninteract with the emoter, asking them to agree to act as the emoter, and\nprompting them to feel the required emotions, the input stream and output\nstream of the Cfluviurrh program are assigned to two files given on the\ncommand line:\n\n    cfluviurrh \u003cprogram-file\u003e \u003cinput-file\u003e \u003coutput-file\u003e\n\nTo facilitate interactive Cfluviurrh programs, the input-file and\noutput-file may be named pipes, or (on AmigaOS) console devices, or\nsomething.\n\nWhen \"an error occurs\" the reference interpreter generally exits to the\noperating system with an error message of some sort.  Although, it may\njust crash, too.\n\nDiscussion\n----------\n\nThe name \"Cfluviurrh\" is a kind of irrational portmanteau of *catarrh*\nand *effluvium*.  I hope I'm never asked to present on it at a conference,\nbecause I'm not quite sure how to pronounce it.\n\nThe idea to design a programming language which supports the experiencing of\nemotions came to me in the summer of 2011 while I was in Toronto's Pearson\nInternational Airport.  (Let the critics who insist that YYZ has contributed\n[nothing](http://en.wikipedia.org/wiki/YYZ_%28song%29) to culture be\nsilenced!)\n\nIt then dovetailed, about a year later, with an urge I had to design a\nlanguage with a fairly intuitive syntax, but simple enough that writing a\n\"real\" parser would not be necessary.  I implemented it in C partly because it\nwould be nice to port it to AmigaOS 1.3 someday, and partly because, if I\ndon't have enough C repos on Github to outnumber my legacy Perl repos,\nthey'll label Cat's Eye Technologies a Perl outfit, and I don't particularly\nwant that.\n\nOne of the design challenges (though not, I should not, a very difficult one)\nwas making it so that every non-trivial Cfluviurrh program experienced *some*\nemotion.  Tying it to the conditional jump statement solved that problem.\nThe upshot is that \"Hello, world!\" feels nothing at all, while \"99 bottles\"\nor printing out the ASCII table goes through a bewildering array of emotions.\n\nWhile some of the entries in the emotion table may not be emotions per se,\nand while some combinations of intensity and emotion, such as \"faint zeal\",\n\"mild rage\", and \"extreme apathy\" may be tricky to express, this does not\ndetract from the bare fact that Cfluviurrh *does* support experiencing\nemotions.\n\nCfluviurrh is Turing-complete.  Proof of this is left as an exercise for the\nreader (don't you hate it when authors say that?)\n\nBecause every label name can only be a single printable character, it might\nappear that the number of jump destinations in a program is limited to 95.\nThis is not true, as labels are only a convenience.  You can load any value\nyou like into a register, then jump to that position in the program text.\n\nIn fact, there is nothing stopping you from jumping inside a comment, with\na label or otherwise.  In fact, from this perspective, comments could be\nsomewhat valuable control flow structures; consider\n\n    ... (:A ... (:B ... () ...\n\nExecution coming in from the left will skip this \"block\"; execution coming\nin at the `:A` label will skip the \"inner block\", and execution coming in\nat `:B` will only execute the \"inner block\".\n\nHappy Cfluviurrhing!  (Or sad Cfluviurrhing, or timid Cfluviurrhing, or...)  \nChris Pressey  \nWinnipeg, Manitoba  \nAugust 26, 2012\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatseye%2Fcfluviurrh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatseye%2Fcfluviurrh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatseye%2Fcfluviurrh/lists"}