{
    "archive_path": "archive/1740813387.148725",
    "base_url": "billwadge.com/2025/02/22/the-yin-and-yang-of-programming",
    "basename": "",
    "bookmarked_date": "2025-03-01 07:16",
    "canonical": {
        "archive_org_path": "https://web.archive.org/web/billwadge.com/2025/02/22/the-yin-and-yang-of-programming",
        "dom_path": "output.html",
        "favicon_path": "favicon.ico",
        "git_path": "git/",
        "google_favicon_path": "https://www.google.com/s2/favicons?domain=billwadge.com",
        "headers_path": "headers.json",
        "htmltotext_path": "htmltotext.txt",
        "index_path": "index.html",
        "media_path": "media/",
        "mercury_path": "mercury/content.html",
        "pdf_path": "output.pdf",
        "readability_path": "readability/content.html",
        "screenshot_path": "screenshot.png",
        "singlefile_path": "singlefile.html",
        "warc_path": "warc/",
        "wget_path": null
    },
    "domain": "billwadge.com",
    "downloaded_at": "2025-03-01T07:16:28.966131+00:00",
    "downloaded_datestr": "2025-03-01 07:16",
    "extension": "",
    "hash": "1XDXZX5H19P4ENJJBG79",
    "history": {
        "archive_org": [
            {
                "cmd": [
                    "/usr/bin/curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--proxy",
                    "socks5://tor-socks-proxy:9150",
                    "--head",
                    "--max-time",
                    "60",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 ArchiveBox/{VERSION} (+https://github.com/ArchiveBox/ArchiveBox/)",
                    "https://web.archive.org/save/https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/"
                ],
                "cmd_version": "8.10.1",
                "end_ts": "2025-03-01T07:18:11.092672+00:00",
                "index_texts": null,
                "output": "TimeoutExpired: Command '['/usr/bin/curl', '--silent', '--location', '--compressed', '--proxy', 'socks5://tor-socks-proxy:9150', '--head', '--max-time', '60', '--user-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 ArchiveBox/{VERSION} (+https://github.com/ArchiveBox/ArchiveBox/)', 'https://web.archive.org/save/https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/']' timed out after 60 seconds",
                "pwd": "/data/archive/1740813387.148725",
                "schema": "ArchiveResult",
                "start_ts": "2025-03-01T07:17:11.032188+00:00",
                "status": "failed"
            }
        ],
        "dom": [
            {
                "cmd": [
                    "/usr/bin/chromium-browser",
                    "--proxy-server=socks5://tor-socks-proxy:9150",
                    "--disable-features=DarkMode",
                    "--run-all-compositor-stages-before-draw",
                    "--hide-scrollbars",
                    "--autoplay-policy=no-user-gesture-required",
                    "--no-first-run",
                    "--use-fake-ui-for-media-stream",
                    "--use-fake-device-for-media-stream",
                    "--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'",
                    "--headless=new",
                    "--no-sandbox",
                    "--no-zygote",
                    "--disable-dev-shm-usage",
                    "--disable-software-rasterizer",
                    "--disable-sync",
                    "--window-size=1440,2000",
                    "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 ArchiveBox/{VERSION} (+https://github.com/ArchiveBox/ArchiveBox/)",
                    "--user-data-dir=/data/personas/Default/chrome_profile",
                    "--profile-directory=Default",
                    "--dump-dom",
                    "https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/"
                ],
                "cmd_version": "131.0.6778",
                "end_ts": "2025-03-01T07:16:48.957512+00:00",
                "index_texts": null,
                "output": "output.html",
                "pwd": "/data/archive/1740813387.148725",
                "schema": "ArchiveResult",
                "start_ts": "2025-03-01T07:16:39.331180+00:00",
                "status": "succeeded"
            }
        ],
        "favicon": [
            {
                "cmd": [
                    "/usr/bin/curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--proxy",
                    "socks5://tor-socks-proxy:9150",
                    "--max-time",
                    "60",
                    "--output",
                    "favicon.ico",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 ArchiveBox/{VERSION} (+https://github.com/ArchiveBox/ArchiveBox/)",
                    "https://www.google.com/s2/favicons?domain=billwadge.com"
                ],
                "cmd_version": "8.10.1",
                "end_ts": "2025-03-01T07:16:34.775965+00:00",
                "index_texts": null,
                "output": "favicon.ico",
                "pwd": "/data/archive/1740813387.148725",
                "schema": "ArchiveResult",
                "start_ts": "2025-03-01T07:16:31.710795+00:00",
                "status": "succeeded"
            }
        ],
        "git": [],
        "headers": [
            {
                "cmd": [
                    "/usr/bin/curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--proxy",
                    "socks5://tor-socks-proxy:9150",
                    "--head",
                    "--max-time",
                    "60",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 ArchiveBox/{VERSION} (+https://github.com/ArchiveBox/ArchiveBox/)",
                    "https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/"
                ],
                "cmd_version": "8.10.1",
                "end_ts": "2025-03-01T07:16:35.021061+00:00",
                "index_texts": null,
                "output": "headers.json",
                "pwd": "/data/archive/1740813387.148725",
                "schema": "ArchiveResult",
                "start_ts": "2025-03-01T07:16:34.810417+00:00",
                "status": "succeeded"
            }
        ],
        "htmltotext": [
            {
                "cmd": [
                    "(internal) archivebox.extractors.htmltotext",
                    "./{singlefile,dom}.html"
                ],
                "cmd_version": "0.8.5rc51",
                "end_ts": "2025-03-01T07:17:04.647804+00:00",
                "index_texts": [
                    "The Yin and Yang of Programming [2400 views] | Bill Wadge's Blog (https://gmpg.org/xfn/11) (https://s0.wp.com/wp-content/themes/pub/twentyten/style.css?ver=20190507) (https://billwadge.com/xmlrpc.php) (//s0.wp.com) (//widgets.wp.com) (Bill Wadge's Blog \u00bb Feed) (https://billwadge.com/feed/) (Bill Wadge's Blog \u00bb Comments Feed) (https://billwadge.com/comments/feed/) (Bill Wadge's Blog \u00bb The Yin and Yang of Programming [2400\u00a0views] Comments Feed) (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/feed/) (https://s0.wp.com/_static/??-eJxtzFsKgCAQheENZaMg+BStRXQI80oz0vbDCILo5cAHhx/OJlwtjIUhd9FS30Ih2JGbdfEx5FrH+J6Q4MBkGb1olfij2RFN8J9MIeIbvjXua16UUUZLLY3eL2BkNNM=&cssminify=yes) (https://s0.wp.com/_static/??-eJyljkEOwiAQRS8kHWqbujKeBegEqRTIzFDD7a1uTFw1cfnz8l4+PItyOQkmgRKrD4nB131aJL8TQtjOutPdALaGOION2T1UDJYMNWBpETvHfIL/QnLH9UjoYzEsKMW8ddNyFeUpzIe//CTISEiev/ptvfaXUU/T0I96eQFz3mpD&cssminify=yes) (https://s0.wp.com/_static/??-eJzTLy/QzcxLzilNSS3WzyrWz01NyUxMzUnNTc0rQeEU5CRWphbp5qSmJyZX6uVm5uklFxfr6OPTDpRD5sM02efaGpoZmFkYGRuZGmQBAHPvL0Y=&cssminify=yes) (https://s0.wp.com/wp-content/plugins/coblocks/2.18.1-simple-rev.4/dist/coblocks-style.css?m=1681832297i&cssminify=yes) (https://s0.wp.com/_static/??/wp-content/mu-plugins/core-compat/wp-mediaelement.css,/wp-content/mu-plugins/wpcom-bbpress-premium-themes.css?m=1432920480j&cssminify=yes) (https://s0.wp.com/wp-content/mu-plugins/jetpack-mu-wpcom-plugin/moon/jetpack_vendor/automattic/jetpack-mu-wpcom/src/build/verbum-comments/verbum-comments.css?m=1737738052i&cssminify=yes) (https://widgets.wp.com/verbum-block-editor/block-editor.css?ver=1738686361) (https://s0.wp.com/_static/??/wp-content/themes/pub/twentyten/blocks.css,/wp-content/themes/pub/twentyten/style-wpcom.css?m=1610459589j&cssminify=yes) (https://s0.wp.com/_static/??-eJzTLy/QTc7PK0nNK9HPLdUtyClNz8wr1i9KTcrJTwcy0/WTi5G5ekCujj52Temp+bo5+cmJJZn5eSgc3bScxMwikFb7XFtDE1NLExMLc0OTLACohS2q&cssminify=yes) (https://s0.wp.com/_static/??-eJyNjcEKwjAQRH/IuA1aehI/ReImJKmb3eAmFP9eW3oRL16GeTC8gaUaFG6BG5RuKvWYWWEOrTp87AxFZA3fKShocs/gnfevrWaOR1Q9wP+mW2YEFcyODEkU/YIfW0uhfH7TGSLJ3dE6uJaLneww2mkYT/MbUOlJHA==&cssminify=yes) (RSD) (https://billwadge.wordpress.com/xmlrpc.php?rsd) (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/) (https://wp.me/p105ft-1GX) (https://public-api.wordpress.com/oembed/?format=json&url=https%3A%2F%2Fbillwadge.com%2F2025%2F02%2F22%2Fthe-yin-and-yang-of-programming%2F&for=wpcom-auto-discovery) (https://public-api.wordpress.com/oembed/?format=xml&url=https%3A%2F%2Fbillwadge.com%2F2025%2F02%2F22%2Fthe-yin-and-yang-of-programming%2F&for=wpcom-auto-discovery) (https://s0.wp.com/i/favicon.ico) (https://s0.wp.com/i/favicon.ico) (https://s0.wp.com/i/webclip.png) (https://billwadge.com/?openidserver=1) (https://billwadge.com/) (https://billwadge.com/osd.xml) (Bill Wadge's Blog) (https://s1.wp.com/opensearch.xml) (WordPress.com) (https://0.gravatar.com/js/hovercards/hovercards.min.css?ver=2025097d8bf6c02970a26c6b0c26b0fcfc89796aa30f84307cffd8fd28d2bcca53dd7a) (https://s0.wp.com/wp-content/mu-plugins/actionbar/actionbar.css?v=20250116)  (https://billwadge.com/) (Bill Wadge's Blog) Bill Wadge's Blog   Just another WordPress.com site (https://billwadge.com/) (Bill Wadge's Blog) ()   (Skip to content) Skip to content  (https://billwadge.com/) Home  (https://billwadge.com/about/) A short academic biography [6600\u00a0views]  (https://billwadge.com/about-2/) About  (https://billwadge.com/contact/) Contact  (https://billwadge.com/lucid-language/) Lucid Language [590\u00a0views]  (https://billwadge.com/wadge-degrees/) Wadge Degrees [300\u00a0views]       (https://billwadge.com/2024/07/07/the-root-of-all-evil-more-sayings/) \u2190 The Root of all Evil- more\u00a0sayings  (https://billwadge.com/2025/02/28/pyfl-and-its-while-clauses/) PyFL and its While\u00a0Clauses \u2192    (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/) The Yin and Yang of Programming [2400\u00a0views]  Posted on (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/) (10:50 pm) February 22, 2025  by (https://billwadge.com/author/billwadge/) (View all posts by Bill Wadge) Bill Wadge   [This is from a paper we\u2019re submitting to the International Conference on Functional Programming (ICFP 2025)][update: the paper was rejected because we included our names, violating anonymity] Introduction  Recursion and iteration are the Yin and Yang of programming. Conventional languages support both, but tend to favor the Yang \u2013 iteration. Java and C, for example, have elaborate\u00a0while\u00a0and/or\u00a0for statements but can\u2019t easily return functions as results. Python is a bit better. The Yin, we might say, is strong in that one.   Even Python, however, still limits the use of functions. It does not allow partial application and has a very restricted lambda expression. Even in Python the positive Yang is dominant. Iteration, however, has its problems. Even simple\u00a0while\u00a0loops can be hard to understand (let alone verify) because the state changes not just with every step of the iteration but with each execution of each assignment statement in the body. The problems with iteration led to the invention of the pure functional languages in which there is no iteration. In these languages everything is done with recursion, and the closest we get to iteration is tail recursion. In a language like Haskell not only is the Yin dominant, the Yang is almost completely missing. The pure functional languages have proved remarkably successful, Haskell in particular. Yin has proved capable of practical applications. But functional programmers often confess to missing iteration. To switch metaphors, recursion is \u201cpure\u201d and iteration is \u201cimpure,\u201d but they long for impurity. Sometimes this longing is expressed in almost Freudian terms, opposing recursion, associated with Virtue, and iteration, associated with Vice. Supposedly Vice has an unhealthy attraction and tempts the poor programmer away from Virtue. Can we resolve this and satisfy this longing without plunging programmers into the depths of Vice? We believe so. Our strategy is to take a pure (dark) Yin language and add a controlled, declarative form of iteration that sheds a bit of light. The functional language is PyFL, an experimental language being developed by the authors. We extended PyFL with the declarative\u00a0while\u00a0construct that provides a little illumination in the dark. The extension process was simple and straightforward and ought to be applicable to other functional languages.  [technical sections omitted] Yin and Yang Revisited  When we introduced the Yin and Yang metaphor we thought carefully about which to identify as which. Yin and Yang are not completely symmetrical; they have different connotations. Briefly,\u00a0Yang\u00a0is positive, bright, active whereas\u00a0\u00a0Yin\u00a0is negative, dark, passive. Given that this is a functional programming conference our first choice was make recursion\u00a0the positive\u00a0Yang; but we changed our minds. Our machines are all iterative and it takes sophisticated engineering to make them support recursion and hierarchical data structures\u00a0(e.g. nested lists).  Of course this\u00a0is\u00a0necessary because there are\u00a0plenty of applications, like parsing, that call for Yin -recursive algorithms and hierarchical data structures. But there are plenty more (e.g. numerical analysis) that naturally involve Yang \u2013 iterative algorithms and linear data structures (arrays). One give away is the yearning\u00a0phenomenon mentioned earlier. If recursion were bright and positive, why would its proponents long for the dark and negative? But if the recursive side is dark and negative it only makes sense that recursionists would long for Yang, for the bright and positive. The evidence is that in terms of practical applications the positive Yang is dominant \u2013\u00a0the majority of problems are best solved with iterative algorithms and linear data structures. Artificial Intelligence (AI)\u00a0is a case in point. For many decades the standard approach (Good Old Fashioned AI, or GOFAI) was heavily Yin, relying on recursive algorithms and hierarchical data structures.\u00a0The programming was done in Yin languages like\u00a0Prolog. But GOFAI was never very successful. The translations were laughably bad and only a massive\u00a0effort produced a winning chess program. The Asian game\u00a0Go (Baduk, Wei-Chi) with its massive 19\u00d719 board completely defeated GOFAI. Then along came neural networks and machine learning. The translations are excellent and\u00a0Go was mastered in a few days. The computations are all linear algebra, arrays and iterative algorithms. Even the hardware (Nvidia chips) are iterative.\u00a0A triumph for Yang. The obvious question is, if Yin is so dark, why the enthusiasm for purely recursive languages (as evidenced by ICFP itself)? The answer is that bright Yang \u2013 iteration \u2013 has its own dark side,\u00a0its own Yin. (Notice that in the traditional Yin/Yang image there is a white Yang spot within the dark Yin figure and vice versa. There is Yang within Yin and Yin within Yang).  The presence of (side) effects (among other things) makes the programs hard to understand, verify, or modify.\u00a0Yin, on the other hand, has its own corresponding bright\u00a0Yang\u00a0side, due mainly to the absence of side effects. How do we escape these conflicts between Yins and Yangs? We\u2019re proposing a compromise or synthesis: a Yin language with a strong positive side augmented with a little bit of Yang, with a limited negative side.\u00a0We have shown that a little bit of Yang goes a long way. [I\u2019m adding these remarks, which are not in the paper] These considerations shed light on the nature of the language Lucid. We used to argue that Lucid is a Yin language- a functional language \u2013 but that\u2019s not  the case. Lucid is strictly first order. My student Rondogiannis found a way to add some higher order functions and preserve the eductive implementation; but only for certain higher order types. In particular Rondogiannis\u2019 approach can\u2019t handle functions that return other functions as results. The only conclusion to be drawn is that functions in Lucid are not first class objects and hence Lucid is not a functional language. With its emphasis on streams and indexing, it is a Yang \u2013 iterative \u2013 language. In fact, in the development of Lucid indexing and eduction have priority. Features, such as higher order functions, that clash with eduction, are not pursued. The developers of GLU doubled down on the Yang and introduced arbitrary dimensions (and the pylucid interpreter now supports a space dimension). Lucid is a Yang language (a Yanguage?) All this suggests that Lucid would be improved by adding a small amount of Yin, as PyFL was improved by adding a small amount of Yang. Which small amount? One possibility is Rondogiannis\u2019 (restricted) higher order functions, although that would be ambitious and would have to involve some kind of type declaration scheme. A tiny step in this direction would be limited second order functions, that take first order function parameters. This would take care of about 95% of the use of higher order functions in numerical analysis, where function parameters are common. Share this: (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/?share=facebook&nb=1) (Click to share on Facebook) Facebook   (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/?share=x&nb=1) (Click to share on X) X        Like  Loading...     Related  (https://billwadge.com/2020/07/09/popcode-a-concatenative-language-with-looping/) (Popcode, a FORTH-like language with looping [280&nbsp;views]) Popcode, a FORTH-like language with looping [280\u00a0views]  July 9, 2020 With 2 comments  (https://billwadge.com/2025/02/28/pyfl-and-its-while-clauses/) (PyFL and its While&nbsp;Clauses) PyFL and its While\u00a0Clauses  February 28, 2025 In \"python\"  (https://billwadge.com/2022/06/09/pylucid-where-to-get-it-how-to-use-it/) (PyLucid &#8211; where to get it, how to use it [150&nbsp;views]) PyLucid \u2013 where to get it, how to use it [150\u00a0views]  June 9, 2022       ()  About Bill Wadge  I am a retired Professor in Computer Science at UVic. (https://billwadge.com/author/billwadge/) View all posts by Bill Wadge \u2192     This entry was posted in (https://billwadge.com/category/uncategorized/) Uncategorized and tagged (https://billwadge.com/tag/ai/) ai , (https://billwadge.com/tag/artificial-intelligence/) artificial-intelligence , (https://billwadge.com/tag/philosophy/) philosophy . Bookmark the (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/) (Permalink to The Yin and Yang of Programming [2400\u00a0views]) permalink .   (https://billwadge.com/2024/07/07/the-root-of-all-evil-more-sayings/) \u2190 The Root of all Evil- more\u00a0sayings  (https://billwadge.com/2025/02/28/pyfl-and-its-while-clauses/) PyFL and its While\u00a0Clauses \u2192    Leave a comment (/2025/02/22/the-yin-and-yang-of-programming/#respond) Cancel reply    (6507) (0) (1a5df24963) ()  (ea6038267c)  \u0394  (1740813403722)    This site uses Akismet to reduce spam. (https://akismet.com/privacy/) Learn how your comment data is processed.     Search for: () (Search)    Email Subscription  Enter your email address to subscribe to this blog and receive notifications of new posts by email. Email Address:  (Email Address) ()  (subscribe) (14796515) (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/) (widget) (subscribe-blog) (92f6104f26) Sign me up!    Join 80 other subscribers    Recent Posts (https://billwadge.com/2025/02/28/pyfl-and-its-while-clauses/) PyFL and its While\u00a0Clauses  (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/) The Yin and Yang of Programming [2400\u00a0views]  (https://billwadge.com/2024/07/07/the-root-of-all-evil-more-sayings/) The Root of all Evil- more\u00a0sayings  (https://billwadge.com/2024/06/29/computers-are-useless-and-other-sayings/) \u201cComputers are Useless\u201d and Other Sayings [420\u00a0views]  (https://billwadge.com/2024/03/11/the-complete-story-of-godel-incompleteness/) The complete story of G\u00f6del incompleteness. [4100\u00a0views]    Archives (https://billwadge.com/2025/02/) February 2025  (https://billwadge.com/2024/07/) July 2024  (https://billwadge.com/2024/06/) June 2024  (https://billwadge.com/2024/03/) March 2024  (https://billwadge.com/2024/02/) February 2024  (https://billwadge.com/2023/04/) April 2023  (https://billwadge.com/2023/03/) March 2023  (https://billwadge.com/2023/02/) February 2023  (https://billwadge.com/2022/12/) December 2022  (https://billwadge.com/2022/11/) November 2022  (https://billwadge.com/2022/07/) July 2022  (https://billwadge.com/2022/06/) June 2022  (https://billwadge.com/2022/05/) May 2022  (https://billwadge.com/2022/03/) March 2022  (https://billwadge.com/2022/02/) February 2022  (https://billwadge.com/2022/01/) January 2022  (https://billwadge.com/2021/12/) December 2021  (https://billwadge.com/2021/08/) August 2021  (https://billwadge.com/2021/07/) July 2021  (https://billwadge.com/2021/06/) June 2021  (https://billwadge.com/2021/05/) May 2021  (https://billwadge.com/2021/03/) March 2021  (https://billwadge.com/2021/02/) February 2021  (https://billwadge.com/2021/01/) January 2021  (https://billwadge.com/2020/09/) September 2020  (https://billwadge.com/2020/08/) August 2020  (https://billwadge.com/2020/07/) July 2020  (https://billwadge.com/2020/06/) June 2020  (https://billwadge.com/2020/04/) April 2020  (https://billwadge.com/2020/03/) March 2020  (https://billwadge.com/2020/02/) February 2020  (https://billwadge.com/2020/01/) January 2020  (https://billwadge.com/2019/12/) December 2019  (https://billwadge.com/2019/10/) October 2019  (https://billwadge.com/2019/06/) June 2019  (https://billwadge.com/2019/04/) April 2019  (https://billwadge.com/2019/03/) March 2019  (https://billwadge.com/2018/10/) October 2018  (https://billwadge.com/2018/09/) September 2018  (https://billwadge.com/2017/11/) November 2017  (https://billwadge.com/2017/06/) June 2017  (https://billwadge.com/2017/05/) May 2017  (https://billwadge.com/2017/04/) April 2017  (https://billwadge.com/2017/03/) March 2017  (https://billwadge.com/2016/03/) March 2016  (https://billwadge.com/2016/01/) January 2016  (https://billwadge.com/2015/12/) December 2015  (https://billwadge.com/2015/11/) November 2015  (https://billwadge.com/2015/10/) October 2015  (https://billwadge.com/2015/09/) September 2015  (https://billwadge.com/2012/07/) July 2012  (https://billwadge.com/2012/04/) April 2012  (https://billwadge.com/2012/03/) March 2012  (https://billwadge.com/2011/12/) December 2011  (https://billwadge.com/2011/05/) May 2011  (https://billwadge.com/2011/04/) April 2011  (https://billwadge.com/2011/03/) March 2011  (https://billwadge.com/2011/02/) February 2011  (https://billwadge.com/2010/07/) July 2010    Meta (https://wordpress.com/start?ref=wplogin) Register  (https://billwadge.wordpress.com/wp-login.php) Log in  (https://billwadge.com/feed/) Entries feed  (https://billwadge.com/comments/feed/) Comments feed  (https://wordpress.com/) (Powered by WordPress, state-of-the-art semantic personal publishing platform.) WordPress.com       (https://billwadge.com/) (Bill Wadge's Blog) Bill Wadge's Blog   (https://wordpress.com/?ref=footer_blog) Blog at WordPress.com.       (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/#respond)    Comment    ()    Reblog   ()   Subscribe  ()    Subscribed   (https://billwadge.com) () Bill Wadge's Blog    Join 80 other subscribers (Enter your email address)  (subscribe) (14796515) (https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/) (actionbar-follow) (92f6104f26) (Sign me up) Sign me up    Already have a WordPress.com account? (https://wordpress.com/log-in?redirect_to=https%3A%2F%2Fr-login.wordpress.com%2Fremote-login.php%3Faction%3Dlink%26back%3Dhttps%253A%252F%252Fbillwadge.com%252F2025%252F02%252F22%252Fthe-yin-and-yang-of-programming%252F) Log in now.          Privacy        (https://billwadge.com) () Bill Wadge's Blog   ()   Subscribe  ()    Subscribed   (https://wordpress.com/start/) Sign up  (https://wordpress.com/log-in?redirect_to=https%3A%2F%2Fr-login.wordpress.com%2Fremote-login.php%3Faction%3Dlink%26back%3Dhttps%253A%252F%252Fbillwadge.com%252F2025%252F02%252F22%252Fthe-yin-and-yang-of-programming%252F) Log in  (https://wp.me/p105ft-1GX) Copy shortlink       (https://wordpress.com/abuse/?report_url=https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/) Report this content   (https://wordpress.com/reader/blogs/14796515/posts/6507) View post in Reader   (https://subscribe.wordpress.com/) Manage subscriptions  () Collapse this bar         %d    ()   ()    "
                ],
                "output": "htmltotext.txt",
                "pwd": "/data/archive/1740813387.148725",
                "schema": "ArchiveResult",
                "start_ts": "2025-03-01T07:17:04.593680+00:00",
                "status": "succeeded"
            }
        ],
        "media": [
            {
                "cmd": [
                    "/usr/local/bin/yt-dlp",
                    "--restrict-filenames",
                    "--trim-filenames",
                    "128",
                    "--write-description",
                    "--write-info-json",
                    "--write-annotations",
                    "--write-thumbnail",
                    "--no-call-home",
                    "--write-sub",
                    "--write-auto-subs",
                    "--convert-subs=srt",
                    "--yes-playlist",
                    "--continue",
                    "--no-abort-on-error",
                    "--ignore-errors",
                    "--geo-bypass",
                    "--add-metadata",
                    "--format=(bv*+ba/b)[filesize<=750m][filesize_approx<=?750m]/(bv*+ba/b)",
                    "--skip-download",
                    "--cache-dir=/data/yt-dlp-cache/",
                    "--cookies=/data/yt-dlp-cache/cookies.txt",
                    "--proxy=socks5://tor-socks-proxy:9150",
                    "--no-playlist",
                    "https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/"
                ],
                "cmd_version": "2024.10.7",
                "end_ts": "2025-03-01T07:17:10.977943+00:00",
                "index_texts": [],
                "output": "media/",
                "pwd": "/data/archive/1740813387.148725",
                "schema": "ArchiveResult",
                "start_ts": "2025-03-01T07:17:06.915603+00:00",
                "status": "succeeded"
            }
        ],
        "mercury": [
            {
                "cmd": [
                    "/home/archivebox/.npm/bin/postlight-parser",
                    "https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/"
                ],
                "cmd_version": "2.2.3",
                "end_ts": "2025-03-01T07:17:04.556314+00:00",
                "index_texts": null,
                "output": "mercury/",
                "pwd": "/data/archive/1740813387.148725",
                "schema": "ArchiveResult",
                "start_ts": "2025-03-01T07:17:01.471614+00:00",
                "status": "succeeded"
            }
        ],
        "pdf": [],
        "readability": [
            {
                "cmd": [
                    "/home/archivebox/.npm/bin/readability-extractor",
                    "/tmp/tmpj0a4m_yo",
                    "https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/"
                ],
                "cmd_version": "0.0.11",
                "end_ts": "2025-03-01T07:16:53.487094+00:00",
                "index_texts": [
                    "[This is from a paper we\u2019re submitting to the International Conference on Functional Programming (ICFP 2025)][update: the paper was rejected because we included our names, violating anonymity]\n\n\n\nIntroduction\n\n\n\nRecursion and iteration are the Yin and Yang of programming. Conventional languages support both, but tend to favor the Yang \u2013 iteration. Java and C, for example, have elaborate\u00a0while\u00a0and/or\u00a0for statements but can\u2019t easily return functions as results. Python is a bit better. The Yin, we might say, is strong in that one.\u00a0\n\n\n\nEven Python, however, still limits the use of functions. It does not allow partial application and has a very restricted lambda expression. Even in Python the positive Yang is dominant.\n\n\n\nIteration, however, has its problems. Even simple\u00a0while\u00a0loops can be hard to understand (let alone verify) because the state changes not just with every step of the iteration but with each execution of each assignment statement in the body.\n\n\n\nThe problems with iteration led to the invention of the pure functional languages in which there is no iteration. In these languages everything is done with recursion, and the closest we get to iteration is tail recursion. In a language like Haskell not only is the Yin dominant, the Yang is almost completely missing.\n\n\n\nThe pure functional languages have proved remarkably successful, Haskell in particular. Yin has proved capable of practical applications. But functional programmers often confess to missing iteration. To switch metaphors, recursion is \u201cpure\u201d and iteration is \u201cimpure,\u201d but they long for impurity. Sometimes this longing is expressed in almost Freudian terms, opposing recursion, associated with Virtue, and iteration, associated with Vice. Supposedly Vice has an unhealthy attraction and tempts the poor programmer away from Virtue.\n\n\n\nCan we resolve this and satisfy this longing without plunging programmers into the depths of Vice? We believe so. Our strategy is to take a pure (dark) Yin language and add a controlled, declarative form of iteration that sheds a bit of light. The functional language is PyFL, an experimental language being developed by the authors. We extended PyFL with the declarative\u00a0while\u00a0construct that provides a little illumination in the dark. The extension process was simple and straightforward and ought to be applicable to other functional languages.\u00a0\n\n\n\n[technical sections omitted]\n\n\n\nYin and Yang Revisited\n\n\n\nWhen we introduced the Yin and Yang metaphor we thought carefully about which to identify as which. Yin and Yang are not completely symmetrical; they have different connotations. Briefly,\u00a0Yang\u00a0is positive, bright, active whereas\u00a0\u00a0Yin\u00a0is negative, dark, passive.\n\n\n\nGiven that this is a functional programming conference our first choice was make recursion\u00a0the positive\u00a0Yang; but we changed our minds. Our machines are all iterative and it takes sophisticated engineering to make them support recursion and hierarchical data structures\u00a0(e.g. nested lists).\u00a0\n\n\n\nOf course this\u00a0is\u00a0necessary because there are\u00a0plenty of applications, like parsing, that call for Yin -recursive algorithms and hierarchical data structures. But there are plenty more (e.g. numerical analysis) that naturally involve Yang \u2013 iterative algorithms and linear data structures (arrays).\n\n\n\nOne give away is the yearning\u00a0phenomenon mentioned earlier. If recursion were bright and positive, why would its proponents long for the dark and negative? But if the recursive side is dark and negative it only makes sense that recursionists would long for Yang, for the bright and positive.\n\n\n\nThe evidence is that in terms of practical applications the positive Yang is dominant \u2013\u00a0the majority of problems are best solved with iterative algorithms and linear data structures.\n\n\n\nArtificial Intelligence (AI)\u00a0is a case in point. For many decades the standard approach (Good Old Fashioned AI, or GOFAI) was heavily Yin, relying on recursive algorithms and hierarchical data structures.\u00a0The programming was done in Yin languages like\u00a0Prolog.\n\n\n\nBut GOFAI was never very successful. The translations were laughably bad and only a massive\u00a0effort produced a winning chess program. The Asian game\u00a0Go (Baduk, Wei-Chi) with its massive 19\u00d719 board completely defeated GOFAI.\n\n\n\nThen along came neural networks and machine learning. The translations are excellent and\u00a0Go was mastered in a few days. The computations are all linear algebra, arrays and iterative algorithms. Even the hardware (Nvidia chips) are iterative.\u00a0A triumph for Yang.\n\n\n\nThe obvious question is, if Yin is so dark, why the enthusiasm for purely recursive languages (as evidenced by ICFP itself)? The answer is that bright Yang \u2013 iteration \u2013 has its own dark side,\u00a0its own Yin. (Notice that in the traditional Yin/Yang image there is a white Yang spot within the dark Yin figure and vice versa. There is Yang within Yin and Yin within Yang).  The presence of (side) effects (among other things) makes the programs hard to understand, verify, or modify.\u00a0Yin, on the other hand, has its own corresponding bright\u00a0Yang\u00a0side, due mainly to the absence of side effects.\n\n\n\nHow do we escape these conflicts between Yins and Yangs? We\u2019re proposing a compromise or synthesis: a Yin language with a strong positive side augmented with a little bit of Yang, with a limited negative side.\u00a0We have shown that a little bit of Yang goes a long way.\n\n\n\n[I\u2019m adding these remarks, which are not in the paper]\n\n\n\nThese considerations shed light on the nature of the language Lucid. We used to argue that Lucid is a Yin language- a functional language \u2013 but that\u2019s not  the case. Lucid is strictly first order. My student Rondogiannis found a way to add some higher order functions and preserve the eductive implementation; but only for certain higher order types. In particular Rondogiannis\u2019 approach can\u2019t handle functions that return other functions as results.\n\n\n\nThe only conclusion to be drawn is that functions in Lucid are not first class objects and hence Lucid is not a functional language. With its emphasis on streams and indexing, it is a Yang \u2013 iterative \u2013 language.\n\n\n\nIn fact, in the development of Lucid indexing and eduction have priority. Features, such as higher order functions, that clash with eduction, are not pursued. The developers of GLU doubled down on the Yang and introduced arbitrary dimensions (and the pylucid interpreter now supports a space dimension). Lucid is a Yang language (a Yanguage?)\n\n\n\nAll this suggests that Lucid would be improved by adding a small amount of Yin, as PyFL was improved by adding a small amount of Yang. Which small amount?\n\n\n\nOne possibility is Rondogiannis\u2019 (restricted) higher order functions, although that would be ambitious and would have to involve some kind of type declaration scheme. A tiny step in this direction would be limited second order functions, that take first order function parameters. This would take care of about 95% of the use of higher order functions in numerical analysis, where function parameters are common."
                ],
                "output": "readability/",
                "pwd": "/data/archive/1740813387.148725",
                "schema": "ArchiveResult",
                "start_ts": "2025-03-01T07:16:49.658341+00:00",
                "status": "succeeded"
            }
        ],
        "screenshot": [],
        "singlefile": [],
        "title": [
            {
                "cmd": [
                    "/usr/bin/curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--proxy",
                    "socks5://tor-socks-proxy:9150",
                    "--max-time",
                    "60",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 ArchiveBox/{VERSION} (+https://github.com/ArchiveBox/ArchiveBox/)",
                    "https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/"
                ],
                "cmd_version": "8.10.1",
                "end_ts": "2025-03-01T07:16:49.096189+00:00",
                "index_texts": null,
                "output": "The Yin and Yang of Programming [2400 views] | Bill Wadge's Blog",
                "pwd": "/data/archive/1740813387.148725",
                "schema": "ArchiveResult",
                "start_ts": "2025-03-01T07:16:49.063068+00:00",
                "status": "succeeded"
            }
        ],
        "wget": []
    },
    "icons": null,
    "is_archived": true,
    "is_static": false,
    "latest": {
        "archive_org": "TimeoutExpired: Command '['/usr/bin/curl', '--silent', '--location', '--compressed', '--proxy', 'socks5://tor-socks-proxy:9150', '--head', '--max-time', '60', '--user-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 ArchiveBox/{VERSION} (+https://github.com/ArchiveBox/ArchiveBox/)', 'https://web.archive.org/save/https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/']' timed out after 60 seconds",
        "dom": "output.html",
        "favicon": "favicon.ico",
        "git": null,
        "media": "media/",
        "pdf": null,
        "screenshot": null,
        "singlefile": null,
        "title": "The Yin and Yang of Programming [2400 views] | Bill Wadge's Blog",
        "warc": null,
        "wget": null
    },
    "link_dir": "/data/archive/1740813387.148725",
    "newest_archive_date": "2025-03-01T07:17:11.032188+00:00",
    "num_failures": 1,
    "num_outputs": 8,
    "oldest_archive_date": "2025-03-01T07:16:31.710795+00:00",
    "path": "/2025/02/22/the-yin-and-yang-of-programming/",
    "schema": "Link",
    "scheme": "https",
    "snapshot_abid": "snp_01JN890HE1253AD75B01GQRB2F",
    "snapshot_id": "2494f9c1-5827-4119-a52d-b3c1a17c2c4f",
    "sources": [
        "/data/sources/1740813386-import.txt"
    ],
    "tags": null,
    "tags_str": "",
    "timestamp": "1740813387.148725",
    "title": "The Yin and Yang of Programming [2400 views] | Bill Wadge's Blog",
    "url": "https://billwadge.com/2025/02/22/the-yin-and-yang-of-programming/"
}