Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Perl or Python? [It is decided: Perl]
Perl or Python? [It is decided: Perl]
Hello!
I have been thinking of switching from assembly to a high-level language and Perl and Python are quite interesting.. But I don't know which to choose.
My previous experience with assembly: You might think using assembly is very bad, and it might be, but I started a project about 2 years ago... This project was about making my own high-level language. Firstly, I added some basic macros and functions, then every day more macros and features, until I came this far. With 'this far' I mean that I got a very powerful macro and function set that I was able to do complex programs with ease. Ofcourse the sourcecodes got big, but as long as they work it's good.
And so, I have been programming in assembly, and it was a lot of fun, but then I discovered that the outputted binary would not work on all machines, so AMD users would have to say bye for my applications... That's why I need to choose my new language of choice.
Also, I have been getting serious about programming, because I have also bought a QT license. I think I'll use QT for my applications, but I think it might be time to test out the KDE libraries also.
What I would need in either Perl or Python:
1. Easily import so libraries and use their functions directly.
2. Use the native KDE (not QT) libraries to make GUIs.
3. Should be powerful enough to make some complex stuff like a 32-bit music sequencer.
Thanks! Every kind of help is highly appreciated!
I have been thinking of switching from assembly to a high-level language and Perl and Python are quite interesting.. But I don't know which to choose.
My previous experience with assembly: You might think using assembly is very bad, and it might be, but I started a project about 2 years ago... This project was about making my own high-level language. Firstly, I added some basic macros and functions, then every day more macros and features, until I came this far. With 'this far' I mean that I got a very powerful macro and function set that I was able to do complex programs with ease. Ofcourse the sourcecodes got big, but as long as they work it's good.
And so, I have been programming in assembly, and it was a lot of fun, but then I discovered that the outputted binary would not work on all machines, so AMD users would have to say bye for my applications... That's why I need to choose my new language of choice.
Also, I have been getting serious about programming, because I have also bought a QT license. I think I'll use QT for my applications, but I think it might be time to test out the KDE libraries also.
What I would need in either Perl or Python:
1. Easily import so libraries and use their functions directly.
2. Use the native KDE (not QT) libraries to make GUIs.
3. Should be powerful enough to make some complex stuff like a 32-bit music sequencer.
Thanks! Every kind of help is highly appreciated!
Last edited by thamarok on 2006-11-20 14:47, edited 1 time in total.
Well, I'm just a 'hobbyist' and haven't done alot of real advanced programming but I like Python. Perl is nice too but I haven't done enough of it to know if it's 'better' than Python.
I just want to remind you that both are interpreted languages and hench might not offer the required speed and efficiency you probably need for your music app.
As for your requirements; it's mostly over my head I'm afraid. I do have some knowledge about using Qt/ Python but that's about it...
Tina
I just want to remind you that both are interpreted languages and hench might not offer the required speed and efficiency you probably need for your music app.
As for your requirements; it's mostly over my head I'm afraid. I do have some knowledge about using Qt/ Python but that's about it...
Tina
I decided that I will use Perl for my programming.
The Wikipedia site helped me a lot to do the decision: http://en.wikipedia.org/wiki/Perl
Perl looks like it is exactly what I want. And what I like very much with it, is it's style as a script-language just like JavaScript, but the difference is, this one can be used also for applications, not only www-sites.
The Wikipedia site has also a link to a page with Perl optimization tricks, I think these are going to help me much. Also I can just look at the source of Perl Kana Editor to make my first Hello World! program.
Thanks to everyone who has read this post.
This post will destroy itself within 20 seconds. Don't panic; it's just a post.
The Wikipedia site helped me a lot to do the decision: http://en.wikipedia.org/wiki/Perl
Perl looks like it is exactly what I want. And what I like very much with it, is it's style as a script-language just like JavaScript, but the difference is, this one can be used also for applications, not only www-sites.
The Wikipedia site has also a link to a page with Perl optimization tricks, I think these are going to help me much. Also I can just look at the source of Perl Kana Editor to make my first Hello World! program.
Thanks to everyone who has read this post.
This post will destroy itself within 20 seconds. Don't panic; it's just a post.
Hi thamarok,
I realize that your choice has already been made, but I'll suggest Python anyway. To my mind, Perl is an absolutely great language for small projects that you jot together quickly to get a task done then throw away, whereas Python is more of a serious language for programs that you'd like to be maintainable. In other words: for writing programs, they are about equally suitable in general, but Perl is impossible to read some time after you've written it whereas Python is inducive to writing legible programs.
I realize that all of these are matters of taste, and that I maybe don't even write about them very eloquently, but Eric Raymond does at http://www.linuxjournal.com/article/3882; he also compares extensively with perl in that piece. Yes, this is the Eric Raymond from "The Cathedral and the Bazaar", which you should read if you haven't -- google it, first hit.
By the way, if you would decide to go with Python after all, optimizing python with psyco is laughably simple and amazingly effective.
HTH,
I realize that your choice has already been made, but I'll suggest Python anyway. To my mind, Perl is an absolutely great language for small projects that you jot together quickly to get a task done then throw away, whereas Python is more of a serious language for programs that you'd like to be maintainable. In other words: for writing programs, they are about equally suitable in general, but Perl is impossible to read some time after you've written it whereas Python is inducive to writing legible programs.
I realize that all of these are matters of taste, and that I maybe don't even write about them very eloquently, but Eric Raymond does at http://www.linuxjournal.com/article/3882; he also compares extensively with perl in that piece. Yes, this is the Eric Raymond from "The Cathedral and the Bazaar", which you should read if you haven't -- google it, first hit.
By the way, if you would decide to go with Python after all, optimizing python with psyco is laughably simple and amazingly effective.
HTH,
Thank you for your reply, I was waiting for it
I have already made some stuff with Perl, and it suits very good, and I would use Python, but it doesn't allow this:
I would have to do this in Python:
I have already made some stuff with Perl, and it suits very good, and I would use Python, but it doesn't allow this:
Code: Select all
$a="text";
print "Yeah, this is just some $a..";
And I love Perl now since I discovered perlcc, a command-line program to make Perl scripts into ELF binaries. If Python would allow that, then it might be also a good choice.a="text"
print ""Yeah, this is just some "+a+".."
Hi, thamarok.
I think perl can be seductive in its leniency -- you can type almost anything and it will do something.
I'm guessing that since you wrote a lot in assembly that you are a disciplined programmer. You are in a good position to develop good perl habits, and so you may want to avoid maintenance headaches by looking over Perl Best Practices. A lot of perl-folks think very highly of it ... cheers, drl
( edits: typos )
I think perl can be seductive in its leniency -- you can type almost anything and it will do something.
I'm guessing that since you wrote a lot in assembly that you are a disciplined programmer. You are in a good position to develop good perl habits, and so you may want to avoid maintenance headaches by looking over Perl Best Practices. A lot of perl-folks think very highly of it ... cheers, drl
( edits: typos )
Last edited by drl on 2006-11-23 15:25, edited 2 times in total.
["Sure, I can help you with that." -- USBank voice recognition system.
( Mn, 2.6.x, AMD-64 3000+, ASUS A8V Deluxe, 3 GB, SATA + IDE, NV34 )
Debian Wiki | Packages | Backports | Netinstall
( Mn, 2.6.x, AMD-64 3000+, ASUS A8V Deluxe, 3 GB, SATA + IDE, NV34 )
Debian Wiki | Packages | Backports | Netinstall
Hi,
As a small addendum: I have heard of programs similar to perlcc but for Python, but all they do, in effect, is package up the python interpreter with your program. And, by the way, I'd think the closest python comes to the perlism
is its own amazing type of string interpolation (sprintf-like):
which is (reportedly) more efficient than concatenation in addition to being more legible. To substitute multiple variables, use a tuple, as in:
Anyway, wishing you happy perl hacking ,
As a small addendum: I have heard of programs similar to perlcc but for Python, but all they do, in effect, is package up the python interpreter with your program. And, by the way, I'd think the closest python comes to the perlism
Code: Select all
$a="text";
print "Yeah, this is just some $a..";
Code: Select all
a="text"
print "Yeah, this is just some %s.." % a
Code: Select all
user="erik"
engine="google"
print "%s likes using %s" % (user, engine)
Thanks
Here are another two examples showing how Python and Perl communicate with STDIN:
Perl:
Python:
The above examples ask the user for their name and then the script prints out "Hello <name>!".
As you see, Python might be easier in this, but I like the Perl code more
It's actually about liking, not about performance, but that's me so just ignore this
Here are another two examples showing how Python and Perl communicate with STDIN:
Perl:
Code: Select all
print "What's your name? ";
chomp($in=<STDIN>);
print "Hello $in!\n";
Code: Select all
print "What's your name? "
a=raw_input()
print "Hello "+a+"!"
As you see, Python might be easier in this, but I like the Perl code more
It's actually about liking, not about performance, but that's me so just ignore this