Is it possible to run a .lua file, or a .jar file?

"Lua can read the serial port, so one script is all you technically need."
Do you know how this would be done? No need for code, just an explanation. Thanks.