Skip to content

Instantly share code, notes, and snippets.

@sigilante
Created June 29, 2023 00:52
Show Gist options
  • Save sigilante/261b879dc9cd932a423f2463d2ac3f1e to your computer and use it in GitHub Desktop.
Save sigilante/261b879dc9cd932a423f2463d2ac3f1e to your computer and use it in GitHub Desktop.
%hob is a tiny %gall

%hob is a tiny %gall

As a stepping stone to composing full %gall apps, we propose %hob, a userspace framework for producing “toy” agent-like applications, called brownies.

Like %spider, %hob is itself a %gall agent that instruments other running processes. It wraps the %hob mini-agent, or brownie, with the standard Gall-scale boilerplate (including +dbug), allowing for straightforward interaction with the running brownie through the Dojo.

The brownie's state is defined in a $state block at the top of its file, e.g.:

+$  state
  $:  scores=(list @)
      hi-score=@
  ==

Brownies do not support state upgrades, so no head tag is provided. They are more permanent than %spider or %khan threads but less permanent than agents.

A brownie requires only the following arms for the developer:

|%
++  on-init
++  on-poke
++  on-peek
++  on-fact
--

Unlike the regular %gall pubsub model, a brownie will unify received gifts in ++on-fact. It only knows about %facts, and the %hob framework should be prepared to implicitly handle other results.

A brownie specification file is NOT implicitly chained with a running => tisgal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment