urbit/pkg/base-dev/lib
Philip Monk e3a8cab943 khan: support inline threads
This allows you to pass a thread directly into khan, instead of passing
a filename.  This has several implications:

- The friction for using threads from an app is significantly lower.
  Consider:

    =/  shed
      =/  m  (strand ,vase)
      ;<  ~  bind:m  (poke:strandio [our %hood] %helm-hi !>('hi'))
      ;<  ~  bind:m  (poke:strandio [our %hood] %helm-hi !>('there'))
      (pure:m !>('product'))
    [%pass /wire %arvo %k %lard %base shed]

- These threads close over their subject, so you don't need to parse
  arguments out from a vase -- you can just refer to them.  The produced
  value must still be a vase.

    ++  hi-ship
      |=  [=ship msg1=@t msg2=@t]
      =/  shed
        =/  m  (strand ,vase)
        ;<  ~  bind:m  (poke:strandio [ship %hood] %helm-hi !>(msg1))
        ;<  ~  bind:m  (poke:strandio [ship %hood] %helm-hi !>(msg2))
        (pure:m !>('product'))
      [%pass /wire %arvo %k %lard %base shed]

- Inline threads can be added to the dojo, though this PR does not add
  any sugar for this.

    =strandio -build-file %/lib/strandio/hoon
    =sh |=  message=@t
        =/  m  (strand:rand ,vase)
        ;<  ~  bind:m  (poke:strandio [our %hood] %helm-hi !>('hi'))
        ;<  ~  bind:m  (poke:strandio [our %hood] %helm-hi !>(message))
        (pure:m !>('product'))
    |pass [%k %lard %base (sh 'the message')]

Implementation notes:
- Review the commits separately: the first is small and implements the
  real feature.  The second moves the strand types into lull so khan can
  refer to them.

- In lull, I wanted to put +rand inside +khan, but this fails to that
  issue that puts the compiler in a loop.  +rand depends on +gall, which
  depends on +sign-arvo, which depends on +khan.  If +rand is in +khan,
  this spins the compiler.  The usual solution is to either move
  everything into the same battery (very ugly here) or break the
  recursion (which we do here).
2022-08-29 21:04:50 -08:00
..
bip %bitcoin: Added %regtest to arms using the network type definition. 2022-07-07 16:47:06 -04:00
bip39 various: fixes, pill might actually work now 2021-08-10 16:13:27 +03:00
language-server various: fixes, pill might actually work now 2021-08-10 16:13:27 +03:00
ph ph: include missing library function 2022-04-06 16:44:08 +02:00
agentio.hoon agentio: fix +rest typo 2022-08-17 18:08:37 -07:00
azimuth.hoon Merge branch 'master' into next/arvo 2021-12-10 08:24:32 +00:00
azimuthio.hoon various: fixes, pill might actually work now 2021-08-10 16:13:27 +03:00
bip32.hoon various: fixes, pill might actually work now 2021-08-10 16:13:27 +03:00
bip39.hoon various: fixes, pill might actually work now 2021-08-10 16:13:27 +03:00
bitcoin-utils.hoon various: fix dependencies & tests 2021-09-17 14:51:19 +10:00
cram.hoon various: fix dependencies & tests 2021-09-17 14:51:19 +10:00
dbug.hoon various: fixes, pill might actually work now 2021-08-10 16:13:27 +03:00
default-agent.hoon various: fixes, pill might actually work now 2021-08-10 16:13:27 +03:00
der.hoon various: fix dependencies & tests 2021-09-17 14:51:19 +10:00
ethereum.hoon tests: fix various 2022-05-14 22:05:39 -07:00
ethio.hoon Merge branch 'master' into naive/roller 2021-10-26 20:46:32 +02:00
jose.hoon various: fix dependencies & tests 2021-09-17 14:51:19 +10:00
keygen.hoon various: fix dependencies & tests 2021-09-17 14:51:19 +10:00
pill.hoon arvo: remove $crag, promote $page 2022-03-02 17:59:56 -06:00
pkcs.hoon various: fix dependencies & tests 2021-09-17 14:51:19 +10:00
primitive-rsa.hoon various: fix dependencies & tests 2021-09-17 14:51:19 +10:00
ring.hoon Update /lib/ring/hoon for %jael scries. 2022-03-11 11:10:47 -08:00
server.hoon various: fixes, pill might actually work now 2021-08-10 16:13:27 +03:00
shoe.hoon Merge branch 'next/arvo' into m/shoe-scry 2021-12-08 13:13:54 +01:00
skeleton.hoon base-dev: update missing libs 2021-08-11 14:15:40 +10:00
sole.hoon various: fixes, pill might actually work now 2021-08-10 16:13:27 +03:00
story.hoon story: enforce 80 cols, fix formatting, update comments 2022-03-11 12:08:40 -05:00
strand.hoon khan: support inline threads 2022-08-29 21:04:50 -08:00
strandio.hoon azimuth: fetch snapshot on boot 2022-06-30 23:22:50 -07:00
test.hoon test: align output 2022-05-14 21:27:01 -07:00
verb.hoon various: fixes, pill might actually work now 2021-08-10 16:13:27 +03:00