Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python Written in C?

422 views
Skip to first unread message

giveitaw...@gmail.com

unread,
Jul 20, 2008, 6:50:41 PM7/20/08
to
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....whereas
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.

Erik Max Francis

unread,
Jul 20, 2008, 7:19:41 PM7/20/08
to
giveitaw...@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....whereas
> REAL WORLD programmers who want to be generally useful go and learn
> C#.

Psst. What language do you think the primary implementations of C# is
written in?

--
Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
The actor is not quite a human being -- but then, who is?
-- George Sanders

alex23

unread,
Jul 20, 2008, 7:22:00 PM7/20/08
to
On Jul 21, 8:50 am, 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.

The advantage of Python over C - to me - is in the higher order
abstractions it provides, not in pointless discussions of purity. Even
better, Python allows me to -mix- both C & Python together, to take
advantage of the strengths of each as appropriate.

Try writing something of complexity in Python. Then write the same
thing in C. -Then- make your decision which you prefer.

Mensanator

unread,
Jul 20, 2008, 8:11:34 PM7/20/08
to
On Jul 20, 5:50�pm, 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....whereas
> REAL WORLD programmers who want to be generally useful go and learn
> C#.

Python is for people who want to program, not REAL WORLD
programmers.

>
> 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

C isn't a high level language, that's part of its problem.

> 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.

Yes, you are.

> 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.

Then go learn C, nobody's stopping you.

Roy Smith

unread,
Jul 20, 2008, 8:37:23 PM7/20/08
to
In article
<a9620c65-49c6-4fe7...@59g2000hsb.googlegroups.com>,
Mensanator <mensa...@aol.com> wrote:

> C isn't a high level language, that's part of its problem.

C is the highest level assembler language I've ever used. And I've used a
few. It really is cool that you can add two 32-bit integers and not have
to worry about all those carry bits.

John Machin

unread,
Jul 20, 2008, 8:43:46 PM7/20/08
to
On Jul 21, 8:50 am, 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.

Why do that, when gcc has a code generator for just about every 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#

A bit of a non sequitur .... and C# is available on how many different
MPU chips?

> and Python is
> akin to Visual Basic

<chuckle/>

> or something: a specialty language


> ....whereas
> 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!

Nobody wants to use C any more?

> 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.

It should be sublimely irrelevant to most people learning LanguageX
what language LanguageX is written in.

Some other implementations of Python: PyPy (written in Python), Jython
(written in Java) and IronPython (written in C#).

Carl Banks

unread,
Jul 20, 2008, 9:00:07 PM7/20/08
to
On Jul 20, 6:50 pm, 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.

I somehow doubt the Python community will feel much of a loss if you
decide to learn some other language.


Carl Banks

Teiresias

unread,
Jul 20, 2008, 8:58:56 PM7/20/08
to
giveitaw...@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

Michiel Overtoom

unread,
Jul 20, 2008, 9:18:01 PM7/20/08
to pytho...@python.org
Giveitawhril wrote...

> REAL WORLD programmers who want to be generally useful go
> and learn C#.

No: Real programmers first eat a quiche and then return to their Pascal
programming.


> But the SOURCE is some old, high level language which no one wants to
> use anymore!

C is alive and kicking. Every language has its place.
Plus, there exists implementations of Python written in Python itself;
see PyPy: http://codespeak.net/pypy/dist/pypy/doc/home.html


> 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.

Many major text/word processing programs (Emacs, vi, MS-Word) are also
written in C. Does that mean you should do all your text processing in C?

Greetings,


--
"The ability of the OSS process to collect and harness
the collective IQ of thousands of individuals across
the Internet is simply amazing." - Vinod Vallopillil
http://www.catb.org/~esr/halloween/halloween4.html

Mike

unread,
Jul 20, 2008, 10:01:20 PM7/20/08
to
In article <fa4e498a-6bb9-4612...@y38g2000hsy.googlegroups.com>, giveitaw...@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?

C is the universal assembler.

Mike

Dan Upton

unread,
Jul 20, 2008, 10:15:30 PM7/20/08
to pytho...@python.org
On Sun, Jul 20, 2008 at 9:18 PM, Michiel Overtoom <mot...@xs4all.nl> wrote:
> Giveitawhril wrote...
>
>> REAL WORLD programmers who want to be generally useful go
>> and learn C#.
>
> No: Real programmers first eat a quiche and then return to their Pascal
> programming.

Bah, new-fangled languages like Pascal... Real programmers write Fortran.

>
>
>> But the SOURCE is some old, high level language which no one wants to
>> use anymore!
>
> C is alive and kicking. Every language has its place.
> Plus, there exists implementations of Python written in Python itself;
> see PyPy: http://codespeak.net/pypy/dist/pypy/doc/home.html
>
>
>> 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.
>
> Many major text/word processing programs (Emacs, vi, MS-Word) are also
> written in C. Does that mean you should do all your text processing in C?
>

Don't you?

</snark>

Mensanator

unread,
Jul 20, 2008, 10:31:23 PM7/20/08
to
On Jul 20, 7:37�pm, Roy Smith <r...@panix.com> wrote:
> In article
> <a9620c65-49c6-4fe7-9cbe-de3779ec3...@59g2000hsb.googlegroups.com>,

>
> �Mensanator <mensana...@aol.com> wrote:
> > C isn't a high level language, that's part of its problem.
>
> C is the highest level assembler language

Isn't that like bragging about being the smartest
kid on the short bus?

> I've ever used. �And I've used a
> few. �It really is cool that you can add two 32-bit integers and not have
> to worry about all those carry bits.

Carry bits? Who worries about carry bits when you have
unlimited precision arithmetic? 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)

