Dan Thomas puts it very well and carefully - but perhaps what people mean by ‘language’ depends on their background:
- In technical terms, language will mean a syntax and an interpreter or compiler
- From a consumer perspective, it may mean something like a product.
Both usages are understandable, and perhaps we can skip jostling over them by avoiding the word ‘language’ and simply looking at:
- Syntax and interpreter
- Embedding
- Libraries
Syntax and interpreter
The syntax and interpreter used (at the moment) by JXA is the Safari 9 ES 5 JavaScript interpreter
http://kangax.github.io/compat-table/es6/#safari9
(one would hope that MacOS Sierra will be adopting the ES 6 Safari 10 JavaScript interpreter, which brings tail recursion optimisation, simpler lambdas, etc etc).
http://kangax.github.io/compat-table/es6/#safari10
Embedding
JavaScript is an embedded scripting language, and Apple’s interfaces include the JSContext interface for embedding a Safari JavaScript execution environment into various applications. Safari and JXA embed the same build of the same JavaScript interpreter in different contexts - one in a browser, one in a JSContext accessible to Script Editor, osascript etc.
Libraries
JXA’s JSContext doesn’t include the web object libraries in Safari’s JSContext, but it has one library object of its own: the Automation library object.
The contents of this are:
Automation
Application
currentApplication
Library
ObjC
$
Ref
equals
bindFunction
block
deepUnwrap
dict
import
interactWithUser
registerSubclass
super
unwrap
wrap
ObjectSpecifier
Path
Progress
delay
getDisplayString
initializeGlobalObject
log
(You can generate this listing yourself by running the following code in Script Editor, which will place it in the OS X clipboard.)
var strClip = (function () {
'use strict';
var lstSeen = ['Automation'];
function keyTree(o, strIndent) {
var indent = strIndent || '',
ks = Object.getOwnPropertyNames(o)
.filter(function (k) {
return (['name', 'prototype', '__private__']
.indexOf(k) === -1 &&
lstSeen.indexOf(k) === -1) ? (
lstSeen.push(k),
true
) : false;
})
.sort();
return ks.length ? (
ks.map(function (k) {
return indent + k + '\n' + keyTree(o[k], indent +
' ');
})
.join('')
) : '';
}
return 'Automation\n' + keyTree(Automation, ' ');
})();
var a = Application.currentApplication(),
sa = (a.includeStandardAdditions = true, a);
sa.setTheClipboardTo(strClip);
strClip