Lua OOP can do information hiding and technically is encapsulation.
It can also implement inheritance and overriding, but it's not as strict.
A lot of the OO strictness of languages like Java actually comes from the compilation side of things. Java bytecode instructions are defined to work on 'classes', thus they are in flux depending on what kind of class you create. This means that for the most part you could pretty much compile Lua to Java bytecode and Java to Lua bytecode, you would just have to make the compilers limit certain aspects (I'm fairly certain access such as private and final are compiler implemented and you could ignore them if you wrote pure Java bytecode).
True that. But as you said, there are quite a few things that'd have to be established before you can use it as such.
I don't fully agree that the strictness of Java is just due to the compilation side of things, as you have said. Java was created with just such strictness in mind (regarding the OOP aspect with its classes, etc.) as its OOP orientation was one of its design-concepts.
As it is right now, Lua isn't an OOP language per design and you have to do hacky tricks to simulate OOP with it.
You could actually write an OS in Lua providing you have a compiler that can compile Lua to native machine code.
I wholeheartedly agree. You can actually do that - in principle - with any programming language, provided you have a compiler that can compile it to native machine code.
But there's the rub, though. Provided you
have a compiler that can actually do that. ^_^/>
Mind you though that I'm specifically talking about programming languages that weren't designed for low level processing.
Since anything is possible in principle (to a degree), I'm generally talking about programming languages the way they were made or intended.
I admit that it might sound a bit defensive, so let me just add that - in the case of Lua - I'm actually aware that there's an attempt at a
Lua OS. (I hope this doesn't encourage the wrong people :wacko:/>)
So yeah, stuff like that
is always possible in principle.