JavaScript is a nice simple language, used in almost all web browsers. And it is not limited to your browser, it is also ideal for scripting apps. The benefits of using JavaScript as a scripting language are many. JavaScript has a large base of people who have come into contact with it and are used to using it. It is a simple an nice clean language (when separated from browser issues and DOM inconsistencies). And it is very simple to integrate. Here's a flavour of what JavaScript looks like:
function myFunction() { return ("Hello, have a nice day!") } document.write(myFunction())
This tutorial shows how to script Cocoa using JavaScript. The code in this tutorial is taken from a simple turtle drawing app that uses JavaScript to control a turtle that draws in an NSView. The final program and source code is available to download here. A screenshot of the final result is below.