Stephen Johnson

unread,
Jul 20, 2008, 11:05:54 PM7/20/08
to Mensanator, pytho...@python.org
> Carry bits? Who worries about carry bits when you have
> unlimited precision arithmetic? 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 that "cool." I call it "unreadable."

-Steve Johnson

Grant Edwards

unread,
Jul 20, 2008, 11:06:50 PM7/20/08
to
On 2008-07-21, Dan Upton <up...@virginia.edu> wrote:

>>> REAL WORLD programmers who want to be generally useful go and
>>> learn C#.
>>
>> No: Real programmers first eat a quiche and then return to
>> their Pascal programming.
>
> Bah, new-fangled languages like Pascal... Real programmers
> write Fortran.

Using punch-cards and paper-tape. Real programmers can edit
their programs with a pointy stick and some home-made
sticky-tape.

--
Grant Edwards grante Yow! While I'm in
at LEVITTOWN I thought I'd
visi.com like to see the NUCLEAR
FAMILY!!

Mensanator

unread,
Jul 20, 2008, 11:51:59 PM7/20/08
to

Ok, but not in the sense that something like
Scheme is unreadable as this is nothing but
algebra (albeit complicaed).

>
> -Steve Johnson

Dan Upton

unread,
Jul 21, 2008, 12:08:13 AM7/21/08
to pytho...@python.org

Scheme doesn't *have* to be unreadable... any more unreadable than any
other language when poorly documented/formatted, anyway.

Michael Torrie

unread,
Jul 21, 2008, 12:50:40 AM7/21/08
to pytho...@python.org
Mensanator wrote:
> On Jul 20, 7:37�pm, Roy Smith <r...@panix.com> wrote:
>> In article
>> <a9620c65-49c6-4fe7-9cbe-de3779ec3...@59g2000hsb.googlegroups.com>,
>>
>> �Mensanator <mensana...@aol.com> wrote:
>>> C isn't a high level language, that's part of its problem.
>> C is the highest level assembler language
>
> Isn't that like bragging about being the smartest
> kid on the short bus?
>
>> I've ever used. �And I've used a
>> few. �It really is cool that you can add two 32-bit integers and not have
>> to worry about all those carry bits.
>
> Carry bits? Who worries about carry bits when you have
> unlimited precision arithmetic? You want cool?

Perhaps you missed the wonderful humor in Roy's post. It was rather
brilliant. Sorry you missed it.

Michael Torrie

unread,
Jul 21, 2008, 12:59:05 AM7/21/08
to python
giveitaw...@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.

I am very confused over your incoherent ramblings about C# being some
how more real than C, or Python, or Visual Basic, or any other language.
I fail to grasp what connection the syntax of a language has to do with
anything being real or not. You first say you hope someone was writing
optimized assembly for python on the different platforms (I'm not
familiar with the acronym "MPU.") and then go on to say it should have
been written with C#. I'm confused as to what C# has to do with
optimized, platform-specific assembly.

Manuel Vazquez Acosta

unread,
Jul 21, 2008, 1:15:45 AM7/21/08
to pytho...@python.org
I think your mixing things up. Even modern C compiler are mostly written
in some other high level language. See GCC, for instance: it's mostly
written in C.

Many languages are made for build other major systems:
* C was made in order to ease the build of Unix
* Ada was made in order to ease the build of Air Traffic Control Systems.
* and so on...

