Over the past few days I've been working on extending & re-packaging the procedural text generation engine from one of the old examples into a new package and also just wrote/updated documentation for its various features:

- variable definitions, optionally with multiple value choices
- cyclic & recursive variable references/expansion
- variable assignments
- dynamic, indirect variable lookups (for context specific situations)
- optional preset & custom modifiers (i.e. pointfree/concatenative application of modifier sequences)
- controlled randomness during var expansion

The new package is called: https://thi.ng/proctext (6.5KB incl. all deps) The text format used relies on a simple parser grammar defined and processed via https://thi.ng/parse. The resulting document AST is then interpreted via https://thi.ng/defmulti

Please see readme for notes/examples, as well as the refactored example project below. The tool is very useful for complex source code generation, but also could be useful for bots, interactive fiction etc. The generator is stateful and variable state can be optionally retained/re-used over multiple invocations. Making all modifiers async is also providing a lot of flexibility (e.g. loading external data sources, generating secondary/expanded descriptions etc.)

Demo (incl. 5 examples and can be used as playground):
https://demo.thi.ng/umbrella/procedural-text/

#ThingUmbrella #RewriteSystem #ProcGen #TextGeneration #CodeGenerator #Parser #DSL #Pointfree #TypeScript #JavaScript #InteractiveFiction

Extensible procedural text generation engine with dynamic, mutable state, indirection, randomizable & recursive variable expansions

thi.ng/proctext
I have so many mixed feelings about point-free styles of programming or reasoning that I keep returning to. On the one hand, point-free style can be an extremely concise, elegant, and at times incisive way to write down an idea. On the other hand, if you've ever tried to write APL for instance, it can be challenging to get right; and if you've ever tried to read someone else's APL, it can be mind-breaking. It's a serious question whether one should bother expressing things in this style and take the risk that it won't be read or received by many other people.

I have my own offering in this area: S↾⋄∂/∂ . This is a relation between candidate solutions of a coevolutionary algorithm where ∂ is the solution concept ( https://bucci.onl/notes/solution-concepts ) and S is a set candidate solutions. Given a candidate solution s, this relation indicates all the actual solutions that lie "above" it according to the solution concept. ↾ is the shrink operator, and / is right residual. I've written a paper spelling out the ⋄∂/∂ part of that expression, though I didn't use these terms or symbols at the time, that weighed in around 6 pages. In https://bucci.onl/notes/monotonic-solution-concepts , I touch on this paper and subject; the weak preference order described there is captured by ⋄∂/∂ .

A concise description of what shrink and right residual do, and why this expression is doing what I claim it does, would require roughly the same amount of space, maybe a bit less. Mu and Oliveira have written a few papers on the shrink operator; right residual is textbook relational algebra.

So the six symbols in S↾⋄∂/∂ are condensing many tens of pages of natural language + math. In principle, once you knew ∂, ⋄,↾, and /, you should be able to deduce what that full expression does. Following Mu and Oliveira, you should also be able to deduce an algorithmic implementation! But who the heck would put themselves through all that besides me? Who knows! 🤷

#APL #PointFree #programming #CoevolutionaryAlgorithm #RelationalAlgebra
solution concepts

Anthony Bucci's personal web site

Anthony Bucci
New blog post, about triggering effects from state changes instead of actions in TCA: https://blog.sculptedapps.com/posts/effects_tca/
#ios #swift #tca #theComposableArchitecture #pointfree #architecture #development #effects
A different way to run effects in TCA

Effects in TCA are run in response to an action. What would happen if we derive them from the state instead?

SculptedApps

What about:

```
\o -> [("#options" , toJSON o)]
```

vs:

```
pure . ("#options",) . toJSON
```

?

#Haskell #FunctionalProgramming #FP #Programming #Pointfree

lambda
63.6%
pointfree
36.4%
Poll ended at .

What do you prefer?

```
\a b -> (a, Just b)
```

or:

```
(. Just) . (,)
```

and why?

#Haskell #FunctionalProgramming #FP #Programming #Pointfree

I prefer the lambda version
87.9%
Pointfree or die
12.1%
Poll ended at .

#HowToThing #029 — One for the #Forth friends: Minimal livecoding playground for animated 2D geometry generation (incl. SVG export) using a Forth-like DSL (domain-specific language) based on https://thi.ng/pointfree, https://thi.ng/pointfree-lang and various geometry related operations using https://thi.ng/geom. A short screen recording is included to demonstrate overall usage. This is a cutdown version of a prototype tool, originally from 2019...

Even though the language is "Forthy", the underlying thi.ng/pointfree implementation does _not_ use a VM, but instead compiles words to vanilla JavaScript using normal functional composition (or reductions) and each word is passing data & state via a single shared stack context object (with the usual dual data & return stacks and an environment object with var bindings). The language supports quotations, local variables, combinators etc.

I _highly_ recommend consulting the detailed readme docs for the above packages to familiarize yourself with the basic principles & language features/syntax. If you do have some prior #Forth knowledge, many aspects should feel familiar (apart from the geometry DSL terms)...

Also worth pointing out that the editor/interpreter in this small example is not super forgiving re: error handling and might easily crash when live coding. The point of this demo is not about providing great UX, but to illustrate how the basic thi.ng/pointfree language infrastructure can be easily extended/adapted/integrated...

Demo:
https://demo.thi.ng/umbrella/pointfree-geom/

Source code:
https://github.com/thi-ng/umbrella/tree/develop/examples/pointfree-geom/src

(Note: The source code of the actual language bindings for the geometry operations is not shown here, but available in the `lang.ts` file, linked above...)

#Forth #Pointfree #Concatenative #Programming #Geometry #Graphics #SVG #GenerativeArt #GenerativeDesign #TypeScript #JavaScript #ThingUmbrella

#PointFree released their #ComposableArchitecture today! This system seems very wordy, but I’m going to find a personal project to try it out to see what it unlocks

Congratulations to all of the contributors!

https://www.pointfree.co/blog/posts/112-composable-architecture-1-0?utm_source=substack&utm_medium=email

Composable Architecture 1.0

1.0 of the Composable Architecture is finally here! 🎉