4 ms·
In 2010 I worked on building a "dynamic" web app that would run on a very tiny embedded device -- no MMU, about 130 bogoMIPS. Think of an old wireless router yo
by lxe 8y ago
In 2010 I worked on building a "dynamic" web app that would run on a very tiny embedded device -- no MMU, about 130 bogoMIPS. Think of an old wireless router you have at your parents' place.
There aren't that many options for building a "modern" web backend on something like this -- the most popular being C compiled into executable(s) served via thttpd and CGI.
Things like templating, or JSON parsing for that matter, would be much easier in something higher level than C, but python, PHP, node, etc are simply too huge and slow.
I discovered Lua, and it fit the niche exceptionally well. The syntax and the data structures takes a while to get used to, but once you do, they feel rather powerful, especially for such a lean interpreter. It compiles into something like a 120k statically linked executable and is (relatively) phenomenally fast -- not only for the tiny computer on which I had to run it, but also for me, who had to write a complicated web app using it. I almost felt like a demoscene developer -- I was able to run something that would otherwise require a full featured machine on a tiny embedded board. Even to this day, LuaJIT, OpenResty, Lapis remain up there on the benchmark tables when it comes to web apps.
- slezyr 8y agoYou can run PHP on router with 3Mb of storage and 64Mb of ram. http://ph7.symisc.net/ http://ph7.symisc.net/ DIR-320 Used php for it's GUI.
- seppel 8y agoBack in 1998, Apache, PHP, Mysql and Netscape 4 did fit into 16 MB of RAM :)
- CharlesW 8y ago> Things like templating, or JSON parsing for that matter, would be much easier in something higher level than C, but python, PHP, node, etc are simply too huge and slow. FYI, there are some nice (small, performant) JavaScript runtimes now. A typical Moddable[1] xs engine app needs less than 200KB of ROM, runtime included, and a few dozen KB of RAM to run. [1] http://www.moddable.com/ http://www.moddable.com/