Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5652

General • Re: Tcl on Pico?

$
0
0
The smallest interpreted language that found actual use in a lot of apps is Lua [1], which is still quite popular in games and in apps, but it never became a defacto standard anywhere. The Brazilian founders don't do empire-building, so Lua is much less visible than languages who do empire-building.

If you trim Lua, you can get it well under 200KB. Remove the front end, keep the interpreter (meaning you are just running bytecode and need to compile the script to bytecode elsewhere) then it can probably get down to about 100KB. I actually like Lua better than Python but Python obviously has complete facilities for everything so Python will always win in the marketplace.
Very much in favour of Lua for embedded systems - the eLua project was a great help in getting started, although the authors of that project wouldn't recognise the finished item.
For us, a great strength is that it is straightforward to add custom instructions which call routines written in C/C++ (no idea about doing this with Python). So we use it essentially as a top-level control layer stringing together functional blocks. Currently we have it generating web pages for a simple web server - makes it very simple to tweak layouts and so on. And we have a current project that uses an internally-written crude interpretor for some functionality - for the next generation that will be replaced by Lua calling various blocks; makes it much simpler to do 'maths' and conditionals which would otherwise have to be specifically coded. And 'ad-hoc' commands can be run from a user prompt - can save adding specific code for debug and monitoring.

Main downside of Lua in an embedded environment is that it uses garbage collection. Also not yet determined if its possible to have the bytecode program in read-only memory (rather than RAM), since RAM is usually a more constrained asset on embedded processors.

Statistics: Posted by stevend — Thu Nov 21, 2024 1:21 pm



Viewing all articles
Browse latest Browse all 5652

Trending Articles