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. The Lounge
  3. Building a new proper left-to-right executing programming language

Building a new proper left-to-right executing programming language

Scheduled Pinned Locked Moved The Lounge
question
43 Posts 23 Posters 3 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.
  • D den2k88

    Member 7989122 wrote:

    Top-Down design has been accepted in systems design

    Did that happen on the same day a single religion has been accepted, a single government form has been decided and a single indentation pattern was agreed upon for the whole world?

    GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

    K Offline
    K Offline
    kalberts
    wrote on last edited by
    #16

    :-) Maybe I should have been more precise: It is accepted as one of several options in systems design. Not everyone is following the "agile" apporach to extremes, the one where you do, like: "Oh, so you have a problem? Let's start with 'int main(int argc, char** argv) { return 0;}'. There! Now we are going at it. So what is your problem?" I know that "waterfall" is one of the baddest swear words you can use in today's software development world. But when you go through our company's process description from a customer requirement spec to the product delivery, it looks awfully close to a waterfall. Each individual step is managed according to agile principles (this is stressed a lot internally), and if I had made even slight side remarks about the process having strong resemblande to the waterfall model, I would have been fired the same day. So I don't. I believe this is far more common than up-to-date programmers want to know of. They want to enforce a pure agile strategy at their step of the waterfall, believing that that is everything there is. But in a large, established product oriented company that still maintenance on products developed ten years ago, and considers what the market will want five years into the future, you very easily end up with something very much like a waterfall. We just call it by different names, and avoid the swear words.

    1 Reply Last reply
    0
    • L Lost User

      musefan wrote:

      I'm confused... what does this mean? How is a number (decimal or otherwise) specifically Arabic? (and therefore specifically RtL)

      Our numbering system (and the number 0) are arabic inventions. Romans use a different system, and do not have a sign for nothing. Doesn't make the number itself an Arabic thing, only our current defacto way of encoding these.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

      K Offline
      K Offline
      kalberts
      wrote on last edited by
      #17

      It is interesting to notice that numbers are written the same way in LtR and RtL languages, with the most significant digit to the left. Also notice that in a number of languages, including old English, it was common to read (and write as words) e.g. four-and-twenty, as if read RtL, rather than twentyfour. In German, you still read numbers RtL, at least up to one hundred. Norwegian was similar until a reform in the 1950s. (If you try to bake twentyfour blackbirds in a pie, the rythm will be screwed up...)

      1 Reply Last reply
      0
      • N Nikunj_Bhatt

        The numbers that we are using is the decimal numbers a.k.a. Arabic numerals. Here is the history of the numbers: Arabic numerals - Wikipedia[^]. The decimal numbers are called Arabic numbers because they were invented by Arabs (however Zero was invented in India, it is also part of Arabic numbers). So,

        1 + 2 = 3

        is a correct way in LtR while

        3 = 1 + 2

        is correct way according to RtL (Arabic, Hebew, etc. RtL languages, however this is now not used because of international Mathematics influence.)

        M Offline
        M Offline
        musefan
        wrote on last edited by
        #18

        Just because they may have originated in another language does not mean they are still that language. It depends on the context used. Otherwise you could easily argue a lot of English is not actually English because it originated in another language... it doesn't matter where it came from it's only how it's used that matters. If your argument is that Maths is it's own language, then it can also defined it's own read order (i.e. LtR), it doesn't matter where the numbers original came from and how they were originally read. My point is, there is no reason to why they have to be read RtL just because they are decimal numbers.

        N 1 Reply Last reply
        0
        • L Lost User

          musefan wrote:

          I'm confused... what does this mean? How is a number (decimal or otherwise) specifically Arabic? (and therefore specifically RtL)

          Our numbering system (and the number 0) are arabic inventions. Romans use a different system, and do not have a sign for nothing. Doesn't make the number itself an Arabic thing, only our current defacto way of encoding these.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

          M Offline
          M Offline
          musefan
          wrote on last edited by
          #19

          Oh I get that, my confusion is how does that decide how we should use the symbols. Maths is the language, and Maths decides how the language should be read. Not the language where some of the symbols originated.

          L 1 Reply Last reply
          0
          • N Nikunj_Bhatt

            Most of spoken languages are written LtR (Left-to-Right) but Maths, the number language, is actually written RtL because the decimal numbers are Arabic numerals. (I know, most will get surprised, but it's true about Maths RtL direction.) But somehow the RtL and LtR languages got mixed up. Instead of writing

            x = a + 12

            how about changing it to

            a + 12 = x

            So, what are your views on creating a new programming language which follows proper LtR execution? Is there already such language? (Please, just don't remind me that there are already lots of programming languages (I know already) and I must not (try to) create one more. :) )

            D Offline
            D Offline
            dandy72
            wrote on last edited by
            #20

            Nikunj_Bhatt wrote:

            So, what are your views on creating a new programming language which follows proper LtR execution?

            What "problem" would that solve? Yeah, I didn't think so. There's plenty of languages to know already, I don't think anybody wants another one that only "fixes" this.

            N 1 Reply Last reply
            0
            • M musefan

              Oh I get that, my confusion is how does that decide how we should use the symbols. Maths is the language, and Maths decides how the language should be read. Not the language where some of the symbols originated.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #21

              We had maths before we had symbols for numbers. Then, we found that the Roman system has its limitations in doing math. So we switched.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

              1 Reply Last reply
              0
              • N NeverJustHere

                It depends on who you are trying to communicate with. A computer or a programmer. From a computers perspective, if you want to model the execution steps, there is already a better language for this representation, reverse polish notation. (a 12 +) From a programmers perspective, you want the code to be easy to read and I don't see how your proposal assists this. - When reading code the variable being set is the most important. - If I'm trying to understand code, I'll want to understand where a var is set, this is easier to do by scanning a block where the variables are aligned. It is easier for my eyes to find the line x=..... rather than .....= x. - Following the logic of the algorithm would involve understanding where variables are mutated as much as what they are set to. - For complex expressions, I'll probably only read and understand them once, while I'll explore the looping logic and structure of the flow of the code more. 60 years ago, there was an economic value in a programmer spending significant time making things easier for the computer. Now, the value is in making things easier for the programmer, even if significantly more complex for the computer. I've always wanted languages to adopt a true assignment operator x <- a + 12. But it would need to be a single character and exist as an easily usable key on my keyboard. Interestingly, Visual Studio allows unicode variable names, so I've written software using genuine alpha and beta glyphs.

                G Offline
                G Offline
                Gary Wheeler
                wrote on last edited by
                #22

                NeverJustHere wrote:

                I've written software using genuine alpha and beta glyphs

                Heaven help you if you ever look at the source code on a machine where the system locale is not set to English. I had a case the other day where a Greek mu (µ) character in the UI was showing up as a kanji character. English version of Windows, check. User language set to English, check. English keyboard selected, check. ... Wait a second. Who set the bloody-be-damned system locale to Simplified Chinese? At some point the box had been restored to the original image, and this was during a brief period when our out-sourced assembly folks were setting all of our boxes to Simplified Chinese. Grrr... :mad:

                Software Zen: delete this;

                1 Reply Last reply
                0
                • N Nikunj_Bhatt

                  Most of spoken languages are written LtR (Left-to-Right) but Maths, the number language, is actually written RtL because the decimal numbers are Arabic numerals. (I know, most will get surprised, but it's true about Maths RtL direction.) But somehow the RtL and LtR languages got mixed up. Instead of writing

                  x = a + 12

                  how about changing it to

                  a + 12 = x

                  So, what are your views on creating a new programming language which follows proper LtR execution? Is there already such language? (Please, just don't remind me that there are already lots of programming languages (I know already) and I must not (try to) create one more. :) )

                  M Offline
                  M Offline
                  Mark_Wallace
                  wrote on last edited by
                  #23

                  Hold on. Are we talking about computer programming languages, or people programming languages? Because computers don't even know what right and left are, so they don't care. If you're really desperate to fix this problem-that-ain't-even-remotely-a-problem, then use a modular approach, where which "direction" the flow goes depends on the structure of the source data and whatever overloading you have set up.

                  I wanna be a eunuchs developer! Pass me a bread knife!

                  N 1 Reply Last reply
                  0
                  • L Lost User

                    In Arabic the numbers are written left to right.

                    N Offline
                    N Offline
                    Nikunj_Bhatt
                    wrote on last edited by
                    #24

                    I am not sure but the direction could have changed in last 100-400 years because of the influence of the western culture.

                    1 Reply Last reply
                    0
                    • M musefan

                      Just because they may have originated in another language does not mean they are still that language. It depends on the context used. Otherwise you could easily argue a lot of English is not actually English because it originated in another language... it doesn't matter where it came from it's only how it's used that matters. If your argument is that Maths is it's own language, then it can also defined it's own read order (i.e. LtR), it doesn't matter where the numbers original came from and how they were originally read. My point is, there is no reason to why they have to be read RtL just because they are decimal numbers.

                      N Offline
                      N Offline
                      Nikunj_Bhatt
                      wrote on last edited by
                      #25

                      musefan wrote:

                      If your argument is that Maths is it's own language, then it can also defined it's own read order (i.e. LtR), it doesn't matter where the numbers original came from and how they were originally read.

                      My concern is about programming, not about Maths. So, Maths can have its own read-write direction but in programming we can define what is logical - because programming is all about logic, isn't it?

                      1 Reply Last reply
                      0
                      • D dandy72

                        Nikunj_Bhatt wrote:

                        So, what are your views on creating a new programming language which follows proper LtR execution?

                        What "problem" would that solve? Yeah, I didn't think so. There's plenty of languages to know already, I don't think anybody wants another one that only "fixes" this.

                        N Offline
                        N Offline
                        Nikunj_Bhatt
                        wrote on last edited by
                        #26

                        It may not solve any problem. I presented my thought from logical view as programming is all about logic. I have already wrote that I know that there are already plenty of programming languages; I am not actually going to create any language. :)

                        1 Reply Last reply
                        0
                        • M Mark_Wallace

                          Hold on. Are we talking about computer programming languages, or people programming languages? Because computers don't even know what right and left are, so they don't care. If you're really desperate to fix this problem-that-ain't-even-remotely-a-problem, then use a modular approach, where which "direction" the flow goes depends on the structure of the source data and whatever overloading you have set up.

                          I wanna be a eunuchs developer! Pass me a bread knife!

                          N Offline
                          N Offline
                          Nikunj_Bhatt
                          wrote on last edited by
                          #27

                          I am talking about computer programming language having more logical syntax while remaining fairly easy to understand for programmers.

                          1 Reply Last reply
                          0
                          • N NeverJustHere

                            It depends on who you are trying to communicate with. A computer or a programmer. From a computers perspective, if you want to model the execution steps, there is already a better language for this representation, reverse polish notation. (a 12 +) From a programmers perspective, you want the code to be easy to read and I don't see how your proposal assists this. - When reading code the variable being set is the most important. - If I'm trying to understand code, I'll want to understand where a var is set, this is easier to do by scanning a block where the variables are aligned. It is easier for my eyes to find the line x=..... rather than .....= x. - Following the logic of the algorithm would involve understanding where variables are mutated as much as what they are set to. - For complex expressions, I'll probably only read and understand them once, while I'll explore the looping logic and structure of the flow of the code more. 60 years ago, there was an economic value in a programmer spending significant time making things easier for the computer. Now, the value is in making things easier for the programmer, even if significantly more complex for the computer. I've always wanted languages to adopt a true assignment operator x <- a + 12. But it would need to be a single character and exist as an easily usable key on my keyboard. Interestingly, Visual Studio allows unicode variable names, so I've written software using genuine alpha and beta glyphs.

                            U Offline
                            U Offline
                            User 13269747
                            wrote on last edited by
                            #28

                            Quote:

                            there is already a better language for this representation, reverse polish notation. (a 12 +)

                            You were so close! Use prefix notation instead

                            (+ a 12)

                            and then you already have a powerful language with modern language features. Postfix notation

                            (a 12 +)

                            gives you Forth, with little expressive power. Prefix notation

                            (+ a 12)

                            gives you Lisp, with all currently known language features.

                            1 Reply Last reply
                            0
                            • N Nikunj_Bhatt

                              Most of spoken languages are written LtR (Left-to-Right) but Maths, the number language, is actually written RtL because the decimal numbers are Arabic numerals. (I know, most will get surprised, but it's true about Maths RtL direction.) But somehow the RtL and LtR languages got mixed up. Instead of writing

                              x = a + 12

                              how about changing it to

                              a + 12 = x

                              So, what are your views on creating a new programming language which follows proper LtR execution? Is there already such language? (Please, just don't remind me that there are already lots of programming languages (I know already) and I must not (try to) create one more. :) )

                              M Offline
                              M Offline
                              Member 9167057
                              wrote on last edited by
                              #29

                              Natural and formal languages (math being one of the latter, programming languages are another example) have different use cases. As hard as it is to create an exact statement in, I dare to say, every single natural language (although some are better for this task than others), as easy it is in the formalized language of math or programming (I dare to say that C++'s convoluted syntax is an exception here). My point is that applying a set of rules not developed for formality to something that has to be formal may not yield the best results.

                              1 Reply Last reply
                              0
                              • R Rick York

                                If you really want to program in RPN there is Forth. In my brief encounter with it I deemed it a write-only language. At least, there was Forth. I have not heard much of it many years.

                                "They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"

                                S Offline
                                S Offline
                                sasadler
                                wrote on last edited by
                                #30

                                Forth is still out there. It's still being used as an intermediate language at a place I worked for years ago. We (actually I) decided to write a multitasking subroutine threaded Forth for our industrial controllers. On the PC we developed an IDE where the programmer would just develop flow charts. Each flow chart would become a task on the industrial controller. The flow charts were then compiled to Forth by the IDE and would then be downloaded to the controller which would compiled it to machine code.

                                R 1 Reply Last reply
                                0
                                • N Nikunj_Bhatt

                                  Most of spoken languages are written LtR (Left-to-Right) but Maths, the number language, is actually written RtL because the decimal numbers are Arabic numerals. (I know, most will get surprised, but it's true about Maths RtL direction.) But somehow the RtL and LtR languages got mixed up. Instead of writing

                                  x = a + 12

                                  how about changing it to

                                  a + 12 = x

                                  So, what are your views on creating a new programming language which follows proper LtR execution? Is there already such language? (Please, just don't remind me that there are already lots of programming languages (I know already) and I must not (try to) create one more. :) )

                                  M Offline
                                  M Offline
                                  mischasan
                                  wrote on last edited by
                                  #31

                                  Or use a good one, already invented. POP-2 - Wikipedia[^] With lambdas, managed mem, closures (full and partial), user-defined operators, user-defined setter functions, functions with multiple results, incremental compiler ... And with alternative ltr syntaxes: `f(a,b) ->x ->y` or `a; b.f() ->x ->y`

                                  N 1 Reply Last reply
                                  0
                                  • S sasadler

                                    Forth is still out there. It's still being used as an intermediate language at a place I worked for years ago. We (actually I) decided to write a multitasking subroutine threaded Forth for our industrial controllers. On the PC we developed an IDE where the programmer would just develop flow charts. Each flow chart would become a task on the industrial controller. The flow charts were then compiled to Forth by the IDE and would then be downloaded to the controller which would compiled it to machine code.

                                    R Offline
                                    R Offline
                                    Rick York
                                    wrote on last edited by
                                    #32

                                    That sounds interesting. Other than it uses Forth. :cool: That last thing I read about Forth was many years ago. It was about the development of the SPARC processor and Sun workstations. They embedded Forth in its ROMs and wrote the boot loader in it. As I recall, it came up and ran on the first attempt.

                                    "They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"

                                    S 1 Reply Last reply
                                    0
                                    • N Nikunj_Bhatt

                                      Most of spoken languages are written LtR (Left-to-Right) but Maths, the number language, is actually written RtL because the decimal numbers are Arabic numerals. (I know, most will get surprised, but it's true about Maths RtL direction.) But somehow the RtL and LtR languages got mixed up. Instead of writing

                                      x = a + 12

                                      how about changing it to

                                      a + 12 = x

                                      So, what are your views on creating a new programming language which follows proper LtR execution? Is there already such language? (Please, just don't remind me that there are already lots of programming languages (I know already) and I must not (try to) create one more. :) )

                                      E Offline
                                      E Offline
                                      englebart
                                      wrote on last edited by
                                      #33

                                      You can already read this right to left. "=" is read as "is assigned to" not "equals". duh!

                                      x = a + 12

                                      Could be read as

                                      12 added to a is assigned to x

                                      Or left to right:

                                      x is assigned a added to 12

                                      Is your language going to support order of operations that follow neither direction?

                                      N 1 Reply Last reply
                                      0
                                      • N Nikunj_Bhatt

                                        Most of spoken languages are written LtR (Left-to-Right) but Maths, the number language, is actually written RtL because the decimal numbers are Arabic numerals. (I know, most will get surprised, but it's true about Maths RtL direction.) But somehow the RtL and LtR languages got mixed up. Instead of writing

                                        x = a + 12

                                        how about changing it to

                                        a + 12 = x

                                        So, what are your views on creating a new programming language which follows proper LtR execution? Is there already such language? (Please, just don't remind me that there are already lots of programming languages (I know already) and I must not (try to) create one more. :) )

                                        M Offline
                                        M Offline
                                        Member_5893260
                                        wrote on last edited by
                                        #34

                                        Forth (programming language) - Wikipedia[^] It never fails to amuse me how the young ones forget their history, if, indeed, they bother to learn it in the first place. Oh - and it's

                                        x @ 12 + x !

                                        1 Reply Last reply
                                        0
                                        • R Rick York

                                          That sounds interesting. Other than it uses Forth. :cool: That last thing I read about Forth was many years ago. It was about the development of the SPARC processor and Sun workstations. They embedded Forth in its ROMs and wrote the boot loader in it. As I recall, it came up and ran on the first attempt.

                                          "They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"

                                          S Offline
                                          S Offline
                                          sasadler
                                          wrote on last edited by
                                          #35

                                          I liked Forth a lot, but then I grew up on assembly language. The whole TIL (threaded interpreted language) scheme is extremely simple and is easily ported to different processors. One of the main problems with Forth is that the programmer is assumed to be an expert. There's pretty much no hand holding. Forth Inc. is still in business too (www.forth.com).

                                          R 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