[NTLK] NewtonScript and Lua
m.melcher at robowerk.de
Tue Mar 1 06:21:20 PST 2022
Just a hint for future NewtonScript programmers :-) . The language "Lua" is based on the same concepts as NewtonScript.
Both languages were developed around the same time, and both have almost the same features. The main difference is, that Lua is now a quite popular language with a ton of support on the 'net. It's tiny (as is NewtonScript) and interfaces easily with many other languages.
Lua today is often used in games where the main game engine is high efficient C and C++ code that is optimised and hard and time consuming to compile and build. Lua OTOH is a script language, and scripts can be easily modified without the need to compile or build anything. This gives an extremely fast turn-around time, so Lua is used for character behaviours, and overall game strategies.
It's the same on our MPs: the hard graphics work is done in C/C++ in the ROM, but the easier stuff, strategies, databases, user experience, is done in NewtonScript. And as with any script language, Lua and NS can generate and run their own script code.
So, if you find the NewtonScript documentation outdated and difficult to read, and don't feel like fuzzing with NTK on an emulator, but you still want to learn a programming language, then Lua may be a great start.
There is tons of documentation, many YouTube videos, and many resources all over the web. Heck, Lua even interfaces to the GUI library FLTK, so you can build your own graphical applications as well.
And I promise you, if you understand Lua, moving to NewtonScript is super easy (barely an inconvenience...), and you will be writing Apps for our Gren Friend in no time.
More information about the NewtonTalk