On the other hand, Python's language features are, in a way, orthogonal
to those of the underlying language in which Python *may* be implemented
(take a look at PyPy: http://en.wikipedia.org/wiki/PyPy).

I mean, I really don't care how Python mappings are implemented in C.
What I care about is that I think in terms of (key, value) mappings,
regardless of how lookups, insertions, deletions, and so are made
internally. In C, I would have to resort to implement a hash table or so.

Let's summarize: Python is a *new* language. C was the option to make it
happen, there are others.

Manuel.


giveitaw...@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....whereas

> 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.

> --
> http://mail.python.org/mailman/listinfo/python-list
>

Mensanator

unread,
Jul 21, 2008, 1:16:39 AM7/21/08
to
On Jul 20, 11:08 pm, "Dan Upton" <up...@virginia.edu> wrote:

When I needed to whip up a variation on Ulam's
Spiral recently, I went and got the Scheme version
I wrote 4 years ago when I briefly toyed with Scheme
and thought I'd just translate the plotting part to
Python. Couldn't make any sense of it and ended up
doing the Python version with Turtle Graphics.

Tim Roberts

unread,
Jul 21, 2008, 1:33:18 AM7/21/08
to
giveitaw...@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. ...

No one writes compilers in assembly language. Most people don't even write
assemblers in assembly language.

>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.

You seem to believe that, because YOU are just learning about Python, that
necessarily means that Python itself is new. That is incorrect. Python
was originally conceived and developed in 1990. Anders Hejlsberg, who
designed C#, was still at Borland at that time, and had not even created
Delphi yet. C++ was still many years away from becoming an ISO standard.

>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.

I would say you have a very strange criteria for deciding whether a
language is worth learning.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

Yu-Xi Lim

unread,
Jul 21, 2008, 1:31:21 AM7/21/08
to
Grant Edwards wrote:
> On 2008-07-21, Dan Upton <up...@virginia.edu> wrote:
>
>>>> REAL WORLD programmers who want to be generally useful go and
>>>> learn C#.
>>> No: Real programmers first eat a quiche and then return to
>>> their Pascal programming.
>> Bah, new-fangled languages like Pascal... Real programmers
>> write Fortran.
>
> Using punch-cards and paper-tape. Real programmers can edit
> their programs with a pointy stick and some home-made
> sticky-tape.
>

Bah. Butterflies! http://xkcd.com/378/

Krishnakant Mane

unread,
Jul 21, 2008, 1:58:40 AM7/21/08
to giveitaw...@gmail.com, pytho...@python.org
On 21/07/2008, giveitaw...@gmail.com <giveitaw...@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?
>
Are you a PH.d researcher
In the first place why do you want to make an issue of "what an x
language is compiled in "
and if that' is what you are researching in, then sorry to say you
don't seam to have a mindset needed for researcher.

> 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....whereas
> REAL WORLD programmers who want to be generally useful go and learn
> C#.
>
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?"
I never knew that there are robots who program vertually and a "real
programmer ".
What do you think I am a spam bot who is writing a "vertual program "
every day? first give me your defination for real programmer.

> 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!
>
what! no one is using c? I want to know what people use to write
device drivers? I am such a fool I really never new that people use
c# to create device drivers for hardware and for creating firmware. I
admit my stupidity that I never knew that c# is "real programming
language ".
and what is "your programming language?"python is a free and open
source programming language and does not belong to one person.

> 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.

My request and strong recommendation to you is "don't learn python,
because you don't deserve to. " I am not saying for dissing you, i
know you are "real programmer ". but you seam to have a typical
mindset which the rubbish microsoft has inculcated in many
programmers, aa sorry "real programmers " line you.
I don't think there is any point saying "vvb kind of " some thing is
great and python is rubbish. every language has its value and vb is
not a language in the first place. python is made with a view that it
is usefull for all purposes and it has been so far successful and I
don't really care why it is done in c as long as it does the work.
happy hacking.
Krishnakant.
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Fredrik Lundh

unread,
Jul 21, 2008, 3:10:21 AM7/21/08
to pytho...@python.org
Michael Torrie wrote:

> giveitaw...@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?

or that perl troll making another attempt to add noise to this
newsgroup? I'm a bit surprised that he managed to generate this
many replies, really.

</F>

Peter Anderson

unread,
Jul 21, 2008, 1:14:32 AM7/21/08
to PYTHON List
> Bah, new-fangled languages like Pascal... Real programmers write
Fortran. Using punch-cards and paper-tape. Real programmers can edit
their programs with a pointy stick and some home-made sticky-tape. --
Grant Edwards

Reminds me of a funny story from my past working life. I had this fibre
tipped pen, given to me as a freebie by some computer company. The pen
had something like "Floppy Disk Pen" printed down the barrel. A
colleague who was more into IT management than programming or hands-on
support picked it up at a meeting and said something like - "That's
interesting, what's it for?" Seeing an opportunity I replied "Its a new
bit of technology that allows you to write directly to your floppy disks
when you are away from your computer!" "What a great idea!" he replied
in all seriousness!

Maybe our friend could find one to code C# with! ;-)

Peter
--

Peter Anderson

There is nothing more difficult to take in hand, more perilous to
conduct, or more uncertain in its success, than to take the lead in the
introduction of a new order of things — Niccolo Machiavelli, /The
Prince/, ch. 6

Lawrence D'Oliveiro

unread,
Jul 21, 2008, 5:13:39 AM7/21/08
to
In message <mailman.370.1216603...@python.org>, Michiel
Overtoom wrote:

> Many major text/word processing programs (Emacs, vi, MS-Word) are also
> written in C. Does that mean you should do all your text processing in C?

How else would you implement a Boyer-Moore algorithm?

Iain King

unread,
Jul 21, 2008, 5:25:24 AM7/21/08
to
On Jul 21, 6:58 am, "Krishnakant Mane" <hackin...@gmail.com> wrote:

>
> 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:

http://www.pbm.com/~lindahl/mel.html

Iain

Bruno Desthuilliers

unread,
Jul 21, 2008, 5:32:47 AM7/21/08
to
giveitaw...@gmail.com a écrit :
(snip clueless nonsense)

Surely a troll... No one on earth can be *that* clueless.

ptn

unread,
Jul 21, 2008, 9:12:30 AM7/21/08
to
On Jul 20, 5:50 pm, 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....whereas
> 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.


Sounds like you program only because someone's paying you. Any
programmer who says that C is outdated and not real *is* outdated and
not real.

Not used anymore? Mmmmm I wonder, have you heard of something called
"Linux"? The open source Unix-like system? Or perhaps you are familiar
with "Apache"? Does "GNOME" ring any bells to you? "Vim"? "Git"? You
got some serious research to do, STFW.

Martin P. Hellwig

unread,
Jul 21, 2008, 10:11:03 AM7/21/08
to
I disagree he has upper management written all over him.

--
mph

rynt

unread,
Jul 21, 2008, 10:19:16 AM7/21/08
to

You're either ---
A. A Troll
B. A young, immature programmer trying to show off
or
C. A total idiot.

Who cares what language a language is written in as long as you can be
productive - which you certainly can be in Python.

RCB

Fredrik Lundh

unread,
Jul 21, 2008, 10:29:27 AM7/21/08
to pytho...@python.org
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.

Matthew Fitzgibbons

unread,
Jul 21, 2008, 10:27:35 AM7/21/08
to pytho...@python.org
Martin P. Hellwig wrote:
> I disagree he has upper management written all over him.
>

In any case, the OP should remember that programming languages are all
theoretically the same: if you can do it in one language, then you can
theoretically do it any other. When choosing a language, you just need
to find one that (a) has the right tools to do the job (libraries,
methods of deployment, supported platforms, etc.) and (b) that you and
your team are comfortable using. Python has the tools to tackle a huge
range of problems (you can often use the standard library when you would
have to write C code from scratch), and many find it, dare I say, fun to
use (whereas I find C# roughly equivalent to being shot). Whether you
should use it depends on your domain and your team's preference.

-Matt

mk

unread,
Jul 21, 2008, 12:03:08 PM7/21/08
to pytho...@python.org
Grant Edwards wrote:

> Using punch-cards and paper-tape. Real programmers can edit
> their programs with a pointy stick and some home-made
> sticky-tape.

Wrong! Real programmers can program using only Touring machine (and
something having to do with post for some reason). I'm sure our
brilliant OP[1] could program in both.

[1] Troll, really. Don't feed the troll. I wouldn't have posted about
him because that only adds to the noise. oops.

Tim Golden

unread,
Jul 21, 2008, 12:06:03 PM7/21/08
to pytho...@python.org
mk wrote:

> Grant Edwards wrote:
>
>> Using punch-cards and paper-tape. Real programmers can edit
>> their programs with a pointy stick and some home-made
>> sticky-tape.
>
> Wrong! Real programmers can program using only Touring machine

Is that some kind of bicycle?

TJG

Fredrik Lundh

unread,
Jul 21, 2008, 12:12:17 PM7/21/08
to pytho...@python.org
Tim Golden wrote:

>> Wrong! Real programmers can program using only Touring machine
>
> Is that some kind of bicycle?

there's a nearly infinite number of software projects with that name,
but the Ultimate Touring Machine could be found in sydney not long ago:

http://tinyurl.com/5t2dl4

</F>

mk

unread,
Jul 21, 2008, 12:12:54 PM7/21/08
to pytho...@python.org

> Who cares what language a language is written in as long as you can be
> productive - which you certainly can be in Python.

Seriously, though, would there be any advantage in re-implementing
Python in e.g. C++?

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?


Marcus.CM

unread,
Jul 21, 2008, 12:14:42 PM7/21/08
to pytho...@python.org
Hi everyone,

Yes, python is written in C. Maybe the original poster is looking for
"ultimate" language and thus finds it uncomfortable that python should
be written in C and not python itself.
Actually it doesnt matter if IronPython is written in C# and Python in
C. Each programming language is like a tool to the programmer and no, C
is not outdate, its just a language with a much higher learning curve
and its best left to do stuffs requiring drivers or optimized algorithms
and other embedded stuffs that is usable by other languages. What do you
think C# is written in? C# ?
You see how flawed this logic is.
Anyway, good luck on your search. But why look for "ultimate" language,
when the core difference is the "programmmer" him/herself. In the hands
of an skilled programmer, any language could accomplish much and then
there is an issue with "time". I would cringe to do in C what i do in
python nowadays, and i have like 14 years of C/C++ programming
background. Someone wrote bittorrent in python and today its Utorrent
written in C/C++ that is "cool", you see that doesnt mean that the next
guy wrote write it in python would not beat the cool factor, its a
matter of design, look, feel and ....its all about the programmer.

Like they say in racing, its the driver not the car.

Marcus.CM

unread,
Jul 21, 2008, 12:17:44 PM7/21/08
to pytho...@python.org
Its called a BMW today.

> --
> http://mail.python.org/mailman/listinfo/python-list
>


Michael.C...@verizonwireless.com

unread,
Jul 21, 2008, 12:12:12 PM7/21/08
to pytho...@python.org

>
> From: mk

> Wrong! Real programmers can program using only Touring machine (and
> something having to do with post for some reason). I'm sure our
> brilliant OP[1] could program in both.

Ah, now we can really got OT. My favorite Touring machine is a Jaguar (
with the pronounced 'U' in there ). Oh, you meant "Turing";
<http://en.wikipedia.org/wiki/Alan_Turing>.

Sorry, I just couldn't resist after the tortured route this thread has
taken.


The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.


Matthew Woodcraft

unread,
Jul 21, 2008, 12:43:29 PM7/21/08
to
Roy Smith <r...@panix.com> wrote:
> C is the highest level assembler language I've ever used. And I've used a
> few. It really is cool that you can add two 32-bit integers and not have
> to worry about all those carry bits.

I was ever so pleased when I found out that the LLVM people have
learned this lesson from C.

I look forward to the day when we can have similar treatment for all
forms of error checking. Programming will be so much easier.

-M-

David C. Ullrich

unread,
Jul 21, 2008, 1:16:50 PM7/21/08
to
In article <cqKdnc3xC9qQVR7V...@speakeasy.net>,
Erik Max Francis <m...@alcyone.com> wrote:

> giveitaw...@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....whereas
> > REAL WORLD programmers who want to be generally useful go and learn
> > C#.
>

> Psst. What language do you think the primary implementations of C# is
> written in?

I know, I know, call on me!

Object Pascal, obviously.

--
David C. Ullrich

Marc 'BlackJack' Rintsch

unread,
Jul 21, 2008, 1:16:46 PM7/21/08
to
On Mon, 21 Jul 2008 17:06:03 +0100, Tim Golden wrote:

> mk wrote:
>
>> Wrong! Real programmers can program using only Touring machine
>
> Is that some kind of bicycle?

Maybe it's a Turing machine after Bicycle Repair Man got his hands on it!?

Ciao,
Marc 'BlackJack' Rintsch

Marc 'BlackJack' Rintsch

unread,
Jul 21, 2008, 1:21:48 PM7/21/08
to
On Mon, 21 Jul 2008 18:12:54 +0200, mk wrote:

> Seriously, though, would there be any advantage in re-implementing
> Python in e.g. C++?
>
> 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?

An operation that most people avoid because of the penalty of "shifting
down" all elements after the deleted one. Pythonistas tend to build new
lists without unwanted elements instead. I can't even remember when I
deleted something from a list in the past.

Ciao,
Marc 'BlackJack' Rintsch

Dan Upton

unread,
Jul 21, 2008, 2:05:49 PM7/21/08
to pytho...@python.org
On Mon, Jul 21, 2008 at 1:21 PM, Marc 'BlackJack' Rintsch
<bj_...@gmx.net> wrote:
> On Mon, 21 Jul 2008 18:12:54 +0200, mk wrote:
>
>> Seriously, though, would there be any advantage in re-implementing
>> Python in e.g. C++?
>>
>> 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?

Aside (actual reply below): at least for a sorted LL, you're basically
describing Henriksen's algorithm. They can asymptotically be faster,
based on amortized analysis, but they're somewhat more complicated to
implement.

>
> An operation that most people avoid because of the penalty of "shifting
> down" all elements after the deleted one. Pythonistas tend to build new
> lists without unwanted elements instead. I can't even remember when I
> deleted something from a list in the past.
>
> Ciao,
> Marc 'BlackJack' Rintsch

The other side of the equation though is the OO-overhead for C++
programs as compared to C. (A couple years ago we used an
instrumentation tool to check the instruction count for a simple hello
world program written in C (ie, main(){printf("Hello world!"); return
0;}) and Python (main(){cout<<"hello world"<<endl;return 0;}), and the
instruction count was significantly higher for C++. I expect any sort
of C++ objects you used to implement Python structures will be slower
than the equivalent in C. So even if writing it in C++ would reduce
the overhead for deleting from a list, I expect you would lose a lot
more.

castironpi

unread,
Jul 21, 2008, 2:26:27 PM7/21/08
to
On Jul 20, 11:59 pm, Michael Torrie <torr...@gmail.com> wrote:

> 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?

Luis M. González

unread,
Jul 21, 2008, 3:12:39 PM7/21/08
to
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....whereas
> REAL WORLD programmers who want to be generally useful go and learn
> C#.
>

Johannes Bauer

unread,
Jul 21, 2008, 9:26:18 AM7/21/08
to
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.electronics <47fa8447$0$11545$9b62...@news.freenet.de>

Marc 'BlackJack' Rintsch

unread,
Jul 21, 2008, 4:59:19 PM7/21/08
to

Are you saying python is not as smart as you.

Ciao,
Marc 'BlackJack' Rintsch

Phil Runciman

unread,
Jul 21, 2008, 4:48:19 PM7/21/08
to pytho...@python.org


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....whereas
> 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

".. if Python is so hot.." Python represents progress not the ultimate
goal. Thank goodness we are continuing to learn from past mistakes.

All compilers and interpreters started out being written in another
language. You do not help us by stating the obvious.

This is even true of the interpreter in your own brain that processes
English. IMHO The latter still has some bugs in it. ;-)


Terry Reedy

unread,
Jul 21, 2008, 5:47:26 PM7/21/08
to pytho...@python.org

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 ;-).

Terry Reedy

unread,
Jul 21, 2008, 6:04:45 PM7/21/08
to pytho...@python.org

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

DaveM

unread,
Jul 21, 2008, 6:53:36 PM7/21/08
to
On Mon, 21 Jul 2008 03:18:01 +0200, Michiel Overtoom <mot...@xs4all.nl>
wrote:


>Many major text/word processing programs (Emacs, vi, MS-Word) are also
>written in C.

I thought Emacs was written in Lisp.

DaveM

Mensanator

unread,
Jul 21, 2008, 6:58:20 PM7/21/08
to
On Jul 21, 8:26 am, Johannes Bauer <dfnsonfsdu...@gmx.de> wrote:
> 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.electronics <47fa8447$0$11545$9b622...@news.freenet.de>

Teiresias

unread,
Jul 20, 2008, 8:50:38 PM7/20/08
to
giveitaw...@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

giveitaw...@gmail.com

unread,
Jul 21, 2008, 8:42:44 PM7/21/08
to
On Jul 20, 9:18 pm, Michiel Overtoom <mot...@xs4all.nl> wrote:
.

>
> Many major text/word processing programs (Emacs, vi, MS-Word) are also
> written in C. Does that mean you should do all your text processing in C?

Well, actually, as a COBOL geezer I should not complain about Python.
Rumor had it that the COMPUTE statement in COBOL invoked FORTRAN
arithmetic modules. Yes, real programmers DO write in FORTRAN!

Frankly, I say screw not only object-oriented programming but
structured programming as well. I think someone should write a
compiler, "Revenge of BASIC." It would have good old REMs,
FOR...TO...NEXTs, GOSUBS, GOTOs, etc. Standard libraries of
subroutines, and/or Copy Libraries of source code, could handle
switching to new screens or forms, placement of objects, alteration of
characteristics of all these, detection of mouse and keyboard actions,
graphics, sound, placement of HTML code, EVERYTHING!

If anyone wants to write this compiler, they should probably do it in
Python. Make it open source, of course. I'm waiting!

Delaney, Timothy (Tim)

unread,
Jul 21, 2008, 9:01:17 PM7/21/08
to pytho...@python.org
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.

I read it as an inclusive "or".

Tim Delaney

Craig Allen

unread,
Jul 21, 2008, 9:35:14 PM7/21/08
to
it's clear to me that the perfect language should exist a priori,
coming to being causa sui. Having to actually implement a language is
disgusting and unnatural.

bojannastic at googlemail

unread,
Jul 21, 2008, 9:47:30 PM7/21/08
to
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."


Larry Bates

unread,
Jul 21, 2008, 11:40:21 PM7/21/08
to
giveitaw...@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....whereas
> 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

Grant Edwards

unread,
Jul 21, 2008, 11:47:30 PM7/21/08
to
On 2008-07-22, Larry Bates <larry...@websafe.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!!

Larry Bates

unread,
Jul 21, 2008, 11:59:15 PM7/21/08
to
Grant Edwards wrote:
> On 2008-07-22, Larry Bates <larry...@websafe.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

cokof...@gmail.com

unread,
Jul 22, 2008, 3:03:14 AM7/22/08
to
On Jul 22, 5:59 am, Larry Bates <larry.ba...@websafe.com`> wrote:
> Grant Edwards wrote:

I also I have just learned something new! Troll threads are useful.
Yay.

Paul Rudin

unread,
Jul 22, 2008, 2:30:52 AM7/22/08
to
DaveM <asm...@dsl.pipex.com> writes:

The core - including the lisp interpreter - is written in C. A lot of
the user functionality is written in (emacs) lisp.

Grant Edwards

unread,
Jul 22, 2008, 8:51:48 AM7/22/08
to
On 2008-07-22, Larry Bates <larry...@websafe.com`> wrote:
> Grant Edwards wrote:
>> On 2008-07-22, Larry Bates <larry...@websafe.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" ...

Ethan Furman

unread,
Jul 22, 2008, 10:43:31 AM7/22/08
to pytho...@python.org
Iain King wrote:
> On Jul 21, 6:58 am, "Krishnakant Mane" <hackin...@gmail.com> wrote:
>
>> 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:
>
> http://www.pbm.com/~lindahl/mel.html
>
> Iain

Wow. Awesome story.
~Ethan

Erik Max Francis

unread,
Jul 22, 2008, 5:13:34 PM7/22/08
to
Ethan Furman wrote:

If my google-fu is up to snuff, these are "screenshots" (scans of
printouts) of the actual blackjack game in operation:

http://wps.com/projects/LGP-21/Software/LGP30-Blackjack1.jpg
http://wps.com/projects/LGP-21/Software/LGP30-Blackjack2.jpg

and here's a scan of a printout of some "source code" (machine language):

http://wps.com/projects/LGP-21/Software/CrapGame.tiff

--
Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
In time of war the devil makes more room in hell.
-- (a German proverb)

Scott David Daniels

unread,
Jul 22, 2008, 9:36:39 PM7/22/08
to
Erik Max Francis wrote:
> Ethan Furman wrote:
>
>> Iain King wrote:
>>> The story of a Real Programmer:
>>> http://www.pbm.com/~lindahl/mel.html
>>> Iain
>>
>> Wow. Awesome story.
>
> If my google-fu is up to snuff, these are "screenshots" (scans of
> printouts) of the actual blackjack game in operation:
>
> http://wps.com/projects/LGP-21/Software/LGP30-Blackjack1.jpg
> http://wps.com/projects/LGP-21/Software/LGP30-Blackjack2.jpg
>
> and here's a scan of a printout of some "source code" (machine language):
>
> http://wps.com/projects/LGP-21/Software/CrapGame.tiff
>
The high school I went to had an LGP-30, and I learned to program on it.
Rumor had it that a student from two years before me used to work late
in the lab, and allow the janitors to play blackjack, and it is further
rumored that he made a bit of money leaning on the transfer control
button.

--Scott David Daniels
Scott....@Acm.Org

Michiel Overtoom

unread,
Jul 22, 2008, 9:26:50 PM7/22/08
to pytho...@python.org
giveitawhril2008 wrote...

> I think someone should write a compiler, "Revenge of BASIC."

Your remark made an immediate association with me with the following soundtrack:

http://www.empire-of-the-claw.com/files/Empire%20of%20The%20Claw%20-%20Tranc
e%20of%20the%2080's%20Arcade.mp3

"A creature for my amusement"

Greetings,

--
"The ability of the OSS process to collect and harness
the collective IQ of thousands of individuals across
the Internet is simply amazing." - Vinod Vallopillil
http://www.catb.org/~esr/halloween/halloween4.html

Larry Bates

unread,
Jul 22, 2008, 11:40:52 PM7/22/08
to

I'm not sure I understand what you mean here. The code generation phase of the
top level compiler would have to generate assembler mnemonics instead of just
generating machine coded directly. At that point it should be just as easy to
generate machine code, unless you take advantage of macros, or other helpers
provided in the assembly phase.

My "compiler" work was way back on mainframes and the ones I worked with
definitely didn't produce assembler then needed to be run through the assembler.
They created likable objects directly. But that was over 30 years ago!

All this may be a moot point, because assembler is just a mnemonic
representations of machine language anyway.

-Larry

Larry Bates

unread,
Jul 22, 2008, 11:42:51 PM7/22/08
to
Marc 'BlackJack' Rintsch wrote:

> On Mon, 21 Jul 2008 18:12:54 +0200, mk wrote:
>
>> Seriously, though, would there be any advantage in re-implementing
>> Python in e.g. C++?
>>
>> 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?
>
> An operation that most people avoid because of the penalty of "shifting
> down" all elements after the deleted one. Pythonistas tend to build new
> lists without unwanted elements instead. I can't even remember when I
> deleted something from a list in the past.
>
> Ciao,
> Marc 'BlackJack' Rintsch

When I use os.walk and need to remove directories or files. Seems to be the
only way to do the in-place delete that is required. But you are right, it is
very seldom.

-Larry

Grant Edwards

unread,
Jul 23, 2008, 12:07:58 AM7/23/08
to
On 2008-07-23, Larry Bates <larry...@websafe.com`> wrote:

>> 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.
>
> I'm not sure I understand what you mean here. The code
> generation phase of the top level compiler would have to
> generate assembler mnemonics instead of just generating
> machine coded directly. At that point it should be just as
> easy to generate machine code, unless you take advantage of
> macros, or other helpers provided in the assembly phase.

Generating assembly language can be a lot easier than
generating machine code. One of the big advantage if you're
generating assembly language is you don't have to handle
relocation and address fix-up issues -- you can let the
assembler and linker take care of it. Letting the linker do
the final machine-code generation step also allows certain
optimizations that can't really be done by the compiler.

> My "compiler" work was way back on mainframes and the ones I
> worked with definitely didn't produce assembler then needed to
> be run through the assembler. They created likable objects
> directly.

There probably are plenty of compilers that do that. My
background is Unix and microprocessor stuff, and it could be
that for various reasons the "emit assembly" approach was more
common in that genre.

> But that was over 30 years ago!
>
> All this may be a moot point, because assembler is just a
> mnemonic representations of machine language anyway.

On many architectures, a particular mnemonic can end up being
translated into one of several slightly different machine
instructions -- for example a simple "jump" mnemonic might
generate any one of several instructions depending on how far
away the destination is located. If you've already got an
assembler and linker than know how to deal with that stuff,
then rather than duplicate the same functionality in the
compiler, one might just decided to emit a "jump mnemonic" and
a label.

--
Grant Edwards grante Yow! Wow! Look!! A stray
at meatball!! Let's interview
visi.com it!

Tim Roberts

unread,
Jul 23, 2008, 12:42:41 AM7/23/08
to
Larry Bates <larry...@websafe.com`> wrote:
>
>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.

Some do, some don't. It's an implementation chioce. gcc generates a text
file and pipes it to gas. The __asm__ directive just adds strings to the
assembler file.

Visual C++ generates machine language. The compiler has to include an
assembler for inline assembly.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

mk

unread,
Jul 23, 2008, 8:10:22 AM7/23/08
to pytho...@python.org
Marc 'BlackJack' Rintsch wrote:
> An operation that most people avoid because of the penalty of "shifting
> down" all elements after the deleted one. Pythonistas tend to build new
> lists without unwanted elements instead.

Which is exactly what I have done with my big lxml.etree, from which I
needed to delete some elements: constructed a new tree only with
elements I wanted. Sure, that works.

There _is_ a minor side effect: nearly doubling memory usage while the
operation lasts. 99% of the time it's not a problem, sure.

> I can't even remember when I
> deleted something from a list in the past.

Still, doesn't that strike you as.. workaround?

I half-got used to it, but it would still be nice not to (practically)
have to use it.

Enough whining. Gonna eat my quiche and do my Python. :-)


