@araq I understand you want to avoid the distinction between `goThread` and 
`goAsync`. There are more than legimate reasons for that. It would be simpler, 
less confusing for the user. I'm certainly wrong because making that 
distinction like I propose will certainly have no benefit for the user, after 
all a dispatcher already hides too much details for the user to really have any 
control.

However, I think the M:N task is very difficult and might not be achievable 
without some other sacrifices on the actual project (speed ? Compile time ? 
drastic change in API usage ? safety ? ). But I really don't know. In fact, I 
am already pleased with it's simplicity and I am a bit skeptical to add such an 
overhead, that's why I am not a big enthusiast. But as long as the global API 
design is similar (I don't care about exact naming or if some things change, 
but its actual simplicity and elegance is important to me) and I/O is handled 
efficienctly, I have no problem with future changes. I don't know if what you 
want is really achievable. But I won't be its main developper: (1) this is far 
beyond my competence (2) NimGo is only a stage for my other project, and NimGo 
already more than fulfill this need (3) I haven't (unfortunately) enough time 
to improve multiple projects at the same time.

There is also a chance than M:N NimGo to be far inferior than this cool 
project: <https://github.com/mratsim/weave-io>. But absolutly no idea at this 
points how it will look like.

So enough talking, I think you have understood my points, and I agree to make 
NimGo be your way. I really think this kind of library would be beneficial for 
both Nim's enthousiats and the attractivness of the language (even if there are 
already quite good async and multithreaded library).

You can tell me what you think of it. If you really want to contribute on NimGo 
"for fun", we can continue this discussion on the repo 
<https://github.com/Alogani/NimGo/discussions> (and i'll make effort to be less 
talkative).

By the way: `let line = myfile.readLine()` is either a very bad example or very 
good ! Because if `myfile` is a regular file, the 1:N dispatcher will be 
blocked. But in another cases (like a fifo), the program will already do other 
works in the current thread in the meantime (and i you have another thread, 
well, it works no matter what you do in the dispatcher thread). Regular file 
can be a challenge even for M:N design (the threadpool needs to be smart on the 
number of threads to spawn to handle both CPU workload and IO workload).

@alexeypetrushin damn, you're right !^^

Reply via email to