3 ms·
> In order to write libraries that do I/O properly that include both Synchronous and Asynchronous methods, maintainers have to write two separate implementation
by dom96 10y ago
> In order to write libraries that do I/O properly that include both Synchronous and Asynchronous methods, maintainers have to write two separate implementations of the same logic, which is a bit of a pain.
A solution to this that I am particularly proud of can be found in the Nim programming language. It is a macro that transforms a single procedure into a synchronous and asynchronous procedure[1].
1 - http://nim-lang.org/news/e027_version_0_15_0.html#multisync-macro http://nim-lang.org/news/e027_version_0_15_0.html#multisync-...