mk

unread,
Jul 23, 2008, 8:14:00 AM7/23/08
to pytho...@python.org
> 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.

Doesn't g++ translate C++ into C and then compile C?

Last I heard, most C++ compilers were doing that.


Matthieu Brucher

unread,
Jul 23, 2008, 9:06:34 AM7/23/08
to pytho...@python.org
2008/7/23 mk <mrk...@gmail.com>:

>> 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.
>
> Doesn't g++ translate C++ into C and then compile C?
>
> Last I heard, most C++ compilers were doing that.

GCC translates every language into its one as a tree, which is then
translated to assembly.

Matthieu
--
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher

Grant Edwards

unread,
Jul 23, 2008, 9:52:05 AM7/23/08
to
On 2008-07-23, mk <mrk...@gmail.com> wrote:
>> 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.
>
> Doesn't g++ translate C++ into C and then compile C?

No.

> Last I heard, most C++ compilers were doing that.

A decade or two ago there were some C++ front-ends that did
that, but I don't think it's common in modern C++ compilers.

--
Grant Edwards grante Yow! Oh, I get it!!
at "The BEACH goes on", huh,
visi.com SONNY??

Marc 'BlackJack' Rintsch

unread,
Jul 23, 2008, 10:11:41 AM7/23/08
to
On Wed, 23 Jul 2008 14:10:22 +0200, mk wrote:

