3 ms·
For example, I'm working on a dashboard for wifi routers that displays information beyond what is provided by OpenWRT's ubus system. We're get this information
by woah 10y ago
For example, I'm working on a dashboard for wifi routers that displays information beyond what is provided by OpenWRT's ubus system. We're get this information from the kernel, but it needs to be converted to JSON to be consumed by the dashboard frontend. Right now, I'm converting the information to JSON using Go, but there are some platforms that Go can have problems compiling binaries for. We have also written a lot of C for these routers, but doing this kind of thing in C would just be overly cumbersome. Shell could be an option, but it is also cumbersome. Lua could be an option, but I don't know much about it and I don't know how well it supports JSON. Most other developers that will work on this don't know much Lua either.
mJS might also be an option. I don't really see what's wrong with that if we have the space for it.
This can probably get types from Flow, since it is valid es6. Flow has no compilation step or runtime component.
You may have a point about the debugging, but JS is pretty easy to debug by printing to stdout.
- etiene 10y agoLua is the easiest language to learn I ever saw. It has a fantastic json support with the cjson library (https://luarocks.org/modules/luarocks/lua-cjson https://luarocks.org/modules/luarocks/lua-cjson). It's there by default on many firmwares. Do check the docs for nodemcu, for example: https://nodemcu.readthedocs.io/en/master/ https://nodemcu.readthedocs.io/en/master/ (a firmware for the ESP microcontrollers) Not to mention Lua itself can be used as a data / configuration language, their tables syntax is made especially for that. Normally when I work with Lua I don't feel the need to embed any other parsers for configuration, but cjson is there if you want.