News for hackers. Stuff that matters.
Re:The cost of forsaking C by protomok on Wednesday October 05, 2016 @12:58PM (#12645602)
An alternative to the suggestion to use a regex C library is to embed Lua code into your C code. Lua+C is great for resource constrained embedded systems and can make text parsing a lot less painful than using pure C.

The Lua docs provide some examples of integrating Lua into C here - https://www.lua.org/pil/24.1.html.

Re:The cost of forsaking C by StavrosK on Wednesday October 05, 2016 @01:00PM (#12645630)
The problem there is that usually you're constrained to 2 kb of RAM or so for an Arduino, so that's too heavyweight :/ Plus, it's outside my abilities currently, sadly.
Re:The cost of forsaking C by krylon on Wednesday October 05, 2016 @03:16PM (#12646860)
> Plus, it's outside my abilities currently, sadly.

If your target only has two KB of RAM, Lua is a no-go, I guess. But skill-wise, I can highly recommend it. The reference manual is very well-written, the Lua language itself is very nice and easy to learn, and Lua's C interface is very pleasant to use; and again: the documentation is very good. (Also, the community is very friendly!)

If you ever take a shot at it, the Lua Users Wiki (http://lua-users.org/wiki/) is a good starting point.

Re:The cost of forsaking C by StavrosK on Wednesday October 05, 2016 @06:45PM (#12648611)
Hmm, the example you posted doesn't actually look very complicated at all! And I agree, Lua is a very nice language, I've used it for other projects.
Re:The cost of forsaking C by ArkyBeagle on Wednesday October 05, 2016 @05:31PM (#12648092)
Perhaps because I've done it all my adult life, I've never understood how text manipulation in 'C' is all that painful.