actually uses even less memory on Espruino at the moment (it won't have two copies of the function text in memory).
@tve I'm just trying to make sure that things are as useful to as many people as possible. So few people want to compile their own firmwares, doing stuff in JS lets them choose how they use their memory.
Also the past few years have shown that JS code actually gets many more improvements and tweaks than the C code does - and from my point of view it's good to do things that make it easier for others to contribute.
But if you do add MQTT in C code, feel free to stick it back in the Espruino repo (as long as the licence for the stuff you're adding is compatible with MPLv2). As you say, it could be useful for people that want to build it in.
I was going to see whether I can insert a C-level sockets API so protocols in C could go through the Espruino sockets layer and thereby be target independent.
While that'd be cool, you might find that you have a lot of trouble. Both CC3000 and WIZnet have C-ish socket APIs (each slightly different, but with send/recv/etc), that conflict so they can't even be compiled into the same binary. I'd imagine adding another socket API on top might cause similar problems - on CC3k, WIZnet and Linux.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Ollie, thanks! That looks a lot smaller! If you're trying to get Espruino memory usage down, you might find that:
actually uses even less memory on Espruino at the moment (it won't have two copies of the function text in memory).
@tve I'm just trying to make sure that things are as useful to as many people as possible. So few people want to compile their own firmwares, doing stuff in JS lets them choose how they use their memory.
Also the past few years have shown that JS code actually gets many more improvements and tweaks than the C code does - and from my point of view it's good to do things that make it easier for others to contribute.
But if you do add MQTT in C code, feel free to stick it back in the Espruino repo (as long as the licence for the stuff you're adding is compatible with MPLv2). As you say, it could be useful for people that want to build it in.
While that'd be cool, you might find that you have a lot of trouble. Both CC3000 and WIZnet have C-ish socket APIs (each slightly different, but with
send
/recv
/etc), that conflict so they can't even be compiled into the same binary. I'd imagine adding another socket API on top might cause similar problems - on CC3k, WIZnet and Linux.