lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Apr 27, 2017 at 2:07 AM, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great Coda Highland once stated:
>> As mentioned upthread, there's no point in teaching C when you could
>> be teaching C++. C++ can do literally everything C can, and it can do
>> it with syntax that's much friendlier and much less error-prone.
>
>   Even coroutines?  Such as https://github.com/spc476/C-Coroutines
>
> (okay, granted, it's implemented in assembly, but it works quite well for C;
> I wouldn't even know how to begin to adapt that for C++)


I normally look in boost whenever I need one of these things, and
voila, it has one:

http://www.boost.org/doc/libs/1_64_0/libs/coroutine2/doc/html/index.html

Also, I would try the C-Coroutines stuff directly, they tend to work (
you cannot throw across coroutines, and this kind of stuff, but you do
not need to throw or use new in C++ )


I'd also point that in fact I currently do all my coding in C++, even
when doing some prety normal malloc/printf/strcpy things. I've found
that even not using any fancy stuff being able to use some small
features makes my task easier ( recent C compilers have all things
like inline et al, but they  got to c++ first, in fact, IIRC, let me
check my copy ... yes, K&R 2e preface "We used Bjarne Stroustroup C++
translator extensively for local testing..." )

Francisco Olarte.