473,783 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Written in C?

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.
Jul 20 '08
61 6963
Bruno Desthuilliers wrote:
gi************* *@gmail.com a écrit :
(snip clueless nonsense)

Surely a troll... No one on earth can be *that* clueless.
I disagree he has upper management written all over him.

--
mph
Jul 21 '08 #21
On Jul 20, 3: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....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.
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
Jul 21 '08 #22
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.

Jul 21 '08 #23
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
Jul 21 '08 #24
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 "programmme r" 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.

Jul 21 '08 #25
mk
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?
Jul 21 '08 #26
Roy Smith <ro*@panix.comw rote:
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-

Jul 21 '08 #27
In article <cq************ *************** ***@speakeasy.n et>,
Erik Max Francis <ma*@alcyone.co mwrote:
gi************* *@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#.

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
Jul 21 '08 #28
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
Jul 21 '08 #29
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;re turn 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.
Jul 21 '08 #30

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1564
by: David Stockwell | last post by:
Hi, Today I was in a meeting and someone mentioned they were looking for some software whereby they could run their own fax server (ie a computer with a modem, someone sends a fax, and the software convertes it to an image and drops it in an email box). I'm posting this here incase someone happens to know of a python implementation or other language implementation that is either free or for sale? If so, I'd like to know where to get...
0
1652
by: thomasasta | last post by:
Hey there is a new python written open source bit-torrent client out. Don´t mit it up with brams c++ bittorrent, in python it is bit-torrent.sf.net Don´t forget the minus - http://bit-torrent.sourceforge.net/ It´s out till 10 days and the code is open source, so you can add it to any other application in python like CyberSpace or any other app !
4
1791
by: Michiel Overtoom | last post by:
Giveitawhril wrote... No: Real programmers first eat a quiche and then return to their Pascal programming. C is alive and kicking. Every language has its place. Plus, there exists implementations of Python written in Python itself;
0
1276
by: Phil Runciman | last post by:
On 20 jul, 19:50, giveitawhril2...@gmail.com wrote: ".. 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....
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.