Earlier today I released a new version of https://thi.ng/fibers aka building blocks and operators for coroutine-based multitasking and alternative to async-await. It's one of the more recent packages, but also one which is quickly cementing itself as one of the most powerful & flexible tools of the whole #ThingUmbrella collection, similar to how https://thi.ng/transducers & https://thi.ng/rstream have done in other contexts...
Recent versions have included new helpers to improve interop between fibers and async functions and to simplify time-sliced processing of child tasks and/or iterables (incl. via transducers).
The attached code snippet shows an example excerpt of how this is used in the recent (and even more recently updated) #HowToThing Mastodon UI demo. See linked toot for demo link & fully commented source code...
#zerocost#async: if a given codebase never waits for more than one event source (i.e.: if all futures are ancestors or descendants of all other futures), then no runtime overhead should exist when compared to a blocking implementation of the same logic.
It champions #TonyHoare's #CSP model of concurrency which takes me back. Back to the time I failed to get funding for a start-up to build an #Occam compiler targeting i386. Which was largely a ploy to get the UK government to buy me some neat kit 🤷♂️
The load time for the timelines bothers me; it's still occasionally timing out just loading 20 toots from two servers. I feel like introducing a #webSocket is my only choice, but I don't like the idea of adding client-side rendering.
Right now, when you visit schizo.social/timelines/home the server fetches from the API before rendering the page using @enhance_dev
I like that the page comes down populated with content so there's no further delay, but there's still a significant delay from waiting on mastodon, so it kinda defeats the purpose.
I could use enhance-element to render the toots on the client instead; either by making an #async#API request, or with a #WebSocket.
Why go through all of this trouble rather than just using the #JaneStreetresource_cache?
Well, a big part of it is that I wanted to build an actor system with #eio as I was learning #OCaml and that I think the actors will be useful elsewhere in the #JsonLD project :p
I am busy messing around with #Python#async, for API consumption, but the API library isn't implemented with asyncio.
I can either fork the library and possibly switch its request object with an async version, but often we might not be able to do this and we need to work with blocking functions.
I struggled to get this working in my current code, so I tried it in another file and got it to work. There are still a few things I could change, allowing for more threads and using an executor, but here is the #gist
So far the biggest challenges I've been having with #OCaml are:
the sheer amount of syntactic conventions that aren't part of the language per se, but that are widely understood by libraries or interpreted a particular way (e.g. "you want a module with sexp_of_t declared" or "let+ usually means this even with no requirement…")
Sets, maps, etc.
Documentation that is basically just an API refererence but that doesn't tell me how to use it or what the calls actually… do.
Been putting the template annotations into @reactphp's async package. This will make PHPStan understand that when you await a PromiseInterface<bool>, the await function returns a bool. All with this amazing view:
This excites me because PHPStan and Psalm now understand that echoing directly a property from the await function is perfectly fine and opens up a very exciting future for @reactphp based projects:
To celebrate, we're releasing Promise v3, the next big step towards the future ReactPHP v3. Now reporting all unhandled promise rejections, better type safety & much more! 🔥
Released v1.6.0 of our async PromiseStream component! 🎉
Better forward compatibility with Promise v3 by avoiding unhandled rejections, improve memory usage and more. All in preparation for the upcoming ReactPHP birthday next week! 🚀
There's a new help view modal on all screens when you press ?. It only shows the control keys now, but that list of keys has been reorganized and may include features you didn't realize were available.
UniFFI can generate bindings for Rust async functions/methods to Python, Swift and Kotlin, with native async runtimes (resp. asyncio, Task and suspend).
That’s really exciting! Rust Future being driven by a foreign language async runtime, that’s pure fun.