Best scripting language?


EssoAir

Well-Known Member
Joined
Dec 13, 2012
Messages
1,822
Location
Knoxville/Seattle
What is the recommended scripting language for Angstrom? I have AppleScript on my Mac and AutoHotKey on my Desktop. Is there something that comes highly recommended for the Pandora?
 
Well I write my scripts in bash. There is a tool called Zenity for making guis for scripts.
 
Last edited by a moderator:
Most people would say bash or perl, but I actually often prefer Prolog as a scripting language (because it has a good parser and metacall).
 
Another one to consider is python.. it's pretty simple once you get past the need to precisely indent things.
 
Bash, perl, python, javascript.

I'd say python: easy to learn, easy to read (can't really say that of perl ;) ), many many tutorials out there. it's strict format teaches you to make very readable code etc.

And if you end up needing better performance there's cython and things like numpy/scipy to speed things up.

From there it's relatively easy to move to other languages (low or high-level).
 
Last edited by a moderator:
Actually bash is pretty simple. There is also gtkdialog for graphical apps in xml/bashscript.
 
Most people would say bash or perl, but I actually often prefer Prolog as a scripting language (because it has a good parser and metacall).
parser and metacall meaning.....?
-------

Damn broken quote boxes.

A parser is something to read in data in some syntax and build some abstract representation out of that (http://en.wikipedia.org/wiki/Parser#Parser). E.g. say you want to process some data file that looks like this:

'Jim' sold 530 of 'item foo'.

'Tom' sold 201 of 'item bar'.

'Tim' bought 1054 of 'item baz'.

Then in most programming languages you would spend some time to write code that reads in the data to convert it to something you can work with (like vectors of structs or something).

In Prolog you would just write something like

:- op(sold, xfx, 600).

:- op(bought, xfx, 600).

:- op(of, xfx, 500).

to declare the "keywords" of your "language", and that's it, from then on you can just read the file directly and write queries like "X sold Y of 'item foo'" to get answers like "X='Jim', Y=530", or write a program that does something with the data.

Having metacall is a kind of higher-order function (http://en.wikipedia.org/wiki/Higher-order_function) which allows you to very easily write meta-interpreters and things like that. E.g. if you want to write a Prolog interpreter in Prolog, you just have to write something like this:

main :- repeat, read(X), call(X), fail.
 
is there nothing simple like AHK and AppleScript?
They both sound horrible and I doubt you actually learn anything about programming from those languages (but that's probably me).

For simple scripting bash is probably 'best' if you just want simplicity and not get too much in to programming. Considering the pandora runs linux and you can tie everything together from the shell. You will also learn about what's under the linux-hood.

Still I would recommend something cross-platform so you'll feel you can use your skills everywhere.

(ok, you have bash on OSX as well I think, and of course there is win-bash or otherwise cygwin).

Maybe you should be more explicit about what it is you want to do. 'scripting' means many things to many people.
 
Last edited by a moderator:
is there nothing simple like AHK and AppleScript?
They both sound horrible and I doubt you actually learn anything about programming from those languages (but that's probably me).
 
For simple scripting bash is probably 'best' if you just want simplicity and not get too much in to programming. Considering the pandora runs linux and you can tie everything together from the shell. You will also learn about what's under the linux-hood.
Still I would recommend something cross-platform so you'll feel you can use your skills everywhere.
(ok, you have bash on OSX as well I think, and of course there is win-bash or otherwise cygwin).
 
 
Maybe you should be more explicit about what it is you want to do. 'scripting' means many things to many people.
Thank you! I think ill do that.

I'm by no means a programmer and I don't plan to be one any time soon, however, knowing how to script just seems so essential these days.
 
knowing how to script
What do you mean by this? As you said you already 'know how to script'.

If you want something to put on your resume then probably python is more valuable than bash (or most of the other languages suggested, except perl).

The point is: what do you want to do?
 
no no no no, I'm just saying that knowing how to automate tasks without an external application is something that everyone should know how to do, thats all
 
Back
Top