AI programming


Someone told me that AI programming can be done with any programming language, provided that you are well versed. I read somewhere on the net that many Japanese robotics people use Perl to program their robots. There are those who use Java, C, Assembly, etc…

Now considering that Perl is a scripting language like Applescript and that applescript is the most powerful script language, or so someone said, can applescript be used for AI???

“applescript is the most powerful script language, or so someone said” – someone was wrong. Perl and Python are much more flexible and powerful. Languages that lend themselves to AI are “lisp-like”, Lisp being the usual language for AI development. (Just my opinion, by the way).

I tend to agree. AppleScript is powerful at scripting applications (the applications themselves deserve a lot of the credit, too), but it is not a very good general purpose programming language. I can sense a small bit of Lisp influence in the internals that I can almost “feel” from the surface of the language, but the real “power features” of most Lispy languages are really missing from AppleScript (in my opinion: convenient, first-class closures and Lispy macros; these are the features that let one “grow” a Lispy language to meet one’s problem domain).

I would agree that it is possible to do “AI” (which is a slippery term itself) in any language (I did some pseudo- machine learning in TMS9900 assembler a long time ago), but there are definitely some languages where it is going to be easier.

I apologise… I didn’t hear it from someone. Was just going through my applescript book and it was mentioned there. Why would a book mention that if it wasn’t true?
Anyways, if there is a way of importing Unix commands and C commands into applescripts, there should be a way of importing Lisp commands… right?

Has anyone ever tried to do AI with applescript before or am I the only one who thought of trying to do it???

I don’t know of any (which doesn’t mean much), but most of the AI stuff I’ve ever seen was extremely recursive and while recursion works in AppleScript, it’s easy to set up recursions that work, it is also easy to have them fail with a stack overflow [see this thread for some samples of recursion:] and they tend to be slower. Having said that, there’s no inherent reason you couldn’t do some AI stuff in AppleScript, but you might find it rather slow.

What if we made scripts to automate certain functions and then made a sort of manager that ran those scripts on command?? This would be the start… I guess… :lol:

Well I’m currently learning Applescript from a book and trying to learn Unix commands too. After this I’m gonna start on the AI stuff… If I’m the first to try… so be it. :cool:

A common approach to multidimensional scripts: a decision tree of some kind chooses appropriate handlers.

I thought of a script that would accept commands (text input / voice) and then perform the task running the appropriate scripts.

Quite possible – If a relatively stupid phone can do it, your Mac can.

One cannot blindly trust in everything that one reads. Maybe there was a specific context or implicit qualification to the comment in the book. I suspect that the context might have been application scripting, at which AppleScript performs quite well. But AppleScript is not the only language that can do application scripting these days. One person who is still active in parts of the AppleScript community has been working on application scripting (Apple Events) libraries for other languages like Ruby and Python.

“Scripting” means different things to different people. The same goes for “power” as a quality of programming languages in general. Unless the context is very well defined, it would be easy to find people that would argue over any statement about the relative power of various scripting languages (people will still argue over just about anything on Usenet).

There is do shell script for running shell scripts (and thus “unix” command line programs). As far as I know, the only ways of interfacing to C code are AppleScript Studio (XCode in AppleScript plus Objective C or maybe C++, C (or others?)) or writing a custom scriptable application or scripting extension (XCode in Objective C, etc.). While this is possible, I would not say that it is common or easy (but do not take my word for it, I have never done either). So some Lisp language could feasibly be accessed through the above methods, but I would hesitate to characterize doing so as importing Lisp commands into AppleScript. No more than say scripting Safari imports a web browser into AppleScript.

Try not to get hung up on Lisp/AppleScript/whatever. Neither Lisp nor AppleScript are appropriate for every possible task or project. That does not make the useful, just limits their practical scope.

Turing completeness implies that it is possible to do AI in AppleScript, it just might not be very practical. If doing AI in AppleScript is something that you really want to do, then go for it! Let us know how it goes and maybe we can help if you run into problems along the way.

let me give it a shot… Certainly would appreciate some help in case i get stuck.

I’ve seen robotic applications for Windows machines which learn as you use them. How are those like?? Are there any like that for mac???