Python Written in C?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • castironpi

    #31
    Re: Python Written in C?

    On Jul 20, 11:59 pm, Michael Torrie <torr...@gmail. comwrote:
    giveitawhril2.. .@gmail.com wrote:
    I'm not dissing Python, here. Just noting that, if it is written in C,
    that throws a curve at me in trying to balance the value of learning
    Python vs. some other major language.
    >
    Definitely one of the most non-sequitor statements I have ever heard.
    Actually your entire post doesn't make much sense.  Maybe you are a
    brother bot to castropini?  Perhaps a less-trained one, although none of
    castropini's posts seem to make sense either.  The AI needs a bit of work.
    Are you saying Python is not good for writing A.I., or the A.I. isn't
    good at writing Python?

    Comment

    • =?ISO-8859-1?Q?Luis_M=2E_Gonz=E1lez?=

      #32
      Re: Python Written in C?

      Let's say you want to build a house...
      You can use pre-built bricks and stack them together to build your
      walls, or you can cook your own bricks out of clay because hey! clay
      is the real thing.... not those ready-made bricks that anyone can use!
      In the end, you'll have a truly original house but you would have
      spent 5 years instead of 6 months.

      The question is: Is it worth it?

      Bceause you can use pre-built bricks instead and, after applying
      stucco, nobody will notice you used bricks instead of your own in
      house-original-cooked bricks.

      Ok, making your own bricks give you more control over the final result
      and the way you work with them, but after building two or three
      houses, you realize it is very cumbersome and time consuming, and not
      really practical for a "real world" builder...
      Although making your own bricks could make sense if instead of being a
      house builder, you are a bricks vendor.

      It is the same with programming languages:
      If you are planning to write the next operating system, or a database
      management system to be used in mission critical applications by
      millions of users, or perhaps a 3D graphics application, you'd better
      use C.

      Fort anything else, boy, don't lose your time. Use Python, get the job
      done with the least delay and have fun.
      My two cents...

      Luis




      On 20 jul, 19:50, giveitawhril2.. .@gmail.com wrote:
      I'm just learning about Python now and it sounds interesting. But I
      just read (on the Wiki page) that mainstream Python was written in C.
      That's what I was searching for: Python was written in what other
      language?
      >
      See, my concern was something like: OK, if Python is so hot, then,
      hopefully someone is writing it in assembly language for each MPU chip
      out there. Otherwise, if, say, they've written it in C#, then it looks
      like the REAL, generally useful language to learn is C# and Python is
      akin to Visual Basic or something: a specialty language....whe reas
      REAL WORLD programmers who want to be generally useful go and learn
      C#.
      >
      So I was suspecting the Python compiler or interpreter is written in a

      Comment

      • Johannes Bauer

        #33
        Re: Python Written in C?

        Mensanator schrieb:
        You want cool?
        THIS is cool:
        >
        j = ((invert(xyz[1]-xyz[0],xyz[1]**(k-1))*(xyz[1]**(k-1)-prev_gen[2]))
        % xyz[1]**(k-1))/xyz[1]**(k-2)
        You call it cool, I call it NameError: name 'invert' is not defined.

        Regards,
        Johannes

        --
        "Wer etwas kritisiert muss es noch lange nicht selber besser können. Es
        reicht zu wissen, daß andere es besser können und andere es auch
        besser machen um einen Vergleich zu bringen." - Wolfgang Gerber
        in de.sci.electron ics <47fa8447$0$115 45$9b622d9e@new s.freenet.de>

        Comment

        • Marc 'BlackJack' Rintsch

          #34
          Re: Python Written in C?

          On Mon, 21 Jul 2008 11:26:27 -0700, castironpi wrote:
          On Jul 20, 11:59 pm, Michael Torrie <torr...@gmail. comwrote:
          >giveitawhril2. ..@gmail.com wrote:
          I'm not dissing Python, here. Just noting that, if it is written in C,
          that throws a curve at me in trying to balance the value of learning
          Python vs. some other major language.
          >>
          >Definitely one of the most non-sequitor statements I have ever heard.
          >Actually your entire post doesn't make much sense.  Maybe you are a
          >brother bot to castropini?  Perhaps a less-trained one, although none of
          >castropini's posts seem to make sense either.  The AI needs a bit of work.
          >
          Are you saying Python is not good for writing A.I., or the A.I. isn't
          good at writing Python?
          Are you saying python is not as smart as you.

          Ciao,
          Marc 'BlackJack' Rintsch

          Comment

          • Terry Reedy

            #35
            Re: Python Written in C?



            Fredrik Lundh wrote:
            rynt wrote:
            >
            >You're either ---
            >A. A Troll
            >B. A young, immature programmer trying to show off
            >or
            >C. A total idiot.
            >
            you forgot the "All of the above" choice.
            Or Aspiring Comic. This is certain one of the more entertaining troll
            posts we have had ;-).

            Comment

            • Terry Reedy

              #36
              Re: Python Written in C?



              mk wrote:
              Seriously, though, would there be any advantage in re-implementing
              Python in e.g. C++?
              Considered and rejected by Guido and the CPython developer crew.
              Anyone who wants C++Python is free to make one, just as people have done
              JavePython (Jython), C#Python, (IonPython), PythonPython (PyPy), and
              compiled-CPython (multiple).
              Not that current implementation is bad, anything but, but if you're not
              careful, the fact that lists are implemented as C arrays can bite your
              rear from time to time (it recently bit mine while using lxml). Suppose
              C++ re-implementation used some other data structure (like linked list,
              possibly with twists like having an array containing pointers to 1st
              linked list elements to speed lookups up), which would be a bit slower
              on average perhaps, but it would behave better re deletion?
              This is a data structure issue, not a language issue. The tradeoffs for
              practical implementation include code-length, code-complexity,
              code-fragility, and ease of cross-platform compilation as well as
              classical time and space issues.

              tjr

              Comment

              • Mensanator

                #37
                Re: Python Written in C?

                On Jul 21, 8:26 am, Johannes Bauer <dfnsonfsdu...@ gmx.dewrote:
                Mensanator schrieb:
                >
                You want cool?
                THIS is cool:
                >
                j = ((invert(xyz[1]-xyz[0],xyz[1]**(k-1))*(xyz[1]**(k-1)-prev_gen[2]))
                % xyz[1]**(k-1))/xyz[1]**(k-2)
                >
                You call it cool, I call it NameError: name 'invert' is not defined.
                It is when you do: from gmpy import *

                That single line wasn't the whole program.

                What's cool is that it IS a single line, that does answers
                with >50000 decimal digits without breaking a sweat. Sure, you
                can use GMP with C (and I've done it). But it's nothing like
                doing it in Python.
                >
                Regards,
                Johannes
                >
                --
                "Wer etwas kritisiert muss es noch lange nicht selber besser können. Es
                reicht zu wissen, daß andere es besser können und andere es auch
                besser machen um einen Vergleich zu bringen."     -     Wolfgang Gerber
                       in de.sci.electron ics <47fa8447$0$115 45$9b622...@new s.freenet.de>

                Comment

                • Teiresias

                  #38
                  Re: Python Written in C?

                  giveitawhril200 8@gmail.com writes:
                  I'm just learning about Python now and it sounds interesting. But I
                  just read (on the Wiki page) that mainstream Python was written in C.
                  That's what I was searching for: Python was written in what other
                  language?
                  Well, yes, the interpreter and a handful of the core modules are written in C.
                  However, most of Python -- especially the cool bits -- aren't written in
                  C. They're written in ... Python!

                  -- Teiresias

                  Comment

                  • bojannastic at googlemail

                    #39
                    Re: Python Written in C?

                    On Jul 20, 6:50 pm, giveitawhril2.. .@gmail.com wrote:
                    So I was suspecting the Python compiler or interpreter is written in a
                    REAL language like C#. So, Wiki says it's written in C! It's almost as
                    if it were an intentional trick...write your own, new language in an
                    OLD, real world language that is passe. Compile it into executable
                    modules of course, so it is a real, working compiler, alright. But the
                    SOURCE is some old, high level language which no one wants to use
                    anymore! So now you've got a hot new language package and no one can
                    say "well, it is written in, the SOURCE code is written in, a REAL
                    language." No, it's not! The source is some outdated language and
                    compiler and no one is going to prefer learning THAT to learning your
                    hot new language!
                    Young people these days...

                    I will just answer using one of old Microsoft's ads: "My compiler
                    compiled yours."


                    Comment

                    • Larry Bates

                      #40
                      Re: Python Written in C?

                      giveitawhril200 8@gmail.com wrote:
                      I'm just learning about Python now and it sounds interesting. But I
                      just read (on the Wiki page) that mainstream Python was written in C.
                      That's what I was searching for: Python was written in what other
                      language?
                      >
                      See, my concern was something like: OK, if Python is so hot, then,
                      hopefully someone is writing it in assembly language for each MPU chip
                      out there. Otherwise, if, say, they've written it in C#, then it looks
                      like the REAL, generally useful language to learn is C# and Python is
                      akin to Visual Basic or something: a specialty language....whe reas
                      REAL WORLD programmers who want to be generally useful go and learn
                      C#.
                      >
                      So I was suspecting the Python compiler or interpreter is written in a
                      REAL language like C#. So, Wiki says it's written in C! It's almost as
                      if it were an intentional trick...write your own, new language in an
                      OLD, real world language that is passe. Compile it into executable
                      modules of course, so it is a real, working compiler, alright. But the
                      SOURCE is some old, high level language which no one wants to use
                      anymore! So now you've got a hot new language package and no one can
                      say "well, it is written in, the SOURCE code is written in, a REAL
                      language." No, it's not! The source is some outdated language and
                      compiler and no one is going to prefer learning THAT to learning your
                      hot new language!
                      >
                      I'm not dissing Python, here. Just noting that, if it is written in C,
                      that throws a curve at me in trying to balance the value of learning
                      Python vs. some other major language.
                      SPSS (was and may still be) written in Fortran and the Fortran compiler was
                      written in C. But NOBODY would suggest that you try to solve the problems that
                      SPSS is used for in C.

                      You talk about "writing it in assembly language for each MPU chip". Actually it
                      is even better than that. We now have these modern inventions, called compilers
                      that do that type of work for us. They translate high level instructions, not
                      into assembler but into machine language.

                      -Larry

                      Comment

                      • Grant Edwards

                        #41
                        Re: Python Written in C?

                        On 2008-07-22, Larry Bates <larry.bates@we bsafe.com`wrote :
                        You talk about "writing it in assembly language for each MPU
                        chip". Actually it is even better than that. We now have
                        these modern inventions, called compilers that do that type of
                        work for us. They translate high level instructions, not
                        into assembler but into machine language.
                        Actually, all of the compilers I'm familiar with (gcc and a
                        handful of cross compilers for various microprocessors )
                        translate from high-level languages (e.g. C, C++) into
                        assembly, which is then assembled into relocatable object
                        files, which are then linked/loaded to produce machine
                        language.

                        --
                        Grant Edwards grante Yow! "DARK SHADOWS"
                        at is on!! Hey, I think
                        visi.com the VAMPIRE forgot his
                        UMBRELLA!!

                        Comment

                        • Larry Bates

                          #42
                          Re: Python Written in C?

                          Grant Edwards wrote:
                          On 2008-07-22, Larry Bates <larry.bates@we bsafe.com`wrote :
                          >
                          >You talk about "writing it in assembly language for each MPU
                          >chip". Actually it is even better than that. We now have
                          >these modern inventions, called compilers that do that type of
                          >work for us. They translate high level instructions, not
                          >into assembler but into machine language.
                          >
                          Actually, all of the compilers I'm familiar with (gcc and a
                          handful of cross compilers for various microprocessors )
                          translate from high-level languages (e.g. C, C++) into
                          assembly, which is then assembled into relocatable object
                          files, which are then linked/loaded to produce machine
                          language.
                          >
                          I just learned something I did not know. I was under the impression that they
                          translated directly to machine code without ever actually generating Assembler
                          text files. Seems like a waste to generate the text and turn around run that
                          through the assembler, but what do I know. I guess that way the compiler can
                          have pluggable assembler back-ends.

                          -Larry

                          Comment

                          • cokofreedom@gmail.com

                            #43
                            Re: Python Written in C?

                            On Jul 22, 5:59 am, Larry Bates <larry.ba...@we bsafe.com`wrote :
                            Grant Edwards wrote:
                            On 2008-07-22, Larry Bates <larry.ba...@we bsafe.com`wrote :
                            >
                            You talk about "writing it in assembly language for each MPU
                            chip". Actually it is even better than that. We now have
                            these modern inventions, called compilers that do that type of
                            work for us. They translate high level instructions, not
                            into assembler but into machine language.
                            >
                            Actually, all of the compilers I'm familiar with (gcc and a
                            handful of cross compilers for various microprocessors )
                            translate from high-level languages (e.g. C, C++) into
                            assembly, which is then assembled into relocatable object
                            files, which are then linked/loaded to produce machine
                            language.
                            >
                            I just learned something I did not know. I was under the impression that they
                            translated directly to machine code without ever actually generating Assembler
                            text files. Seems like a waste to generate the text and turn around run that
                            through the assembler, but what do I know. I guess that way the compiler can
                            have pluggable assembler back-ends.
                            >
                            -Larry
                            I also I have just learned something new! Troll threads are useful.
                            Yay.

                            Comment

                            • Grant Edwards

                              #44
                              Re: Python Written in C?

                              On 2008-07-22, Larry Bates <larry.bates@we bsafe.com`wrote :
                              Grant Edwards wrote:
                              >On 2008-07-22, Larry Bates <larry.bates@we bsafe.com`wrote :
                              >>
                              >>You talk about "writing it in assembly language for each MPU
                              >>chip". Actually it is even better than that. We now have
                              >>these modern inventions, called compilers that do that type of
                              >>work for us. They translate high level instructions, not
                              >>into assembler but into machine language.
                              >>
                              >Actually, all of the compilers I'm familiar with (gcc and a
                              >handful of cross compilers for various microprocessors )
                              >translate from high-level languages (e.g. C, C++) into
                              >assembly, which is then assembled into relocatable object
                              >files, which are then linked/loaded to produce machine
                              >language.
                              >>
                              I just learned something I did not know. I was under the
                              impression that they translated directly to machine code
                              without ever actually generating Assembler text files.
                              There may indeed be compilers that work that way. On Unix
                              systems (which is what I work with) compilers have
                              traditionally generated assembly language files.
                              Seems like a waste to generate the text and turn around run
                              that through the assembler, but what do I know. I guess that
                              way the compiler can have pluggable assembler back-ends.
                              Since you probably need an assembler anyway, generating
                              assembly-language in the compiler prevents you from having to
                              duplicate a bunch of object-code-generation code in two places.

                              --
                              Grant Edwards grante Yow! Okay ... I'm going
                              at home to write the "I HATE
                              visi.com RUBIK's CUBE HANDBOOK FOR
                              DEAD CAT LOVERS" ...

                              Comment

                              • Ethan Furman

                                #45
                                Re: Python Written in C?

                                Iain King wrote:
                                On Jul 21, 6:58 am, "Krishnakan t Mane" <hackin...@gmai l.comwrote:
                                >
                                >First off all c# is absolute rubbish waist of time. if I need to
                                >learn it then I better lern java or pythonfor that matter. and by the
                                >way what is a "real programmer?"
                                >
                                The story of a Real Programmer:
                                >

                                >
                                Iain
                                Wow. Awesome story.
                                ~Ethan

                                Comment

                                Working...