gravity
gravity copied to clipboard
async and await
Please add async and await into your Reserved Keywords. I have not seen support of async programming in gravity now, but it will be useful once you will want to add it.
BTW I'm glad that you are not trying to invent wheel and that you use standard, well known syntax from the C** world. Looks nice
Yeah, definitely a must have for me too! C# has this since several years know for example. Gravity is a great project, I love its simplicity and I can imagine that adding a lot of built-in functionalities is not your final purpose ... but async programming is so common today!
+1 to adding these to reserved words. Also, async programing IMO implies some sort of event loop that main thread can yield to when awaited result is ready. ATM it seems that the only asynchrony you can get is via using fibers, and there is not many things I can see that will benefit from it at this point.
@YurySolovyov I started to write binding for libuv here: https://github.com/parro-it/gravity/tree/gruv_2/src/optional/gruv
By now, I implemented only some function of the file system API, but the libuv event loop is working fine. I also thought to implement a Promise class to avoid the excessive use of callback with libuv API.
When we'll have Promises, I think that an await/async semantic could be implemented using gravity Fiber class.
But do you really have to build async await on top of promises or we can use fibers directly?
YurySolovyov: Just to check, how its going your efforts with libuv ?
I've never said I'm doing anything with libuv
I was doing it, but stopped working on it. I'm busy with other projects ATM
My mistake YurySolovyov . Thank you for answering parro-it.
Fwiw: my libuv bindings are here (based on a very similar project with the same roots): https://github.com/perl11/potion/blob/master/lib/aio.c