Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Insider News
  4. A Language Without Conditionals

A Language Without Conditionals

Scheduled Pinned Locked Moved The Insider News
comtutorialquestion
10 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Terrence Dorsey
    wrote on last edited by
    #1

    polymatheia[^]:

    The more I play around with Swearjure (I've now been able to create a fully working quicksort), the more I appreciate certain kinds of programming constructs we today take for granted. However, I also realize that most of what we would believe is essential for ANY programming language to be turing complete may not be needed if we take another set of programming constructs instead. Take conditionals as an example of what something people consider to be critical to make a working programming language, yet really isn't if we introduce another programming construct.

    What does programming look like if we do away with conditional branching?

    M P P G P 5 Replies Last reply
    0
    • T Terrence Dorsey

      polymatheia[^]:

      The more I play around with Swearjure (I've now been able to create a fully working quicksort), the more I appreciate certain kinds of programming constructs we today take for granted. However, I also realize that most of what we would believe is essential for ANY programming language to be turing complete may not be needed if we take another set of programming constructs instead. Take conditionals as an example of what something people consider to be critical to make a working programming language, yet really isn't if we introduce another programming construct.

      What does programming look like if we do away with conditional branching?

      M Offline
      M Offline
      Marc Clifton
      wrote on last edited by
      #2

      Terrence Dorsey wrote:

      What does programming look like if we do away with conditional branching?

      I loathe if-then-else statements. Marc

      Latest Article: Intertexti - Resurrecting Apple's HyperCard
      My Blog

      1 Reply Last reply
      0
      • T Terrence Dorsey

        polymatheia[^]:

        The more I play around with Swearjure (I've now been able to create a fully working quicksort), the more I appreciate certain kinds of programming constructs we today take for granted. However, I also realize that most of what we would believe is essential for ANY programming language to be turing complete may not be needed if we take another set of programming constructs instead. Take conditionals as an example of what something people consider to be critical to make a working programming language, yet really isn't if we introduce another programming construct.

        What does programming look like if we do away with conditional branching?

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        If he can implement a Turing Machine that way then it is Turing Complete. Personally, I don't care much for recursion -- Fibonacci and Factorials are particularly poor targets for recursion.

        R 1 Reply Last reply
        0
        • T Terrence Dorsey

          polymatheia[^]:

          The more I play around with Swearjure (I've now been able to create a fully working quicksort), the more I appreciate certain kinds of programming constructs we today take for granted. However, I also realize that most of what we would believe is essential for ANY programming language to be turing complete may not be needed if we take another set of programming constructs instead. Take conditionals as an example of what something people consider to be critical to make a working programming language, yet really isn't if we introduce another programming construct.

          What does programming look like if we do away with conditional branching?

          P Offline
          P Offline
          peterchen
          wrote on last edited by
          #4

          I find hiding the branch in the expression res[n<2] to be kinda cheating. [`ORDER BY` what user wants](http://www.codeproject.com/Articles/453077/Generating-Keys-for-a-Custom-Sort-Order)

          1 Reply Last reply
          0
          • T Terrence Dorsey

            polymatheia[^]:

            The more I play around with Swearjure (I've now been able to create a fully working quicksort), the more I appreciate certain kinds of programming constructs we today take for granted. However, I also realize that most of what we would believe is essential for ANY programming language to be turing complete may not be needed if we take another set of programming constructs instead. Take conditionals as an example of what something people consider to be critical to make a working programming language, yet really isn't if we introduce another programming construct.

            What does programming look like if we do away with conditional branching?

            G Offline
            G Offline
            Guirec
            wrote on last edited by
            #5

            It looks like a pain in ***whatever really hurts here***

            Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^]

            1 Reply Last reply
            0
            • T Terrence Dorsey

              polymatheia[^]:

              The more I play around with Swearjure (I've now been able to create a fully working quicksort), the more I appreciate certain kinds of programming constructs we today take for granted. However, I also realize that most of what we would believe is essential for ANY programming language to be turing complete may not be needed if we take another set of programming constructs instead. Take conditionals as an example of what something people consider to be critical to make a working programming language, yet really isn't if we introduce another programming construct.

              What does programming look like if we do away with conditional branching?

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              This isn't a new idea. I first came across this type of programming back in the 90s when we had to integrate one of our systems into a language called ObjectStar (formerly Huron). I remember the O* devs as being real zealots - they worked for a company called Amdahl that was heavily involved in pushing it.

              I was brought up to respect my elders. I don't respect many people nowadays.
              CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

              G 1 Reply Last reply
              0
              • P PIEBALDconsult

                If he can implement a Turing Machine that way then it is Turing Complete. Personally, I don't care much for recursion -- Fibonacci and Factorials are particularly poor targets for recursion.

                R Offline
                R Offline
                Rob Grainger
                wrote on last edited by
                #7

                PIEBALDconsult wrote:

                Fibonacci and Factorials are particularly poor targets for recursion

                That depends a lot on your language. In Haskell, for example, which employs lazy evaluation, they work just fine. In a procedural language, factorials only really work well in the presence of tail call optimization, and fibs not at all, without some form of Memoization[^] going on.

                1 Reply Last reply
                0
                • P Pete OHanlon

                  This isn't a new idea. I first came across this type of programming back in the 90s when we had to integrate one of our systems into a language called ObjectStar (formerly Huron). I remember the O* devs as being real zealots - they worked for a company called Amdahl that was heavily involved in pushing it.

                  I was brought up to respect my elders. I don't respect many people nowadays.
                  CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                  G Offline
                  G Offline
                  Glenn_Y
                  wrote on last edited by
                  #8

                  Objectstar did have conditionals, it just wasn't with if-then-else, do while, etc. You put in an evaluation and if it was true or false executed certain lines of code. It took a while to wrap your head around but was pretty simple once you had the "a-ha" moment.

                  P 1 Reply Last reply
                  0
                  • G Glenn_Y

                    Objectstar did have conditionals, it just wasn't with if-then-else, do while, etc. You put in an evaluation and if it was true or false executed certain lines of code. It took a while to wrap your head around but was pretty simple once you had the "a-ha" moment.

                    P Offline
                    P Offline
                    Pete OHanlon
                    wrote on last edited by
                    #9

                    Ahh. That wasn't what the Amdahl devs were telling us. They tried to keep it all mysterious and mystical. We had a visit from a guy called something like Dara Yuvari (who'd invented the language IIRC), and you'd have thought it was the second coming of the messiah.

                    I was brought up to respect my elders. I don't respect many people nowadays.
                    CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                    G 1 Reply Last reply
                    0
                    • P Pete OHanlon

                      Ahh. That wasn't what the Amdahl devs were telling us. They tried to keep it all mysterious and mystical. We had a visit from a guy called something like Dara Yuvari (who'd invented the language IIRC), and you'd have thought it was the second coming of the messiah.

                      I was brought up to respect my elders. I don't respect many people nowadays.
                      CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                      G Offline
                      G Offline
                      Glenn_Y
                      wrote on last edited by
                      #10

                      No, no second coming. I did 6 years of O* programming with a VB front end. I liked it and they had plenty of great ideas but it was a closed system. Objectstar was the DB, the programming language and the problem reporting system all rolled into one. It allowed you to rewrite ANY of the programming language as well, gave you the option to fix anything. The programming environment was done in a 3270 terminal emulator so the coding window was small. if I remember correctly you were limited to 5 conditions, 40 lines of code and upon saveing the code you were obliged to add a comment to explain what it did. Looked something like this.

                      variable1 > 3 | Y N
                      variable2 > 5 | Y Y N

                      some code to execute | 1 1
                      more code to exectue | 2
                      still more code... | 2
                      still more code... | 1
                      call another chunk of code| 3 3 3

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups