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. Create a new programming language?

Create a new programming language?

Scheduled Pinned Locked Moved The Lounge
game-devtutorialquestion
79 Posts 33 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.
  • B Brandon X12000

    Is there a way to create a programming language without using an existing programming language? or to create it from scratch or create it in machine/binary code or assembly code? Also some other questions that are optional that you may answer: - Is there a way for a programming language to be "all-purpose"? (for example this programming language can be used to make games, models, simple applications (like calculators) or anything and EVERYTHING you can imagine) - Is there a way for a programming language to be "self-sustained"? (for example you don't need more than one language like "Lua" to run a massive game like "World of Warcraft" or "Command and Conquer" or any of those games out there or this language does not need support of any kind to run) Any answers will be fully-appreciated. :) Regards, Brandon Proud Member of "The Code Project"

    S Offline
    S Offline
    smcnulty2000
    wrote on last edited by
    #45

    I had a lot of fun reading this book. Constructing Language Processors for Little Languages, Randy M Kaplan. I think if you want to understand the nature of why computer languages get produced you can do so by seeing what thought process goes into a specialty language. Regarding an "all purpose" language; well there's something to be said for there being a reason in specializing. You could make one that could do everything but it would probably do everything poorly. This is sort of like asking to make a vehicle that is both a racecar and a large truck for hauling dirt. It wouldn't outrace a real racecar, it wouldn't haul more dirt than a large truck. And if you could build a racecar that could haul dirt and still outrace other racecars you could probably build an even better racecar that didn't haul dirt.

    _____________________________ Give a man a mug, he drinks for a day. Teach a man to mug... The difference between an ostrich and the average voter is where they stick their heads.

    1 Reply Last reply
    0
    • L Lost User

      Anyone can right a language form the ground up. You just need the instruction set for the processor. I would not recomend it though unless you are just trying to prove you can do it. If you want to make anything useful stick with the higher level languages. I think most have said yes to the all-purpose but I would disagree. The reason being is hardware related. The industry has gone through some cycles in the last decade or so that should prove this to anyone that has doubts. Web based applications stormed the industry because of the "all-purpose" aspect. One team one mission total, one failure. Web apps are great but you just can't beat a language that is talking to your specified hardware. In normal practice yes, but when you talk about speacialized hardware the all purpose languages tend to be 10 steps behind. And even when they do make those ten steps forward, it often comes with some serious baggage. Take for example parallel programming. This has been one of the main targets for the .Net framework in the more recent releases. However, things like CUDA have been perfecting it on the GPU for a few years now. This is just one example. Any time you find spealized hardware, you will often find speacialized software that will outperform the "all-purpose" software for years to come. As for "Self-Sustained", it just so happens this is related to the second "all-purpose". By adapting in other languages it is one less component that need be targets. It goes with the logic of why re-invent the wheel? Once the API is to combersome it is time to extend the so called "all-purpose" language.

      Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

      K Offline
      K Offline
      KP Lee
      wrote on last edited by
      #46

      Collin Jasnoch wrote:

      Anyone can right a language form the ground up.

      Even fixing the spelling, I disagree with that one. This one "programmer" I knew managed to break the C compiler so badly it didn't give a hint about why it was dying. He can't even code in an established language, I find it totally unbelievable he has the chops to create a language. Or at least one that makes a little bit of sense.

      1 Reply Last reply
      0
      • M Member 8331185

        I have always wanted to see a language based on the English language but without all the grammatical bollocks so that you could program almost as easily as you would speak I.E. for every value in the statement Hello my name is john count the number of spaces this would return 4 what is the length of the statement Hello my name is john this would return 21 add 5 to the length of the statement Hello my name is john and store the result in container name this would store the value 26 in the variable called name add 36 to the container name would result in 62 being stored in the variable called name. Empty the container name. would clear out the variable called name Empty all containers would clear the contents of all variables in memory. You get the idea...... The disadvantages - its quite terse and takes a lot of typing. The advantages - any idiot can walk up to a PC and provided they can read and write in the English language they should be able to begin programming. It stops the leaning towards the txt spk shortening of the English language used by mobile phone users and might actually stem the tide a wee bit. Its completely readable and pretty much self commenting, again if you can read in the english language you can read a program. It should be relatively easy to write a compiler for due to the ease of the syntax. Your thoughts?

        K Offline
        K Offline
        KP Lee
        wrote on last edited by
        #47

        Member 8331185 wrote:

        for every value in the statement Hello my name is john count the number of spaces
        this would return 4

        This stretches the capabilities of a compiler beyond reason. If I count the number of spaces in the statement, it comes to 15. That's because I am only seeing one continuous run-on statement.

        Member 8331185 wrote:

        The disadvantages - its quite terse and takes a lot of typing.

        Actually, it's quite verbose. "get answer:Hello my name is john" is terse and also requires psychic capabilities. :) (Get me the answer I want, not the answer to the question I ask. Intuitively know I meant "it's" when I wrote "its". Come to think about it, WORD is pretty good at that now.)

        K 1 Reply Last reply
        0
        • K KP Lee

          There's also garbage collection when you are through with that instance, though it's more flushing than collection.

          S Offline
          S Offline
          Slacker007
          wrote on last edited by
          #48

          KP Lee wrote:

          There's also garbage collection when you are through with that instance, though it's more flushing than collection.

          I thought the same thing after I posted. Good catch. :)

          Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
          "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)

          K 1 Reply Last reply
          0
          • C CPallini

            Brandon-hbx12000 wrote:

            Is there a way to create a programming language without using an existing programming language? or to create it from scratch or create it in machine/binary code or assembly code?

            Yes you may do it. However it isn't, usually, a good idea.

            Brandon-hbx12000 wrote:

            - Is there a way for a programming language to be "all-purpose"?
            (for example this programming language can be used to make games, models, simple applications (like calculators) or anything and EVERYTHING you can imagine)

            You may do a general purpose language. However, you know, for any task, you need the right tool. Programming languages make no exception.

            Brandon-hbx12000 wrote:

            - Is there a way for a programming language to be "self-sustained"?
            (for example you don't need more than one language like "Lua" to run a massive game like "World of Warcraft" or "Command and Conquer" or any of those games out there or this language does not need support of any kind to run)

            Yes there is. However this isn't, again, a very good idea: scripting facilities usually enrich the application.

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            B Offline
            B Offline
            Brandon X12000
            wrote on last edited by
            #49

            Do you know any books or references about binary or machine code? or perhaps assembly code? Like lets say a book that says a line of 1's and 0's for each command(s)...

            S 1 Reply Last reply
            0
            • S Slacker007

              KP Lee wrote:

              There's also garbage collection when you are through with that instance, though it's more flushing than collection.

              I thought the same thing after I posted. Good catch. :)

              Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
              "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)

              K Offline
              K Offline
              KP Lee
              wrote on last edited by
              #50

              Slacker007 wrote:

              Good catch

              Ewww! :)

              1 Reply Last reply
              0
              • B Brandon X12000

                Is there a way to create a programming language without using an existing programming language? or to create it from scratch or create it in machine/binary code or assembly code? Also some other questions that are optional that you may answer: - Is there a way for a programming language to be "all-purpose"? (for example this programming language can be used to make games, models, simple applications (like calculators) or anything and EVERYTHING you can imagine) - Is there a way for a programming language to be "self-sustained"? (for example you don't need more than one language like "Lua" to run a massive game like "World of Warcraft" or "Command and Conquer" or any of those games out there or this language does not need support of any kind to run) Any answers will be fully-appreciated. :) Regards, Brandon Proud Member of "The Code Project"

                P Offline
                P Offline
                PhilipOakley
                wrote on last edited by
                #51

                Go FORTH and multiply. It has everything.

                1 Reply Last reply
                0
                • R Rob Grainger

                  Nagy Vilmos wrote:

                  Not many modern languages are domain specific

                  Yeah, except the one that the entire Web is built on (HTML). And the one we use to access databases (SQL), and the one's we use to script (PowerShell, BASH, ...), and ...

                  P Offline
                  P Offline
                  paul_the_kelly
                  wrote on last edited by
                  #52

                  HTML isn't a programming language. It isn't Turing complete, and thus can't be used to implement arbitrary algorithms.

                  R 1 Reply Last reply
                  0
                  • B Brandon X12000

                    Is there a way to create a programming language without using an existing programming language? or to create it from scratch or create it in machine/binary code or assembly code? Also some other questions that are optional that you may answer: - Is there a way for a programming language to be "all-purpose"? (for example this programming language can be used to make games, models, simple applications (like calculators) or anything and EVERYTHING you can imagine) - Is there a way for a programming language to be "self-sustained"? (for example you don't need more than one language like "Lua" to run a massive game like "World of Warcraft" or "Command and Conquer" or any of those games out there or this language does not need support of any kind to run) Any answers will be fully-appreciated. :) Regards, Brandon Proud Member of "The Code Project"

                    K Offline
                    K Offline
                    Kerrash
                    wrote on last edited by
                    #53

                    Yes. Pen an paper like Ada Lovelace had to. Assuming you don't want to get all meta-physical and disregard the syntax of the langauage you are writing it in and math as the langauge of the universe...

                    1 Reply Last reply
                    0
                    • K KP Lee

                      Member 8331185 wrote:

                      for every value in the statement Hello my name is john count the number of spaces
                      this would return 4

                      This stretches the capabilities of a compiler beyond reason. If I count the number of spaces in the statement, it comes to 15. That's because I am only seeing one continuous run-on statement.

                      Member 8331185 wrote:

                      The disadvantages - its quite terse and takes a lot of typing.

                      Actually, it's quite verbose. "get answer:Hello my name is john" is terse and also requires psychic capabilities. :) (Get me the answer I want, not the answer to the question I ask. Intuitively know I meant "it's" when I wrote "its". Come to think about it, WORD is pretty good at that now.)

                      K Offline
                      K Offline
                      Kerrash
                      wrote on last edited by
                      #54

                      Ambiguity of identifiers would be a big concern for me. How would the system know what you meant by a container? Or where a statement started or ended without punctuation?

                      K 1 Reply Last reply
                      0
                      • B Brandon X12000

                        Is there a way to create a programming language without using an existing programming language? or to create it from scratch or create it in machine/binary code or assembly code? Also some other questions that are optional that you may answer: - Is there a way for a programming language to be "all-purpose"? (for example this programming language can be used to make games, models, simple applications (like calculators) or anything and EVERYTHING you can imagine) - Is there a way for a programming language to be "self-sustained"? (for example you don't need more than one language like "Lua" to run a massive game like "World of Warcraft" or "Command and Conquer" or any of those games out there or this language does not need support of any kind to run) Any answers will be fully-appreciated. :) Regards, Brandon Proud Member of "The Code Project"

                        V Offline
                        V Offline
                        vl2
                        wrote on last edited by
                        #55

                        There is a relatively short and cheap bootstrapping chain: 1) Implement the simplest Forth on top of machine codes. With a bit of experience it can be done in several days. 2) On top of this Forth, implement a simple Lisp interpeter 3) Using the Lisp interpreter, implement Lisp compiler and re-bootstrap it 4) Grow this Lisp using macros to the stage when it is easy to implement any kind of compilers. This will include building parser generators (e.g., something similar to Parsec), tree visitor generator (in line with Haskell library "Scrap your boilerplate"), number of graph algorithms (e.g., dominator tree building, etc.) 5) Implement an intermediate VM using that Lisp, something similar to LLVM (i.e., SSA-based), implement a native backend for this VM. 6) Implement any language you like on top of that VM All the steps are relatively trivial and well-defined, and there is a lot of papers and books that will help on each stage.

                        1 Reply Last reply
                        0
                        • B Brandon X12000

                          Do you know any books or references about binary or machine code? or perhaps assembly code? Like lets say a book that says a line of 1's and 0's for each command(s)...

                          S Offline
                          S Offline
                          Stefan_Lang
                          wrote on last edited by
                          #56

                          What language would you like that book in - would binary suit you? ;) But seriously: machine code is, as the name implies, machine dependend. Or, more to the point, dependent on the CPU. AMD and Intel have different machine code, as does the PowerPC line, or the various risk processors. New multicore processors have commands that none of the older have, simply because they don't have multiple cores. Basically, every CPU that comes with a new feature, comes with a new machine command, or several of them. So, if you have a specific CPU in mind, like that in your own computer, find out it's precise name, and look for books or articles on that CPU. I think I still somewhere have an MC 68000 Assembler book for the like-named processor, back from the time when I owned an AMIGA. ;)

                          B 1 Reply Last reply
                          0
                          • B Brandon X12000

                            Is there a way to create a programming language without using an existing programming language? or to create it from scratch or create it in machine/binary code or assembly code? Also some other questions that are optional that you may answer: - Is there a way for a programming language to be "all-purpose"? (for example this programming language can be used to make games, models, simple applications (like calculators) or anything and EVERYTHING you can imagine) - Is there a way for a programming language to be "self-sustained"? (for example you don't need more than one language like "Lua" to run a massive game like "World of Warcraft" or "Command and Conquer" or any of those games out there or this language does not need support of any kind to run) Any answers will be fully-appreciated. :) Regards, Brandon Proud Member of "The Code Project"

                            D Offline
                            D Offline
                            Daniel Lo Nigro
                            wrote on last edited by
                            #57

                            A guy on a forum I frequently browse is building his own programming language mainly for web development as an experiment. It doesn't fit your "without using an existing programming language" criteria (as it is written in Java and will run on top of the Java Virtual Machine), but still an interesting topic. http://webdevrefinery.com/forums/topic/9856-tangle/

                            1 Reply Last reply
                            0
                            • M Member 8331185

                              I have always wanted to see a language based on the English language but without all the grammatical bollocks so that you could program almost as easily as you would speak I.E. for every value in the statement Hello my name is john count the number of spaces this would return 4 what is the length of the statement Hello my name is john this would return 21 add 5 to the length of the statement Hello my name is john and store the result in container name this would store the value 26 in the variable called name add 36 to the container name would result in 62 being stored in the variable called name. Empty the container name. would clear out the variable called name Empty all containers would clear the contents of all variables in memory. You get the idea...... The disadvantages - its quite terse and takes a lot of typing. The advantages - any idiot can walk up to a PC and provided they can read and write in the English language they should be able to begin programming. It stops the leaning towards the txt spk shortening of the English language used by mobile phone users and might actually stem the tide a wee bit. Its completely readable and pretty much self commenting, again if you can read in the english language you can read a program. It should be relatively easy to write a compiler for due to the ease of the syntax. Your thoughts?

                              S Offline
                              S Offline
                              Stefan_Lang
                              wrote on last edited by
                              #58

                              Member 8331185 wrote:

                              for every value in the statement Hello my name is john count the number of spaces

                              The problem with such a statement is that a parser would need to distinguish between specific commands and properties such as 'for every', 'count' or 'spaces' and the data that is to be processed, i. e. 'Hello my name is john'. If you made that data part slightly different, such as 'that I do not name here', it would become impossible to resolve. At the very least you must somehow mark the data part. Also you have to be very careful about what constitutes a key phrase that describes the operation. In the above example 'for every' seems an appropriate key phrase, but you could also phrase something like: Every time I press the key down button, move the cursor one line down. Here, 'every time' is a key phrase, making 'every' by itself ambiguous. So when we parse a phrase, we cannot just investigate each word individually, we must also watch for specific phrases of words that subtly changes the meaning. It's doable, but it's incredibly complex. Google for 'Siri' to find an advanced system that might be able to tackle such problems.

                              Member 8331185 wrote:

                              any idiot can walk up to a PC and provided they can read and write in the English language they should be able to begin programming

                              Looking at forums I have some serious doubts about the ability of 'some idiot' to write proper english. Hell, often *I* have trouble understanding what they are saying...

                              K 1 Reply Last reply
                              0
                              • S Stefan_Lang

                                What language would you like that book in - would binary suit you? ;) But seriously: machine code is, as the name implies, machine dependend. Or, more to the point, dependent on the CPU. AMD and Intel have different machine code, as does the PowerPC line, or the various risk processors. New multicore processors have commands that none of the older have, simply because they don't have multiple cores. Basically, every CPU that comes with a new feature, comes with a new machine command, or several of them. So, if you have a specific CPU in mind, like that in your own computer, find out it's precise name, and look for books or articles on that CPU. I think I still somewhere have an MC 68000 Assembler book for the like-named processor, back from the time when I owned an AMIGA. ;)

                                B Offline
                                B Offline
                                Brandon X12000
                                wrote on last edited by
                                #59

                                Yes, binary would best suit me, I'm desperately interested in it as you can see. My computer at home using an Intel quadcore processor, but I do not know what it is exactly or "precisely" called.

                                C 1 Reply Last reply
                                0
                                • R Rob Grainger

                                  PIEBALDconsult wrote:

                                  Only within certain limits. Make it do what you need it to do and then add features as needed or requested

                                  I disagree - the most successful general purpose programming languages have a minimal set of features but allow libraries to extend the language to a degree. C, Smalltalk and LISP spring to mind.

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

                                  I was thinking more along the lines of the features added to C# like generics and Linq, or adding OOP to Pascal.

                                  R 1 Reply Last reply
                                  0
                                  • A AspDotNetDev

                                    Brandon-hbx12000 wrote:

                                    Is there a way to create a programming language without using an existing programming language?

                                    No, because God gave us the first programming language, and he saw that it was good...

                                    Somebody in an online forum wrote:

                                    INTJs never really joke. They make a point. The joke is just a gift wrapper.

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

                                    It's all in how you bang the rocks together, guys.

                                    1 Reply Last reply
                                    0
                                    • B Brandon X12000

                                      Yes, binary would best suit me, I'm desperately interested in it as you can see. My computer at home using an Intel quadcore processor, but I do not know what it is exactly or "precisely" called.

                                      C Offline
                                      C Offline
                                      CPallini
                                      wrote on last edited by
                                      #62

                                      Windows give more info about your processor (for instance on Windows 7, you may open the Control Panel->System). Anyway Intel processors are AFAIK backward compatible so you may start with a machine code written for an older CPU.

                                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                      [My articles]

                                      B 1 Reply Last reply
                                      0
                                      • P Pete OHanlon

                                        Don't worry about it. The regulars think this one's fine.

                                        Forgive your enemies - it messes with their heads

                                        "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                                        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                                        F Offline
                                        F Offline
                                        Fabio Franco
                                        wrote on last edited by
                                        #63

                                        Right with ya!

                                        "To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson

                                        1 Reply Last reply
                                        0
                                        • R R Giskard Reventlov

                                          1: DON'T ask programming questions. 2: We don't do homework. 3: see 1.

                                          "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

                                          F Offline
                                          F Offline
                                          Fabio Franco
                                          wrote on last edited by
                                          #64

                                          1: It's not a programming question. 2: We do courtesy 3: Join us

                                          "To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson

                                          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