shakedown.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A community for live music fans with roots in the jam scene. Shakedown Social is run by a team of volunteers (led by @clifff and @sethadam1) and funded by donations.

Administered by:

Server stats:

285
active users

#transducers

0 posts0 participants0 posts today

Someone asked for help on an interesting transducers (functional programming) problem. My initial answer using other existing transducers still had some minor differences to their intended behavior, but writing a small custom transducer then saves the day and now I can already think of a bunch of other uses for it too:

Attempt #1:
github.com/thi-ng/umbrella/iss

Attempt #2 (custom transducer):
github.com/thi-ng/umbrella/iss

#ThingUmbrella #ReleaseFriday[1] 🚀 — As announced a couple of weeks ago, a lot of my recent work has been centered around async iterables and addressing the conceptual overlap between the various packages related to those, specifically: thi.ng/transducers-async, thi.ng/rstream, thi.ng/csp, thi.ng/fibers, and partially related, thi.ng/rdom too. Apart from the first package, until recently, none of the others had direct support for async iterables (largely for historic reasons), but they all offer similar operators & functionality (via different means), which I'm slowly consolidating where it makes sense...

Part of this pretty large undertaking has been a complete rewrite of the temporarily deprecated thi.ng/csp package for Communicating Sequential Processes[2] (IMHO one of the most elegant & sane ways to structure larger apps via multiple small, reasonable concurrent processes). The package is active again now (as v3+) albeit constituting a new API (new docs still WIP) and removing any direct transducer-related functionality — this is one aspect of the aforementioned consolidation and now simply assumed to be delegated to the thi.ng/transducers-async and/or non-async thi.ng/transducers packages. I've also included a new small example project showing mixed usage patterns of working with CSP channels and combining them with (async) transducers to create derived views:

Demo:
demo.thi.ng/umbrella/csp-bus/

Source:
github.com/thi-ng/umbrella/blo

Hand in hand with these major changes are smaller and still ongoing updates to thi.ng/rdom, which recently received partial support for embedded async iterables as reactive values inside a UI/DOM component tree. The goal for this package is to become fully decoupled from thi.ng/rstream and focus more on the equally powerful, but more lightweight (since part of the language) async iterables. Adapters from rstream → asynciter already exists (see docs).

Unrelated, but also part of this week's release: The new version of thi.ng/meta-css includes support for CSS `light-dark()`. The base framework now includes ~950 utilities & 70 functions. See readme for full list...

Happy coding! :)

[1] There're actually a lot more frequent release, but these days I'm only mentioning the more notable ones to not spam everyone...

[2] en.wikipedia.org/wiki/Communic

thi.ngAsync versions of various highly composable transducers, reducers and iterators

Phew... One key step closer to replicating & simplifying core thi.ng/rstream functionality via just standard async iterables: Just added a `mult()` base-operator to thi.ng/transducers-async [1] which allows splitting a single async iterable into multiple child async iterables (aka subscriptions, aka 1:N splitting), each of which can be added/removed dynamically and individually processed e.g. via transducers, vanilla `for await()` consumers, and/or used as input for downstream `mult()`s to construct entire graph topologies (cycles allowed) of async processors etc. Back pressure is handled by waiting for all child subscriptions to deliver the value before consuming a new one from the source...

[1] github.com/thi-ng/umbrella/blo

thi.ng/rstreamReactive streams & subscription primitives for constructing dataflow graphs / pipelines

Sorry for recent silence, if I can summarize most of my past two weeks or so:

"Async all the thi.ngs, what colud posibsyl og wrngo!" [1]

1) New package thi.ng/transducers-async (restarted development after originally stopping it in 2018 due to lack of async iterable support)
2) Updates to thi.ng/rstream (adapters from/to async iterables)
3) Upcoming, a new & simplified implementation of thi.ng/csp (currently still only on a feature branch[2]) for building blocks for Communicating Sequential Processes.
4) Also still WIP only, async iterable support for thi.ng/rdom, i.e. in the same way as rstream subscriptions, such async iterables can soon be directly embedded as component/element bodies or attribute values and then perform pinpointed DOM updates each time their value changes...

As I said, async all the thi.ngs...

[1] h/t @sjb3d for an ancient tweet with a similar sentiment & outcome :)

[2] The CSP package too was somewhat deprecated (for similar reasons) and a while ago I added another alternative CSP implementation via thi.ng/fibers, but that package too might see some more refactoring/simplifying by switching to async generators...

thi.ngAsync versions of various highly composable transducers, reducers and iterators

#HowToThing #008 — CSV parsing & filtering into structured data via thi.ng/csv and creating a multi-plot data visualization via thi.ng/viz (along with a range of other helpful packages for various side aspects).

The attached visualization shows a lin-log plot of new COVID cases between March 2020 - Dec 2021:

- Daily world total as line plot
- UK (red) and USA (blue) cases as interleaved bar plots

(All data from: ourworldindata.org/coronavirus)

Full source code:
gist.github.com/postspectacula

#HowToThing #003 Tracking multiple key states and extracting high-level commands from key sequences via thi.ng/rstream & thi.ng/transducers-fsm. The key sequences are stored as a trie and matched via a transducer-based finite state machine.

Btw. The new example #125 of the thi.ng/umbrella monorepo shows an extended version of this approach...

Demo:
demo.thi.ng/umbrella/rdom-key-

Source:
github.com/thi-ng/umbrella/tre

Announcing #HowToThing, small code snippets illustrating useful patterns and use cases for various libraries/projects in the thi.ng ecosystem/anti-framework...

#HowToThing #001:
Build a FPS counter with moving average w/ thi.ng/transducers

Source code in alt text

(Ps. Have been trying to start similar stuff in the past on the birdsite, but let's see if I can control my attention and be more consistent this time... If you have any topic requests, please reply below [or via DM])