News for hackers. Stuff that matters.
Re:A Universal I/O Abstraction for C++ (2020) by gpderetta on Sunday April 18, 2021 @05:17PM (#26856452)
Hum, in principle you can do arbitrary compile time transformations to the datagraph before submitting it via metaprogramming.

If you really want you could even convert the graph (fully or partially) to a runtime representation.

The core of the proposals are not about specific classes or functions other than some default algorithm implementations.

Instead they are mostly about defining concepts and protocols so that independent async domains can coexist and iteroperate in the same application.

This is similar to the STL where the most important part are the various iterator concepts and the algorithm interfaces, not the actual algo implementations and the containers.

Re:A Universal I/O Abstraction for C++ (2020) by jcelerier on Monday April 19, 2021 @02:59AM (#26859813)
> Hum, in principle you can do arbitrary compile time transformations to the datagraph before submitting it via metaprogramming.

I would find that to be great, but I don't understand how.

In e.g.

    while(i) {
        co_await sch.schedule(std::chrono::milliseconds(100));
        co_await w.write(--i);
    }
how can you get a meaningful "graph" object out of that, e.g.

[wait 100] -> [write 9] -> [wait 100] -> [write 8] -> ...

without actually "running" the code first to go through the co_await, which are the only way to acquire the information of what is to run ?

for instance, let's say that I want to compute "statically" (not in the "at compile time" sense but in the "after knowing the inputs to the program and before actually running the scheduler") how many [write] calls there are to schedule (assuming no cycles / infinite loops).

Re:A Universal I/O Abstraction for C++ (2020) by gpderetta on Monday April 19, 2021 @03:20AM (#26859918)
The proposed async "framework" happens to work well with coroutines, but they are not required (and infact most of the papers on the topic deal with them only in passing). You can build the async graph as an expression template and if you want, each operation (including the while loop) can be expressed as a different type.

I don't think coroutines provide (yet) enough introspection to break them down in the same way.

Re:A Universal I/O Abstraction for C++ (2020) by jcelerier on Monday April 19, 2021 @03:22AM (#26859928)
I see, that solves it then. Great !