Linked by Eugenia Loli-Queru on Sun 18th Mar 2007 21:58 UTC, submitted by gorkem
General Development Python is becoming popular, and using Python within a distribution in every aspects has just become real. Pardus is extensively built on Python, starting from init subsytem through installation, hardware configuration and system management. Read on to see how Pardus developers started with Python and built a mature system using Python APIs.
Order by: Score:
Nicely done
by sukru on Sun 18th Mar 2007 22:42 UTC
sukru
Member since:
2006-11-19

I've always thought writing a configuration system in Python. Yet seems like I was lazy and they were not.

"In the current release of Pardus, package installation, system startup, display configuration, network and firewall configuration, user management, time and settings are all carried to the Comar. Scripts and graphical user interfaces are coded and running. More subsystems like power management and storage management are in progress."

This is also very efficient for network administration. (i.e: you'll not need to care about internal details when adding a user to a remote machine). If somehow "mainstream" distributions adopt these technologies, Active Directory like functionality will be default on Linux servers in no time.

RE: Nicely done
by unavowed on Sun 18th Mar 2007 23:57 UTC in reply to "Nicely done"
unavowed Member since:
2006-03-23

I agree, although I would prefer that they work on improving Python's efficiency a bit before it becomes more mainstream. Eventually it should run on the JVM or on Parrot, with some effort.

RE[2]: Nicely done
by sigzero on Mon 19th Mar 2007 01:05 UTC in reply to "RE: Nicely done"
sigzero Member since:
2006-01-03

Python does run on the JVM using Jython.

Python does run on the CLR using IronPython.

Python actually has a lot of optimised C code in a lot of it core modules which makes it one of the fastest "dynamic" languages.

RE[3]: Nicely done
by jayson.knight on Mon 19th Mar 2007 04:08 UTC in reply to "RE[2]: Nicely done"
jayson.knight Member since:
2005-07-06

"Python actually has a lot of optimised C code in a lot of it core modules which makes it one of the fastest "dynamic" languages."

Please don't confuse "written in C" with "it must perform well." There are so many other variables that factor into performance besides what language is used.

That being said, the numbers for IronPython compared to vanilla Python are quite dramatic (google IronPython performance) and it's written entirely in managed code (C# actually).

RE[4]: Nicely done
by CrLf on Mon 19th Mar 2007 13:04 UTC in reply to "RE[3]: Nicely done"
CrLf Member since:
2006-01-03

"the numbers for IronPython compared to vanilla Python are quite dramatic"

Try to do your own benchmarks before believing in those numbers... I did, and CPython beat IronPython in all my tests, hands down.

RE[4]: Nicely done
by sigzero on Mon 19th Mar 2007 14:23 UTC in reply to "RE[3]: Nicely done"
sigzero Member since:
2006-01-03

Please don't confuse "written in C" with "it must perform well." There are so many other variables that factor into performance besides what language is used.

Nobody was, I know I wasn't. The point is that it is generally "fast enough". If you want "raw" speed choose a different language.

RE[3]: Nicely done
by mdmkolbe on Mon 19th Mar 2007 11:16 UTC in reply to "RE[2]: Nicely done"
mdmkolbe Member since:
2005-09-15

While it may be one of the faster scripting languages (tied with Perl), it is still about 20 times slower than C. (All benchmarks are bogus but to get a sense of order of magnitude, see the Computer Language Shootout.)

That having been said, language performance probably doesn't matter that much in GUI or system control applications because most of the time will be spent waiting on the user or whatever sub-program is spawned to start or stop a service.

RE[4]: Nicely done
by Liquidator on Mon 19th Mar 2007 11:54 UTC in reply to "RE[3]: Nicely done"
Liquidator Member since:
2007-03-04

it is still about 20 times slower than C

That's probably right, but the end user doesn't see any difference between 20 ms and 1 ms.

RE[3]: Nicely done
by butters on Mon 19th Mar 2007 17:20 UTC in reply to "RE[2]: Nicely done"
butters Member since:
2005-07-08

Python does run on the JVM using Jython.

Python does run on the CLR using IronPython.


Python also runs on a JIT dynamic recompiler called Psycho.

RE[4]: Nicely done
by sbergman27 on Mon 19th Mar 2007 17:43 UTC in reply to "RE[3]: Nicely done"
sbergman27 Member since:
2005-07-24

Depending upon what you are doing psyco can make anything from no difference at all to an amazing one.

A while back I coded a very simple prime number generator in both C and Python. Both were coded the same way. I just used a basic "gcc -O3" for compiling the C code.

The C version was about 10x faster than the Python version. (Not too bad, all things considered.)

But when I turned on psyco, the python version ran about half as fast as the C, which I think is pretty impressive.

A horribly simplistic "benchmark", I know. But I thought it was pretty neat to see Python do so well in a tight loop. :-)

Unfortunately, x86 is the *only* architecture currently supported. (Not even X68_64 is supported.)

-Steve

RE: Nicely done
by butters on Mon 19th Mar 2007 17:34 UTC in reply to "Nicely done"
butters Member since:
2005-07-08

I've always thought writing a configuration system in Python. Yet seems like I was lazy and they were not.

This is the second major attempt at a Python-based administration system for Linux. The first formed the basis of Gentoo. It totally rocks in terms of functionality, although it's definitely a bit slow at times. This is mostly because they never quite figured out a good caching design.

Basically, an admin system is frequently going to be I/O-bound, and this is where the user is going to perceive slowness. Pick whichever language is easiest to write and maintain. Python is certainly among the very best in these respects. But you have to figure out a way to minimize and hide the cost of I/O. If you don't cache effectively, it wouldn't matter if you wrote it in hand-optimized assembly.

More worth it
by jessta on Mon 19th Mar 2007 12:07 UTC
jessta
Member since:
2005-08-17

Using python for more things makes it much more worth the hdd space and memory it requires.
The problem with having python,ruby,perl,php,mono,java etc. available to programmers is that they tend to replicate much of each other's functionality and are all rather large because they all have really large standard libraries.

Pardus is a great system
by Luis on Mon 19th Mar 2007 15:36 UTC
Luis
Member since:
2006-04-28

Pardus is an excellent distribution, really. One of the best out there IMHO.

The use of Python is a good idea. Performance (meaning speed) is not an issue. It does, however, require more memory than if things were written in C/C++, but still quite less than if they were written in Mono or Java.

It's funny that Python is one of the languages that "can save Gnome" (as they put it sometimes, referring to several higher level languages as opposed to C) and here it's, I wouldn't say saving, but serving a KDE based distro quite well too.

If higher level languages have to get more popular on the desktop, my vote goes for Python. Java is a great language, but it just uses too much memory. And Mono...well, I'm just not a fan of Mono.