toxi, to FunctionalProgramming
@toxi@mastodon.thi.ng avatar

Phew... One key step closer to replicating & simplifying core https://thi.ng/rstream functionality via just standard async iterables: Just added a mult() base-operator to https://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] https://github.com/thi-ng/umbrella/blob/develop/packages/transducers-async/src/mult.ts

#ThingUmbrella #Async #Transducers #ReactiveProgramming #FunctionalProgramming #TypeScript #JavaScript

toxi, to typescript
@toxi@mastodon.thi.ng avatar

For @made and others who might have questions about the new https://thi.ng/transducers-async library, I've tried to illuminate the behind-the-scenes approach over here:

https://github.com/thi-ng/umbrella/discussions/461#discussioncomment-9102966

#ThingUmbrella #Transducers #Async #Generators #TypeScript #JavaScript #FunctionalProgramming

toxi, to opensource
@toxi@mastodon.thi.ng avatar

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 https://thi.ng/transducers-async (restarted development after originally stopping it in 2018 due to lack of async iterable support)
  2. Updates to https://thi.ng/rstream (adapters from/to async iterables)
  3. Upcoming, a new & simplified implementation of https://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 https://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 https://thi.ng/fibers, but that package too might see some more refactoring/simplifying by switching to async generators...

#ThingUmbrella #Async #Transducers #OpenSource #TypeScript #JavaScript

fosskers, to scheme
@fosskers@emacs.ch avatar

I've released 1.0.0 of the transducers library for .

https://lists.sr.ht/~fosskers/transducers/%3Cfae7dd04-c990-4eb2-bc06-700d3c45356c%40fosskers.ca%3E

It's not yet on MELPA, but hopefully will be soon.

This is the third library in the series, after the and implementations. Next are some extensions for , and then a return to Guile .

toxi, (edited ) to typescript
@toxi@mastodon.thi.ng avatar

#HowToThing #008 — CSV parsing & filtering into structured data via https://thi.ng/csv and creating a multi-plot data visualization via https://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: https://ourworldindata.org/coronavirus)

Full source code:
https://gist.github.com/postspectacular/6a379a2bb8cd46e242163b9c9563522f

#ThingUmbrella #Transducers #TypeScript #JavaScript #DataViz #CSV #SVG #Tutorial

toxi, (edited ) to typescript
@toxi@mastodon.thi.ng avatar

Tracking multiple key states and extracting high-level commands from key sequences via https://thi.ng/rstream & http://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 of the https://thi.ng/umbrella monorepo shows an extended version of this approach...

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

Source:
https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-key-sequences

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines