From my perspective, Java has, effectively, structs (well defined groups of data) and a few primitive types, and a class system which is dead simple. It's tiny, comparable to Lua imo.
It's more restrictive, sure, but the dynamic-ness of Javascript is a hindrance when it comes to language spec because the base language functions need to be able to interpret all the different primitive types. There's stacks and stacks of corner cases to remember while Java just says "Nope, wrong type".
Comparable to Lua? :)
Yes, comparable to Lua. I'd probably not say it's smaller than Lua but I would say it's not greatly larger than it.
Ah ok, well I can see why we have differing opinions because that's exactly what I mean :)
I mean base language including corner-cases, not any of the libraries (even if they're included in the SDK). I think they'd both be huge if we included libraries, since I'd lump in DOM manipulation and something like JQuery into Javascript if Java gets the SDK libraries.
Another example, in Java Classes are not objects that can be manipulated, they require a special form (generics) for that. In JavaScript a "class" is just a function that has some default properties attached.
This description doesn't tell the whole story, leading people to a false conclusion of simplicity.
When it comes to JavaScript arrays, a lot of magic is happening under the covers that doesn't happen with non-array objects. Good JavaScript developers need to know those details, and that counts as complexity.
You're doing people here a disservice by leaving out relevant information.
You're leaving out prototypes which I find much more complicated than Java Classes.