I am going to try CGI scripting for implementing a web based Graphical User Interface on an embedded device. What advantages does LUA scripting have over shell scripting or C for implementing dynamic HTML files? Which one do you think is easy-to-use from developer's perspective.

My GUI will comprise of some form based HTML pages. Some times, I would like a C program to run corresponding to an action performed on the GUI and then display result of the program to the user on GUI. Will shell scripting suffice in such a scenario or will I 'have to' use LUA? I have some experience with shell scripting actually.

  • I think it fundamentally depends on the web server you have on such a system and what it supports. Jan 12, 2012 at 18:56
  • Umm it has an httpd builtin the busybox used. Actually, I tried simple examples of a C, LUA and shell script on the embedded device. All seem to work fine. I was thinking to go for shell scripting option if there is nothing outstanding being allowed by LUA or C because I am comfortable with shell scripting more.
    – Uthman
    Jan 12, 2012 at 19:01
  • Btw Haserl is there too on the device which uses shell or LUA to write cgi web scripts
    – Uthman
    Jan 12, 2012 at 19:09
  • Why Lua and not something designed for web apps, such as PHP? The resource usage? Jan 12, 2012 at 19:21
  • php is too big for embedded devices.
    – Uthman
    Jan 12, 2012 at 19:39

1 Answer 1


You can code CGI in any languages, and actually there are CGI applications coded in C or C++, in Lua, in Ocaml, in Perl or Ruby, even in Bash.

My feeling is that for an embedded system, C is the best choice (because the binary program would be small, and there is no need to add an interpreter).

But the language choice is up to you.

Of course, you should be aware of the limitations of CGI. the CGI program should run quickly, and you should make it store explicitly (in file or database) any persistent data to be shared from one HTTP request to the next.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.