Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question
    
I think it fundamentally depends on the web server you have on such a system and what it supports. –  Dipan Mehta Jan 12 '12 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. –  baltusaj Jan 12 '12 at 19:01
    
Btw Haserl is there too on the device which uses shell or LUA to write cgi web scripts –  baltusaj Jan 12 '12 at 19:09
    
Why Lua and not something designed for web apps, such as PHP? The resource usage? –  GrandmasterB Jan 12 '12 at 19:21
    
php is too big for embedded devices. –  baltusaj Jan 12 '12 at 19:39
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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