> Marc 'BlackJack' Rintsch wrote:
>> I can't even remember when I deleted something from a list in the past.
>
> Still, doesn't that strike you as.. workaround?

No, I find it actually safer; I don't have to care where modifications of
the list might be seen elsewhere in the program.

Ciao,
Marc 'BlackJack' Rintsch

castironpi

unread,
Jul 23, 2008, 12:42:29 PM7/23/08
to

a[:]= newlist

and

a= newlist

have two completely different effects, and one is just as safe as
'del'. Besides, del isn't safe to be seen elsewhere in the program in
other threads, if they aren't locking the GIL.

Marc 'BlackJack' Rintsch

unread,
Jul 23, 2008, 1:10:58 PM7/23/08
to

As usual you are talking nonsense…

Ciao,
Marc 'BlackJack' Rintsch

castironpi

unread,
Jul 24, 2008, 1:37:52 PM7/24/08
to

As usual you are taking flamebait!

VernM

unread,
Jul 28, 2008, 6:58:38 PM7/28/08
to

Thank you giveitawhril2...!!

I haven't had so much fun reading a thead in years. Hilarious!!!!

Warren Myers

unread,
Jul 29, 2008, 3:45:27 PM7/29/08
to Dan Upton, pytho...@python.org
The OO overheads for C++ are almost non-existent.
http://www.informit.com/articles/article.aspx?p=1192024&ns=15058

