Multiplatform script interpreter/language
Hi all, I want to learn a new scripting language and now considering witch one. I have following requirements on it: - one which is ported on more platforms - Linux, Sun Solaris, Windows - easy to create a simple GUI - easy to parse a text files - easy to work with directories and files - easy to work with XML - even possible to make OS native API calls - ... - easy to learn ! I know that awk exist, something about Perl and Tcl. Perl and Tcl are ported on both Linux and W2K. Is Java Script M$ only? Do you know some URL where these languages are compared? Also with target OSs? Thanks a lot. Stanislav
Stanislav Valasek (Stanislav.Valasek@siemens.com) wrote:
Hi all,
I want to learn a new scripting language and now considering witch one.
I have following requirements on it: - one which is ported on more platforms - Linux, Sun Solaris, Windows - easy to create a simple GUI - easy to parse a text files - easy to work with directories and files - easy to work with XML - even possible to make OS native API calls - ... - easy to learn !
My favorite is Ruby. Try www.ruby-lang.org as a starter. Sincerely, Gour -- Gour gour@mail.inet.hr Registered Linux User #278493
I want to learn a new scripting language and now considering witch one.
I have following requirements on it: - one which is ported on more platforms - Linux, Sun Solaris, Windows
Perl, Tcl or Python
- easy to create a simple GUI
Tcl or Python
- easy to parse a text files
Perl, Tcl or Python
- easy to work with directories and files
Perl, Tcl or Python
- easy to work with XML
Perl, Tcl or Python
- even possible to make OS native API calls
Perl has 'syscall' which might do what you want. Tcl is extremely easy to extend with some custom C code. Not sure about Python in this respect. Platform independence and native OS API calls don't go together, as a rule.
- easy to learn !
Tcl.
I know that awk exist, something about Perl and Tcl. Perl and Tcl are ported on both Linux and W2K.
awk doesn't fit your criteria.
Is Java Script M$ only?
No, but that doesn't fit your criteria either.
Do you know some URL where these languages are compared? Also with target OSs?
Try google. The best answer to your stated requirements is Tcl. It's simple to learn, extremely powerful and has a great GUI building toolkit. I'd recommend the Activestate "ActiveTcl" package over the SuSE version, because that comes with the XML libraries, the Tclx OS extension, improved GUI libraries, the OO stuff, etc. It's also supported on the three platforms you name if you need to buy support. http://www.activestate.com/Products/ActiveTcl/ -- "...our desktop is falling behind stability-wise and feature wise to KDE ...when I went to Mexico in December to the facility where we launched gnome, they had all switched to KDE3." - Miguel de Icaza, March 2003
On Tue, 03 Jun 2003 13:26:31 +0200
Stanislav Valasek
Hi all,
I want to learn a new scripting language and now considering witch one.
Well Perl has some advantages over the others, in terms of practicality, not neccesarily being the best or easiest to learn. 1. There is an enormous source of pre-written code online for you to use and modify. 2. There is a large group of Perl Gurus who are online at such places as nntp.perl.org, http://learn.perl.org, and http://perlmonks.net. They will basically answer your questions for free, and usually within a matter of hours of asking it. 3. There is a huge collection of modules for doing different tasks at http://cpan.org. The other languages may be good or even better than Perl at certain things, but the above reasons should point you toward Perl. -- use Perl; #powerful programmable prestidigitation
zentara
On Tue, 03 Jun 2003 13:26:31 +0200 Stanislav Valasek
wrote: The other languages may be good or even better than Perl at certain things, but the above reasons should point you toward Perl.
"Python is what Perl should have been." A rough metric: How many people have switched from Perl to Python. A: Many. How many people have voluntarily switched from Python to Perl? A: One was reported, but upon investigation, he could not be found. ;) Python has lots of modules and a large code base also. Not as large as Perl's but enough to help a great deal. Python versus Perl Of the languages discussed here, Python is closest to Perl. The two can be used in similar roles, although the philosophies that determined the designs of the languages are quite different. I knew and liked Perl long before I knew Python. I now use Python for everything I previously used Perl for, so that should give you some idea what this section will say. Without being critical of Perl, I believe Python is the natural successor to Perl. Both languages offer lists, hash tables, object-oriented programming, excellent string handling, and other high-level features. The major difference is conceptual simplicity. Python was built from the ground up as an extensible, structured, object-oriented language; it draws on languages such as C++ and Modula-3 for foundations. Perl was built originally as a replacement for UNIX shell languages, and draws on languages such as Bourne shell, sed, and awk for inspiration. Higher-level features were added later, as it became apparent that the language was being used in areas far beyond what had originally been envisioned. This difference shows up in many aspects of the two languages: In Python, everything -- numbers, strings, lists, hashes, file-objects, and compiled code -- is an object, and can be passed around easily; in Perl, lists and hashes must be cast to scalars to pass them into a function, and then they must be cast back to lists or hashes to be used. In Python, exceptions and exception handlers are an integral part of the language; Perl can achieve the same effect only by encapsulating a call in an eval statement, which produces more awkward code. In Perl, only a string may be used as a key into a hash table; in Python, almost anything can be used. Passing arguments into functions is cleaner and more powerful in Python than in Perl; Python permits named arguments, default argument values, and an number of other things that Perl does not provide. The above is part of the language comparisons in _The Quick Python Book_.
"Python is what Perl should have been."
The Perl6 team are currently redesigning the base language and they aren't making it look like Python.
A rough metric: How many people have switched from Perl to Python. A: Many. How many people have voluntarily switched from Python to Perl? A: One was reported, but upon investigation, he could not be found. ;)
We look forward to seeing the evidence to support these two statements. :o)
Python has lots of modules and a large code base also. Not as large as Perl's but enough to help a great deal.
Python doesn't have anywhere near the depth of module support that Perl has. It's easy to talk up what Python has in this regard, but only if, as in the quote above, one conveniently ignores what Perl has.
Python versus Perl
The above is part of the language comparisons in _The Quick Python Book_.
...and is therefore completely and totally biased. Python has much better structure than Perl, and therefore makes a better language for writing large programs and applications. Perl is much tighter, and has a much more efficient syntax. That makes it harder to master, but also makes it a much more efficient tool for a programmer who needs to solve a specific limited problem quickly. I've used Perl for years and Python quite a lot more recently. So far, IMHO, the only thing which Python is obviously better at is building GUI based applications. Python/Qt is a superb combination of power and simple convenience. Python was also much easier to learn. The answer to the original poster's question, though, is still Tcl. For simplicity and power for solving general problems, as well as GUI work, it leaves both Perl and Python standing. -- "...our desktop is falling behind stability-wise and feature wise to KDE ...when I went to Mexico in December to the facility where we launched gnome, they had all switched to KDE3." - Miguel de Icaza, March 2003
Derek Fountain
"Python is what Perl should have been."
The Perl6 team are currently redesigning the base language and they aren't making it look like Python.
This is a surprise? Betting on a tiger becoming spotted is not a good bet.
A rough metric: How many people have switched from Perl to Python. A: Many. How many people have voluntarily switched from Python to Perl? A: One was reported, but upon investigation, he could not be found. ;)
We look forward to seeing the evidence to support these two statements. :o)
One could do a poll in the relevant newsgroups. I'm too lazy.
Python doesn't have anywhere near the depth of module support that Perl has.
Have you run into a situation where there is no appropriate module for Python but there is for Perl? Of course such situations are possible, but I wonder how often they occur?
The above is part of the language comparisons in _The Quick Python Book_.
...and is therefore completely and totally biased.
He was fluent in Perl and gave it up for Python. Then he wrote a book about Python. Does that make his viewpoint worthless? I don't think so.
Python has much better structure than Perl, and therefore makes a better language for writing large programs and applications. Perl is much tighter, and has a much more efficient syntax. That makes it harder to master, but also makes it a much more efficient tool for a programmer who needs to solve a specific limited problem quickly. I've used Perl for years and Python quite a lot more recently. So far, IMHO, the only thing which Python is obviously better at is building GUI based applications. Python/Qt is a superb combination of power and simple convenience. Python was also much easier to learn.
"Tight" syntax facilitates writing unmaintainable code. It's excellent for throw-away scripts, though, and Harms says as much in his book.
The answer to the original poster's question, though, is still Tcl. For simplicity and power for solving general problems, as well as GUI work, it leaves both Perl and Python standing.
I don't follow this conclusion because, IMO, the poster didn't give enough information to conclude that Tcl is his best choice. What if he needs more than small programs? Tcl then becomes a suboptimal choice. Harms ranks 7 languages in 7 categories, and the only 2 where Tcl ranked above Python is in GUI coding and development environment. Python ranked above Tcl in 3. Do you disagree with his assessment? The bottom line for me is that the original poster should look at Perl, Python, and Tcl and make his own choice. -rex
"Python is what Perl should have been."
The Perl6 team are currently redesigning the base language and they aren't making it look like Python.
This is a surprise? Betting on a tiger becoming spotted is not a good bet.
Exactly. Nothing wrong with the tiger. Stripes work for a lot of things. So the quote is garbage.
Have you run into a situation where there is no appropriate module for Python but there is for Perl? Of course such situations are possible, but I wonder how often they occur?
Yes. I used to write scripts which tested RAID arrays, and I had lots of useful code for Perl which other people had written, which I've never been able to find in Python. (I haven't looked hard recently, mind you.) For middle of the road stuff, Python is definitely an option. For anything weird (and I'm always attracted to weird problems), CPAN is the first port of call.
He was fluent in Perl and gave it up for Python. Then he wrote a book about Python. Does that make his viewpoint worthless? I don't think so.
Nope, me neither. Never said it was. But it doesn't make him right either. I'm fluent in Perl, and wouldn't give it up for Python. In some cases Perl is the best answer. Anyone who gives up a current and useful skill on the basis that something else has replaced it has clearly missed something. Perhaps he'll change his mind when he needs to write 150 RAID array test scripts? I find Python's main feature - object orientation - to be a total hinderance a lot of the time. Some problems just lend themselves to OO - GUI design is the best example, which is why I favour Py/Qt over Tcl/Tk for much GUI work these days. However, I find many - most? - of the problems I deal with have procedural solutions which are just as natural, if not more so than OO ones. Python forcing me to think in objects all the time, when I want to think: do this, then this, then this, often makes me veer towards Perl or Tcl.
"Tight" syntax facilitates writing unmaintainable code.
True, but that doesn't mean you have to! People can write crap code in any language.
I don't follow this conclusion because, IMO, the poster didn't give enough information to conclude that Tcl is his best choice. What if he needs more than small programs? Tcl then becomes a suboptimal choice. Harms ranks 7 languages in 7 categories, and the only 2 where Tcl ranked above Python is in GUI coding and development environment. Python ranked above Tcl in 3. Do you disagree with his assessment?
I haven't seen his assessment in full, but it sounds like I would, yes. For as start, I think Python/Qt is a better choice for large (and sometimes small) application GUI work than Tcl/Tk! The OP gave his critiera, and didn't mention program size, so I had to assume it wasn't relevant to him. I based my judgement on what he said was relevant. I answered the question he asked, and my answer, given that critiera set, is still Tcl.
The bottom line for me is that the original poster should look at Perl, Python, and Tcl and make his own choice.
Agreed. But he asked for guidance and that's what I tried to give. You shouldn't get me wrong here. Python is among the 5 scripting languages which I know and use on a regular basis. I like it, and it's my first choice for some types of work. What I really have a problem with is people who argue that there's one "best" language, or that other languages should be dropped in favour of another in all circumstances. What we'd call "religous arguments" if you like. -- "...our desktop is falling behind stability-wise and feature wise to KDE ...when I went to Mexico in December to the facility where we launched gnome, they had all switched to KDE3." - Miguel de Icaza, March 2003
On Wed, 4 Jun 2003 19:32:23 +0800
Derek Fountain
"Python is what Perl should have been."
The Perl6 team are currently redesigning the base language and they aren't making it look like Python.
This is a surprise? Betting on a tiger becoming spotted is not a good bet.
Exactly. Nothing wrong with the tiger. Stripes work for a lot of things. So the quote is garbage.
Have you run into a situation where there is no appropriate module for Python but there is for Perl? Of course such situations are possible, but I wonder how often they occur?
From what I'm reading about Perl6 development, it is to be based on the "parrot engine", which will allow incorporation of python code seemlessly into perl6 scripts. That would make Perl6 more of a mongoose, than a tiger. :-)
-- use Perl; #powerful programmable prestidigitation
On Wednesday 04 June 2003 01:46, rex wrote:
Python versus Perl <snip> The major difference is conceptual simplicity. Python was built from the ground up as an extensible, structured, object-oriented language; it draws on languages such as C++ and Modula-3 for foundations.
This is true.
Perl was built originally as a replacement for UNIX shell languages, and draws on languages such as Bourne shell, sed, and awk for inspiration.
This is not true. The argument would be more appropriate that Perl was built from the ground up as a more accessible (hence its replication of some shell-like features and the ease of using regular expressions) tool than the C language from which much of its syntactical constructs are derived. It is far closer to C in concept than it is to shell languages. A more accurate summary of the differences would be to compare the use of C (with its analagous partner being Perl) versus the use of C++ (with its partner being Python). That difference plays itself out in the choice of one language (Python) being more useful for larger projects, due to its object-oriented foundation (OOP has always seemed much more contrived in Perl, much more natural in Python); similarly, Perl is much more useful than Python for smaller, more procedural tasks where one doesn't want to have to bother with the overhead of OOP. Each language has its merits.
The above is part of the language comparisons in _The Quick Python Book_.
The "Gospel according to Python," no doubt? : ) - Thomas Long -- Using SuSE Linux 8.2
On Wednesday 04 June 2003 01:46, rex wrote:
Python versus Perl <snip> The major difference is conceptual simplicity. Python was built from the ground up as an extensible, structured, object-oriented language; it draws on languages such as C++ and Modula-3 for foundations.
This is true.
Perl was built originally as a replacement for UNIX shell languages, and draws on languages such as Bourne shell, sed, and awk for inspiration.
This is not true. The argument would be more appropriate that Perl was built from the ground up as a more accessible (hence its replication of some shell-like features and the ease of using regular expressions) tool than the C language from which much of its syntactical constructs are derived. It is far closer to C in concept than it is to shell languages. A more accurate summary of the differences would be to compare the use of C (with its analagous partner being Perl) versus the use of C++ (with its partner being Python). That difference plays itself out in the choice of one language (Python) being more useful for larger projects, due to its object-oriented foundation (OOP has always seemed much more contrived in Perl, much more natural in Python); similarly, Perl is much more useful than Python for smaller, more procedural tasks where one doesn't want to have to bother with the overhead of OOP. Each language has its merits.
The above is part of the language comparisons in _The Quick Python Book_.
The "Gospel according to Python," no doubt? : ) - Thomas Long -- Using SuSE Linux 8.2
participants (6)
-
Derek Fountain
-
Gour
-
rex
-
Stanislav Valasek
-
Thomas Long
-
zentara