3 ms·
So is the only benefit of wasting that space and CPU so you can bill your platform/project/whatever as being "js" and C/C++-free? What does a no standard librar
by ComputerGuru 10y ago
So is the only benefit of wasting that space and CPU so you can bill your platform/project/whatever as being "js" and C/C++-free? What does a no standard library JS buy you over a no standard library C++11 everyone else is using these days, besides the pain and trouble of dealing with a dynamically typed language without native debugging support?
Why is there so much stigma against _learning_ to code in something other than $favlang these days? Most hard core developers I know appreciate the importance of using the right tool for the job, I don't see embedded/desktop developers shying away from using whatever the native toolkit/language is for their chosen platform and instead shoehorning $x to fit as much as we see this constant trend to try to use "web tech" everywhere. (Scripting in embedded systems has long been a solved problem: use lua.)
- woah 10y agoFor 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.
- z3t4 10y ago_learning_ is an investment, and most times it doesn't make sense to invest years to learn a couple of languages to be efficient. I'd say it's better to know one language and know it well.