On Mon, Jul 21, 2008 at 2:05 PM, Dan Upton <up...@virginia.edu> wrote:


> On Mon, Jul 21, 2008 at 1:21 PM, Marc 'BlackJack' Rintsch
> <bj_...@gmx.net> wrote:
>> On Mon, 21 Jul 2008 18:12:54 +0200, mk wrote:
>>
>>> Seriously, though, would there be any advantage in re-implementing
>>> Python in e.g. C++?
>>>
>>> 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?
>

> Aside (actual reply below): at least for a sorted LL, you're basically
> describing Henriksen's algorithm. They can asymptotically be faster,
> based on amortized analysis, but they're somewhat more complicated to
> implement.


>
>>
>> An operation that most people avoid because of the penalty of "shifting
>> down" all elements after the deleted one. Pythonistas tend to build new

>> lists without unwanted elements instead. I can't even remember when I


>> deleted something from a list in the past.
>>

>> Ciao,
>> Marc 'BlackJack' Rintsch
>
> The other side of the equation though is the OO-overhead for C++
> programs as compared to C. (A couple years ago we used an
> instrumentation tool to check the instruction count for a simple hello
> world program written in C (ie, main(){printf("Hello world!"); return
> 0;}) and Python (main(){cout<<"hello world"<<endl;return 0;}), and the
> instruction count was significantly higher for C++. I expect any sort
> of C++ objects you used to implement Python structures will be slower
> than the equivalent in C. So even if writing it in C++ would reduce
> the overhead for deleting from a list, I expect you would lose a lot
> more.
> --
> http://mail.python.org/mailman/listinfo/python-list
>

--

Warren Myers
http://warrenmyers.com

Tim Rowe

unread,
Aug 1, 2008, 8:53:32 AM8/1/08
to pytho...@python.org
2008/7/21 Krishnakant Mane <hack...@gmail.com>:

> First off all c# is absolute rubbish waist of time.

What a pity others are joining in this pointless language flame-war.

Look, I recently had to write a script for manipulating some data; I
struggled to organise it in Python and in C++, but when I tried C#
everything fell naturally into place and I had it done in next to no
time. Other times it has been Python or C++ that has been the most
natural way to express what I'm trying to do. Just because /you/
don't like C# doesn't mean it's rubbish or a waste of time; personally
I loathe Perl, but I respect the fact that a lot of programmers can
get good results very quickly in it.

I reckon that the programmer who only knows one language is like a
carpenter trying to make a cabinet with just a chisel. Ok for making
the joints (although a hammer would have been handy to hit it with),
not /really/ as good as a plane for getting large areas smooth, and
the blade keeps jumping out when you try to use it as a screwdriver...

The one-language programmer isn't really in a position to choose the
right tool for the job, because they only have one tool. Anybody who
says that a language in real use is a waste of time is denying the
reality of those who find it an effective tool. Similarly, anybody who
says that a language -- any language -- is right for all jobs plainly
doesn't understand that language design involves a lot of compromises,
and that the compromises that are appropriate choices for one task are
inappropriate for another. Python is a great tool. So is C#. You /can/
do the same job with either, but the smart move is to choose the one
that is best adapted to the task in hand.

--
Tim Rowe

0 new messages