You are not logged in.
Hi,
sorry for the unspecific title, I couldn't think of a better summary.
The problem is this: I have written a script to encode a DVD to H264 and Vorbis. Since it basically just performs some (OK, by now: A lot of.) management and then calls a external programs, Bash was the obvious choice.
However, the administrative stuff the script does (evaluating user input, calculations etc.) was already a nightmare to code in Bash (lack of arithmetic, lack of data types, proper functions, lack of c-like structs etc.), and I now want to make it even more flexible in what the user (me) can ask of it (it's also going to use a config file, which is another thing that gets ugly fast). Frankly, I can't stomach that.
So the question is this: What language would be sensible for a program the most important function of which is calling other programs?
Simply executing them from the main program isn't enough, unfortunately, because I want to make use of multicore system by for example simultaneously extracting streams and encoding them (right now that is done through named pipes), ideally I'd need a way to multithread not internal functions/routines but external programs (Through pipes or whatever).
I'd prefer an interpreted language, but it's not a requirement.
My ship don't crash! She crashes, you crashed her!
Offline
Since you're translating from bash Perl might be a good choice. For parallel execution it's got thin wrappers around the 'fork' and 'socket' system calls.
Offline
I second Perl. If you're doing particularly hairy logic Python may be a better choice for its clarity, but it will be slightly more verbose and require some more thought than the equivalent Perl script.
Offline
I second what peets said. Perl is definitely you're best option here, in my opinion anyways. It has the best (by which I mean easiest) system interface of any scripting langauge I've worked with, and if you want a simple configuration file reader, perl's regex'es are king. Perl also takes a lot of features from the shells, such as the file test operations. If the project get's really big and hairy though, it might be worth considering python as a cleaner, stricter alternative.
Hope that helps!
Offline
I too prefer Perl as a shell scripting language, even though I am comfortable in Python. Perl is just more concise for small tasks like this.
Offline
Unanimous consent! Thanks a bunch, Perl it is, then. It's always nice to learn a new language ...
My ship don't crash! She crashes, you crashed her!
Offline