fb39ca4 / picoc

Automatically exported from code.google.com/p/picoc
0 stars 0 forks source link

Ability to serve webpages #126

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
PicoC is small and could be ported to MIPS architecture and then used on 
routers based on Linux to parse small programs and parse web pages written in 
C. My idea is to create 2nd executable that would communicate through CGI with 
web server.
To make it easier it should parse only code between some tags (eg <% %>) and 
output everything outside:

<%
#include <stdio.h>

int main() {
%>
<html>
<body>
<% printf("Hello world!"); %>
</body>
</html>
<% } %>

Original issue reported on code.google.com by belli...@asiotec.org on 18 Feb 2011 at 9:24

GoogleCodeExporter commented 8 years ago
That's a really cool idea but I think it's outside the scope of picoc. Maybe it 
would make a good separate project though?

Original comment by zik.sale...@gmail.com on 18 Feb 2011 at 10:48

GoogleCodeExporter commented 8 years ago
Well, i think it even might be just a new parameter for parsing inside <% %> 
only. You could then set web server to call for picoc with that argument (eg. 
"picoc --web"). It's lightweight and might fit into many routers and other 
embedded devices. TO be honest i'm not sure if it would need to redirect the 
output to webserver somehow, or stdout would be enough, anyway seems to be not 
so many work with this. Most complicated would be in my opinion addind those <% 
%> tags.

You might be right that this is outside of picoc scope, but if someone decides 
to use it and also needs to serve some website, this would allow to abandon the 
use of additional parsers (eg. haserl or lua - 1st requires bash, 2nd has 
different syntax). PHP is similiar to C, but needs too many resources. I think 
picoc might fit here.

Original comment by belli...@asiotec.org on 19 Feb 2011 at 5:23