Merge branch 'radio'

Conflicts:
	urb/urbit.pill
	urb/zod/arvo/hoon.hoon
	urb/zod/main/app/talk/core.hook
This commit is contained in:
C. Guy Yarvin 2015-01-15 12:02:28 -08:00
commit a76eb4f661
11 changed files with 1890 additions and 600 deletions

View File

@ -374,7 +374,7 @@
== ==
:: ::
%wake %wake
?: (lte q.s.yar (sub now ~s15)) ?: (lte (sub now ~s15) q.s.yar)
%_ +>.$ %_ +>.$
mos mos
:_ mos :_ mos

View File

@ -115,6 +115,8 @@
== :: == ::
++ calx :: concrete cache line ++ calx :: concrete cache line
$% [%hood p=calm q=(pair beam cage) r=hood] :: compile $% [%hood p=calm q=(pair beam cage) r=hood] :: compile
[%slit p=calm q=[p=type q=type] r=type] :: slam type
[%slim p=calm q=[p=type q=twig] r=(pair type nock)]:: mint
[%slap p=calm q=[p=vase q=twig] r=vase] :: compute [%slap p=calm q=[p=vase q=twig] r=vase] :: compute
[%slam p=calm q=[p=vase q=vase] r=vase] :: compute [%slam p=calm q=[p=vase q=vase] r=vase] :: compute
== :: == ::
@ -132,6 +134,8 @@
%hood ?>(?=(%hood -.cax) r.cax) %hood ?>(?=(%hood -.cax) r.cax)
%slap ?>(?=(%slap -.cax) r.cax) %slap ?>(?=(%slap -.cax) r.cax)
%slam ?>(?=(%slam -.cax) r.cax) %slam ?>(?=(%slam -.cax) r.cax)
%slim ?>(?=(%slim -.cax) r.cax)
%slit ?>(?=(%slit -.cax) r.cax)
== ==
:: ::
++ calk :: cache lookup ++ calk :: cache lookup
@ -814,18 +818,24 @@
|= [cof=cafe yed=vase] |= [cof=cafe yed=vase]
^$(cof cof, for i.yaw, yaw t.yaw, vax yed) ^$(cof cof, for i.yaw, yaw t.yaw, vax yed)
:: ::
++ mail :: cached mint
|= [cof=cafe sut=type gen=twig]
^- (bolt (pair type nock))
%+ (clef %slim) (fine cof sut gen)
|= [cof=cafe sut=type gen=twig]
=+ puz=(mule |.((~(mint ut sut) [%noun gen])))
?- -.puz
| (flaw cof p.puz)
& (fine cof p.puz)
==
::
++ maim :: slap ++ maim :: slap
|= [cof=cafe vax=vase gen=twig] |= [cof=cafe vax=vase gen=twig]
^- (bolt vase) ^- (bolt vase)
%+ (clef %slap) (fine cof vax gen) %+ cope (mail cof p.vax gen)
|= [cof=cafe vax=vase gen=twig] |= [cof=cafe typ=type fol=nock]
=+ puz=(mule |.((~(mint ut p.vax) [%noun gen]))) %+ (coup cof) (mock [q.vax fol] (mole ska))
?- -.puz |=(val=* `vase`[typ val])
| (flaw cof p.puz)
& %+ (coup cof) (mock [q.vax q.p.puz] (mole ska))
|= val=*
`vase`[p.p.puz val]
==
:: ::
++ make :: reduce silk ++ make :: reduce silk
|= [cof=cafe kas=silk] |= [cof=cafe kas=silk]
@ -912,18 +922,24 @@
(fine cof `cage`[p.kas vax]) (fine cof `cage`[p.kas vax])
== ==
:: ::
++ malt :: cached slit
|= [cof=cafe gat=type sam=type]
^- (bolt type)
%+ (clef %slit) (fine cof gat sam)
|= [cof=cafe gat=type sam=type]
=+ top=(mule |.((slit gat sam)))
?- -.top
| (flaw cof p.top)
& (fine cof p.top)
==
::
++ maul :: slam ++ maul :: slam
|= [cof=cafe gat=vase sam=vase] |= [cof=cafe gat=vase sam=vase]
^- (bolt vase) ^- (bolt vase)
%+ (clef %slam) (fine cof gat sam) %+ cope (malt cof p.gat p.sam)
|= [cof=cafe gat=vase sam=vase] |= [cof=cafe typ=type]
=+ top=(mule |.((slit p.gat p.sam))) %+ (coup cof) (mong [q.gat q.sam] (mole ska))
?- -.top |=(val=* `vase`[typ val])
| (flaw cof p.top)
& %+ (coup cof) (mong [q.gat q.sam] (mole ska))
|= val=*
`vase`[p.top val]
==
:: ::
++ meow :: assemble ++ meow :: assemble
|= [how=beam arg=heel] |= [how=beam arg=heel]
@ -1214,12 +1230,14 @@
exec(q.kig (~(del by q.kig) tik)) exec(q.kig (~(del by q.kig) tik))
-- --
-- --
::
-- --
. == . ==
=| axle =| axle
=* lex - =* lex -
|= [now=@da eny=@ ski=sled] :: activate |= [now=@da eny=@ ski=sled] :: activate
^? :: opaque core ^? :: opaque core
~% %ford-d +>+>+>+>+>+> ~
|% :: |% ::
++ call :: request ++ call :: request
|= [hen=duct hic=(hypo (hobo kiss))] |= [hen=duct hic=(hypo (hobo kiss))]

View File

@ -25,6 +25,7 @@
~ ~
|% :: |% ::
++ abel typo :: original sin: type ++ abel typo :: original sin: type
++ ache |*([a=$+(* *) b=$+(* *)] $%([| p=b] [& p=a])) :: each, b default
++ axis ,@ :: tree address ++ axis ,@ :: tree address
++ also ,[p=term q=wing r=type] :: alias ++ also ,[p=term q=wing r=type] :: alias
++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~ ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~
@ -413,7 +414,11 @@
[%unit p=term q=wine] :: [%unit p=term q=wine] ::
== :: == ::
++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) :: ++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) ::
:: :: ++ worm :: compiler cache
$: nes=(set ,^) :: ++nest
pay=(map (pair type twig) type) :: ++play
mit=(map (pair type twig) (pair type nock)) :: ++mint
== ::
:: :: :: ::
++ map |* [a=_,* b=_,*] :: associative tree ++ map |* [a=_,* b=_,*] :: associative tree
$|(~ [n=[p=a q=b] l=(map a b) r=(map a b)]) :: $|(~ [n=[p=a q=b] l=(map a b) r=(map a b)]) ::
@ -6150,6 +6155,71 @@
++ wash :: render tank at width ++ wash :: render tank at width
|= [[tab=@ edg=@] tac=tank] ^- wall |= [[tab=@ edg=@] tac=tank] ^- wall
(~(win re tac) tab edg) (~(win re tac) tab edg)
::
++ wa :: cached compile
!:
|_ worm
++ nell |=(ref=type (nest [%cell %noun %noun] ref)) :: nest in cell
++ nest :: nest:ut
|= [sut=type ref=type]
^- [? worm]
?: (~(has in nes) [sut ref]) [& +>+<]
?. (~(nest ut sut) | ref) [| +>+<]
[& +>+<(nes (~(put in nes) [sut ref]))]
::
++ nets :: typeless nest
|= [sut=type ref=*]
^- [? worm]
?: (~(has in nes) [sut ref]) [& +>+<]
=+ gat=|=([a=type b=type] (~(nest ut a) | b))
?. (,? .*(gat(+< [sut ref]) -.gat))
[| +>+<.$]
[& +>+<.$(nes (~(put in nes) [sut ref]))]
::
++ play :: play:ut
|= [sut=type gen=twig]
^- [type worm]
=+ old=(~(get by pay) [sut gen])
?^ old [u.old +>+<.$]
=+ new=(~(play ut sut) gen)
[new +>+<.$(pay (~(put by pay) [sut gen] new))]
::
++ mint :: mint:ut to noun
|= [sut=type gen=twig]
^- [(pair type nock) worm]
=+ old=(~(get by mit) [sut gen])
?^ old [u.old +>+<.$]
=+ new=(~(mint ut sut) %noun gen)
[new +>+<.$(mit (~(put by mit) [sut gen] new))]
::
++ slap :: ++slap, cached
|= [vax=vase gen=twig]
^- [vase worm]
=^ gun +>+< (mint p.vax gen)
[[p.gun .*(q.vax q.gun)] +>+<.$]
::
++ slot :: ++slot, cached
|= [axe=@ vax=vase]
^- [vase worm]
=^ gun +>+< (mint p.vax [%$ axe])
[[p.gun .*(q.vax [0 axe])] +>+<.$]
::
++ spec :: specialize vase
|= vax=vase
^- [vase worm]
=+ ^= gen ^- twig
?@ q.vax [%wtts [%axil [%atom %$]] [%$ 1]~]
?@ -.q.vax [%wtts [%leaf %tas -.q.vax] [%$ 2]~]
[%wtts [%axil %cell] [%$ 1]~]
=^ typ +>+<.$ (play p.vax [%wtgr gen [%$ 1]])
[[typ q.vax] +>+<.$]
::
++ spot :: slot and spec
|= [axe=@ vax=vase]
^- [vase worm]
=^ xav +>+< (slot axe vax)
(spec xav)
--
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2fB, macro expansion :: :: section 2fB, macro expansion ::
:: ::
@ -9518,6 +9588,8 @@
glu=@ud :: samples in glue glu=@ud :: samples in glue
mal=@ud :: samples in alloc mal=@ud :: samples in alloc
far=@ud :: samples in frag far=@ud :: samples in frag
coy=@ud :: samples in copy
euq=@ud :: samples in equal
== :: == ::
:: ::
++ hump ++ hump
@ -9561,10 +9633,12 @@
%glu mon(glu +(glu.mon)) %glu mon(glu +(glu.mon))
%mal mon(mal +(mal.mon)) %mal mon(mal +(mal.mon))
%far mon(far +(far.mon)) %far mon(far +(far.mon))
%coy mon(coy +(coy.mon))
%euq mon(euq +(euq.mon))
== ==
++ pi-moth :: count sample ++ pi-moth :: count sample
|= mon=moan ^- @ud |= mon=moan ^- @ud
:(add fun.mon noc.mon glu.mon mal.mon far.mon) :(add fun.mon noc.mon glu.mon mal.mon far.mon coy.mon euq.mon)
:: ::
++ pi-mumm :: print sample ++ pi-mumm :: print sample
|= mon=moan ^- tape |= mon=moan ^- tape
@ -9589,6 +9663,14 @@
^- tape ^- tape
?: =(0 far.mon) ~ ?: =(0 far.mon) ~
(welp (scow %ud (div (mul 100 far.mon) tot)) "f ") (welp (scow %ud (div (mul 100 far.mon) tot)) "f ")
::
^- tape
?: =(0 coy.mon) ~
(welp (scow %ud (div (mul 100 coy.mon) tot)) "y ")
::
^- tape
?: =(0 euq.mon) ~
(welp (scow %ud (div (mul 100 euq.mon) tot)) "e ")
== ==
:: ::
++ pi-tell :: produce dump ++ pi-tell :: produce dump
@ -9748,21 +9830,21 @@
:: section 3bE, Arvo core :: :: section 3bE, Arvo core ::
:: ::
++ vent :: vane core ++ vent :: vane core
|= [lal=@tas vil=vile bud=vase ves=vase] |= [lal=@tas vil=vile bud=vase sew=(pair worm vase)]
~% %vent +>+ ~ ~% %vent +>+ ~
|% |%
++ ruck :: update vase ++ ruck :: update vase
|= [pax=path txt=@ta] |= [pax=path txt=@ta]
^+ +> ^+ +>
=+ arg=[~2000.1.1 0 =>(~ |+(* ~))] =+ arg=[~2000.1.1 0 =>(~ |+(* ~))]
=+ rig=(slym ves arg) =+ rig=(slym q.sew arg)
=+ rev=(slym (slap bud (rain pax txt)) bud) =+ rev=(slym (slap bud (rain pax txt)) bud)
=+ syg=(slym rev arg) =+ syg=(slym rev arg)
+>.$(ves (slam (slap syg [%cnzy %load]) (slap rig [%cnzy %stay]))) +>.$(q.sew (slam (slap syg [%cnzy %load]) (slap rig [%cnzy %stay])))
:: ::
++ wink :: deploy ++ wink :: deploy
|= [now=@da eny=@ ski=sled] |= [now=@da eny=@ ski=sled]
=+ rig=(slym ves +<) :: activate vane =+ rig=(slym q.sew +<) :: activate vane
~% %wink +>+> ~ ~% %wink +>+> ~
|% |%
++ doze ++ doze
@ -9770,14 +9852,6 @@
^- (unit ,@da) ^- (unit ,@da)
((hard (unit ,@da)) q:(slym (slap rig [%cnzy %doze]) +<)) ((hard (unit ,@da)) q:(slym (slap rig [%cnzy %doze]) +<))
:: ::
++ sike :: check metatype
~/ %sike
|= [sub=type ref=*]
^- ?
:: ?: =(~ ~) &
=+ gat=|=([a=type b=type] (~(nest ut a) | b))
(,? .*(gat(+< [sub ref]) -.gat))
::
++ slid ++ slid
|= [hed=mill tal=mill] |= [hed=mill tal=mill]
^- mill ^- mill
@ -9793,56 +9867,74 @@
| [%| [%cell typ.vil p.p.hil] p.hil] | [%| [%cell typ.vil p.p.hil] p.hil]
== ==
:: ::
++ slur ++ slur :: call gate on
|= [gat=vase hil=mill] |= [gat=vase hil=mill]
^- (unit vase) ^- (unit (pair vase worm))
=+ sam=(slot 6 gat) =+ sam=(slot 6 gat)
?. ?- -.hil =+ ^= hig
& (souk p.sam p.p.hil) ?- -.hil
| (sike p.sam p.p.hil) & (~(nest wa p.sew) p.sam p.p.hil)
== ~ | (~(nets wa p.sew) p.sam p.p.hil)
`(slym gat +>.hil) ==
?.(-.hig ~ `[(slym gat +>.hil) +.hig])
:: ::
++ souk :: check type ++ slur-a ~/(%slur-a |=([gat=vase hil=mill] (slur gat hil)))
~/ %souk ++ slur-b ~/(%slur-b |=([gat=vase hil=mill] (slur gat hil)))
|= [sub=type ref=type] ++ slur-c ~/(%slur-c |=([gat=vase hil=mill] (slur gat hil)))
:: ?: =(~ ~) & ++ slur-d ~/(%slur-d |=([gat=vase hil=mill] (slur gat hil)))
(~(nest ut sub) | ref) ++ slur-e ~/(%slur-e |=([gat=vase hil=mill] (slur gat hil)))
++ slur-f ~/(%slur-f |=([gat=vase hil=mill] (slur gat hil)))
++ slur-g ~/(%slur-g |=([gat=vase hil=mill] (slur gat hil)))
++ slur-z ~/(%slur-z |=([gat=vase hil=mill] (slur gat hil)))
:: ::
++ sunk :: type is cell ++ slur-pro :: profiling slur
|= ref=type ~/ %slur-pro
:: ?: =(~ ~) & |= [lal=@tas gat=vase hil=mill]
(souk [%cell %noun %noun] ref) ?+ lal (slur-z gat hil)
%a (slur-a gat hil)
%b (slur-b gat hil)
%c (slur-c gat hil)
%d (slur-d gat hil)
%e (slur-e gat hil)
%f (slur-f gat hil)
%g (slur-g gat hil)
==
:: ::
++ song :: reduce metacard ++ song :: reduce metacard
~/ %song :: ~/ %song ::
|= mex=vase :: mex: vase of card |= mex=vase :: mex: vase of card
^- (unit mill) :: ^- (unit (pair mill worm)) ::
?. (sunk p.mex) ~ :: a card is a cell =^ hip p.sew (~(nell wa p.sew) p.mex) ::
?. ?=(%meta -.q.mex) `[%& mex] :: ordinary card ?. hip ~ :: a card is a cell
=+ tiv=(slot 3 mex) :: tiv: vase of vase ?. ?=(%meta -.q.mex) `[[%& mex] p.sew] :: ordinary card
?. (sunk p.tiv) ~ :: a vase is a cell =^ tiv p.sew (~(slot wa p.sew) 3 mex) ::
?. (souk typ.vil p:(slot 2 tiv)) ~ :: vase head is type =^ hip p.sew (~(nell wa p.sew) p.tiv) ::
%- biff :_ |=(a=milt `[%| a]) :: milt to mill ?. hip ~ :: a vase is a cell
=^ vax p.sew (~(slot wa p.sew) 2 tiv) ::
=^ hip p.sew (~(nest wa p.sew) typ.vil p.vax) ::
?. hip ~ :: vase head is type
%- biff ::
:_ |=(a=(pair milt worm) `[[%| p.a] q.a]) :: milt to mill
=+ mut=(milt q.tiv) :: card type, value =+ mut=(milt q.tiv) :: card type, value
|- ^- (unit milt) :: |- ^- (unit (pair milt worm)) ::
?. ?=([%meta p=* q=milt] q.mut) `mut :: ordinary metacard ?. ?=([%meta p=* q=milt] q.mut) `[mut p.sew] :: ordinary metacard
?. (sike mev.vil p.mut) ~ :: meta-metacard =^ hip p.sew (~(nets wa p.sew) mev.vil p.mut) ::
?. hip ~ :: meta-metacard
$(mut +.q.mut) :: descend into meta $(mut +.q.mut) :: descend into meta
:: ::
++ sump :: vase to move ++ sump :: vase to move
~/ %sump ~/ %sump
|= wec=vase |= wec=vase
^- (unit move) ^- (unit (pair move worm))
%+ biff ((soft duct) -.q.wec) %+ biff ((soft duct) -.q.wec)
|= a=duct |= a=duct
%- bind :_ |=(b=arvo `move`[a b]) %- bind :_ |=(b=(pair arvo worm) [`move`[a p.b] q.b])
=- ?- -.har =- ?- -.har
| ~& [%dead-card p.har] ~ :: XX properly log? | ~& [%dead-card p.har] ~ :: XX properly log?
& (some p.har) & (some p.har)
== ==
^= har ^- (each arvo term) ^= har ^- (each (pair arvo worm) term)
=+ caq=(spec (slot 3 wec)) =^ caq p.sew (~(spot wa p.sew) 3 wec)
?+ q.caq [%| (cat 3 %funk (,@tas q.caq))] ?+ q.caq [%| (cat 3 %funk (,@tas q.caq))]
:: ::
[%pass p=* q=@tas r=[p=@tas q=*]] [%pass p=* q=@tas r=[p=@tas q=*]]
@ -9852,37 +9944,45 @@
?. ((sane %tas) lal) ~ ?. ((sane %tas) lal) ~
%+ biff ((soft path) p.q.caq) %+ biff ((soft path) p.q.caq)
|= pax=path |= pax=path
%+ bind (song (spec (slot 15 caq))) =^ yav p.sew (~(spot wa p.sew) 15 caq)
|= hil=mill %+ bind (song yav)
[%& %pass pax lal hil] |= [hil=mill vel=worm]
[%& [%pass pax lal hil] vel]
:: ::
[%give p=[p=@tas q=*]] [%give p=[p=@tas q=*]]
%- (bond |.([%| p.p.q.caq])) %- (bond |.([%| p.p.q.caq]))
%+ bind (song (spec (slot 3 caq))) =^ yav p.sew (~(spot wa p.sew) 3 caq)
|= hil=mill %+ bind (song yav)
[%& %give hil] |= [hil=mill vel=worm]
[%& [%give hil] vel]
:: ::
[%sick p=[p=@tas q=*]] [%sick p=[p=@tas q=*]]
%- (bond |.([%| p.p.q.caq])) %- (bond |.([%| p.p.q.caq]))
%+ bind (song (spec (slot 3 caq))) =^ yav p.sew (~(spot wa p.sew) 3 caq)
|= hil=mill %+ bind (song yav)
[%& %sick hil] |= [hil=mill vel=worm]
[%& [%sick hil] vel]
:: ::
[%slip p=@tas q=[p=@tas q=*]] [%slip p=@tas q=[p=@tas q=*]]
%- (bond |.([%| p.q.q.caq])) %- (bond |.([%| p.q.q.caq]))
%+ biff ((soft ,@) p.q.caq) %+ biff ((soft ,@) p.q.caq)
|= lal=@tas |= lal=@tas
?. ((sane %tas) lal) ~ ?. ((sane %tas) lal) ~
%+ bind (song (spec (slot 7 caq))) =^ yav p.sew (~(spot wa p.sew) 7 caq)
|= hil=mill %+ bind (song yav)
[%& %slip lal hil] |= [hil=mill vel=worm]
[%& [%slip lal hil] vel]
== ==
:: ::
++ said :: vase to (list move) ++ said :: vase to (list move)
|= vud=vase |= vud=vase
|- ^- (list move) |- ^- (pair (list move) worm)
?: =(~ q.vud) ~ ?: =(~ q.vud) [~ p.sew]
[(need (sump (slot 2 vud))) $(vud (slot 3 vud))] =^ hed p.sew (~(slot wa p.sew) 2 vud)
=^ tal p.sew (~(slot wa p.sew) 3 vud)
=^ mov p.sew (need (sump hed))
=^ moz p.sew $(vud tal)
[[mov moz] p.sew]
:: ::
++ scry :: read namespace ++ scry :: read namespace
~/ %scry ~/ %scry
@ -9910,8 +10010,8 @@
++ soar :: scrub vane ++ soar :: scrub vane
|= sev=vase |= sev=vase
^- vase ^- vase
?: &(=(-.q.ves -.q.sev) =(+>.q.ves +>.q.sev)) ?: &(=(-.q.q.sew -.q.sev) =(+>.q.q.sew +>.q.sev))
ves :: unchanged, use old q.sew :: unchanged, use old
sev(+<.q [*@da *@ =>(~ |+(* ~))]) :: clear to stop leak sev(+<.q [*@da *@ =>(~ |+(* ~))]) :: clear to stop leak
:: ::
++ swim ++ swim
@ -9921,14 +10021,17 @@
hen=duct hen=duct
hil=mill hil=mill
== ==
^- [p=(list move) q=vase] ^- [[p=(list move) q=worm] q=vase]
:: ~& [%swim-wyt `@ud`~(wyt in p.sew)]
=+ ^= pru =+ ^= pru
?~ pux ?~ pux
=- ?^(- - ~&([%swim-call-vane lal] -)) ~| [%swim-call-vane lal]
%+ slur (slap rig [%cnzy %call]) =^ vax p.sew (~(slap wa p.sew) rig [%cnzy %call])
%^ slur-pro lal vax
(slid [%& duc.vil hen] (slix hil)) (slid [%& duc.vil hen] (slix hil))
=- ?^(- - ~&([%swim-take-vane lal] -)) ~| [%swim-take-vane lal]
%+ slur (slap rig [%cnzy %take]) =^ vax p.sew (~(slap wa p.sew) rig [%cnzy %take])
%^ slur-pro lal vax
;: slid ;: slid
[%& pah.vil u.pux] [%& pah.vil u.pux]
[%& duc.vil hen] [%& duc.vil hen]
@ -9936,17 +10039,17 @@
== ==
?~ pru ?~ pru
~& [%swim-lost lal (,@tas +>-.hil)] ~& [%swim-lost lal (,@tas +>-.hil)]
~> %slog.[1 (skol ?~(-.hil +<.hil (type +<.hil)))] [[~ p.sew] q.sew]
[~ ves] =^ pro p.sew (need pru)
=+ pro=(need pru) =^ moz p.sew (~(slap wa p.sew) pro [%cnzy %p])
:- (said (slap pro [%cnzy %p])) =^ vem p.sew (~(slap wa p.sew) pro [%cnzy %q])
(soar (slap pro [%cnzy %q])) [(said moz) (soar vem)]
-- --
-- --
:: ::
++ vint :: create vane ++ vint :: create vane
|= [lal=@tas vil=vile bud=vase pax=path txt=@ta] :: |= [lal=@tas vil=vile bud=vase pax=path txt=@ta] ::
(vent lal vil bud (slym (slap bud (rain pax txt)) bud)) (vent lal vil bud *worm (slym (slap bud (rain pax txt)) bud))
:: ::
++ viol :: vane tools ++ viol :: vane tools
|= but=type |= but=type
@ -9959,7 +10062,7 @@
== ==
:: ::
++ is :: operate in time ++ is :: operate in time
|= [vil=vile eny=@ bud=vase fan=(list ,[p=@tas q=vase])] |= [vil=vile eny=@ bud=vase niz=(pair worm (list ,[p=@tas q=vase]))]
|_ now=@da |_ now=@da
++ beck ++ beck
^- sled ^- sled
@ -9969,14 +10072,14 @@
=+ lal=(end 3 1 ron) =+ lal=(end 3 1 ron)
=+ ren=(care (rsh 3 1 ron)) =+ ren=(care (rsh 3 1 ron))
|- ^- (unit (unit cage)) |- ^- (unit (unit cage))
?~ fan ~ ?~ q.niz ~
?. =(lal p.i.fan) $(fan t.fan) ?. =(lal p.i.q.niz) $(q.niz t.q.niz)
%- scry:(wink:(vent lal vil bud q.i.fan) now (shax now) ..^$) %- scry:(wink:(vent lal vil bud p.niz q.i.q.niz) now (shax now) ..^$)
[fur ren bed] [fur ren bed]
:: ::
++ dink :: vase by char ++ dink :: vase by char
|= din=@tas ^- vase |= din=@tas ^- vase
?~(fan !! ?:(=(din p.i.fan) q.i.fan $(fan t.fan))) ?~(q.niz !! ?:(=(din p.i.q.niz) q.i.q.niz $(q.niz t.q.niz)))
:: ::
++ dint :: input routing ++ dint :: input routing
|= hap=path ^- @tas |= hap=path ^- @tas
@ -9992,12 +10095,12 @@
++ doos :: sleep until ++ doos :: sleep until
|= hap=path ^- (unit ,@da) |= hap=path ^- (unit ,@da)
=+ lal=(dint hap) =+ lal=(dint hap)
(doze:(wink:(vent lal vil bud (dink lal)) now 0 beck) now [hap ~]) (doze:(wink:(vent lal vil bud p.niz (dink lal)) now 0 beck) now [hap ~])
:: ::
++ hurl :: start loop ++ hurl :: start loop
|= [lac=? ovo=ovum] |= [lac=? ovo=ovum]
~? &(!lac !=(%belt -.q.ovo)) [%unix -.q.ovo p.ovo] ~? &(!lac !=(%belt -.q.ovo)) [%unix -.q.ovo p.ovo]
^- [p=(list ovum) q=(list ,[p=@tas q=vase])] ^- [p=(list ovum) q=(pair worm (list ,[p=@tas q=vase]))]
?> ?=(^ p.ovo) ?> ?=(^ p.ovo)
%+ kick lac %+ kick lac
:~ :* i.p.ovo :~ :* i.p.ovo
@ -10012,27 +10115,27 @@
:: ::
++ race :: take ++ race :: take
|= [org=@tas lal=@tas pux=(unit wire) hen=duct hil=mill ves=vase] |= [org=@tas lal=@tas pux=(unit wire) hen=duct hil=mill ves=vase]
^- [p=(list move) q=vase] ^- [p=[p=(list move) q=worm] q=vase]
=+ ven=(vent lal vil bud ves) =+ ven=(vent lal vil bud [p.niz ves])
=+ win=(wink:ven now (shax now) beck) =+ win=(wink:ven now (shax now) beck)
(swim:win org pux hen hil) (swim:win org pux hen hil)
:: ::
++ fire :: execute ++ fire :: execute
|= [org=term lal=term pux=(unit wire) hen=duct hil=mill] |= [org=term lal=term pux=(unit wire) hen=duct hil=mill]
?: &(?=(^ pux) ?=(~ hen)) ?: &(?=(^ pux) ?=(~ hen))
[[[[lal u.pux] (curd +>.hil)]~ ~] fan] [[[[lal u.pux] (curd +>.hil)]~ ~] niz]
=+ naf=fan =+ naf=q.niz
|- ^- [[p=(list ovum) q=(list muse)] _fan] |- ^- [[p=(list ovum) q=(list muse)] _niz]
?~ naf [[~ ~] ~] ?~ naf [[~ ~] [p.niz ~]]
?. =(lal p.i.naf) ?. =(lal p.i.naf)
=+ tuh=$(naf t.naf) =+ tuh=$(naf t.naf)
[-.tuh [i.naf +.tuh]] [-.tuh [+<.tuh [i.naf +>.tuh]]]
=+ fiq=(race org lal pux hen hil q.i.naf) =+ fiq=(race org lal pux hen hil q.i.naf)
[[~ (turn p.fiq |=(a=move [lal a]))] [[p.i.naf q.fiq] t.naf]] [[~ (turn p.p.fiq |=(a=move [lal a]))] [q.p.fiq [[p.i.naf q.fiq] t.naf]]]
:: ::
++ jack :: dispatch card ++ jack :: dispatch card
|= [lac=? gum=muse] |= [lac=? gum=muse]
^- [[p=(list ovum) q=(list muse)] _fan] ^- [[p=(list ovum) q=(list muse)] _niz]
=. lac |(lac ?=(?(%g %f) p.gum)) =. lac |(lac ?=(?(%g %f) p.gum))
%+ fire %+ fire
p.gum p.gum
@ -10068,9 +10171,9 @@
++ kick :: new main loop ++ kick :: new main loop
|= [lac=? mor=(list muse)] |= [lac=? mor=(list muse)]
=| ova=(list ovum) =| ova=(list ovum)
|- ^- [p=(list ovum) q=(list ,[p=@tas q=vase])] |- ^- [p=(list ovum) q=(pair worm (list ,[p=@tas q=vase]))]
?~ mor [(flop ova) fan] ?~ mor [(flop ova) niz]
=^ nyx fan (jack lac i.mor) =^ nyx niz (jack lac i.mor)
$(ova (weld p.nyx ova), mor (weld q.nyx t.mor)) $(ova (weld p.nyx ova), mor (weld q.nyx t.mor))
-- --
-- --
@ -10084,7 +10187,7 @@
=+ vil=(viol p.bud) :: cached reflexives =+ vil=(viol p.bud) :: cached reflexives
=| $: lac=? :: laconic bit =| $: lac=? :: laconic bit
eny=@ :: entropy eny=@ :: entropy
fan=(list ,[p=@tas q=vase]) :: modules niz=(pair worm (list ,[p=@tas q=vase])) :: modules
== :: == ::
=< |% =< |%
++ come |= [@ (list ovum) pone] :: 11 ++ come |= [@ (list ovum) pone] :: 11
@ -10128,13 +10231,13 @@
++ keep :: wakeup delay ++ keep :: wakeup delay
|= [now=@da hap=path] |= [now=@da hap=path]
=> .(+< ((hard ,[now=@da hap=path]) +<)) => .(+< ((hard ,[now=@da hap=path]) +<))
(~(doos (is vil eny bud fan) now) hap) (~(doos (is vil eny bud niz) now) hap)
:: ::
++ load :: load compatible ++ load :: load compatible
|= [yen=@ ova=(list ovum) nyf=pane] |= [yen=@ ova=(list ovum) nyf=pane]
^+ [ova +>] ^+ [ova +>]
=: eny yen =: eny yen
fan nyf q.niz nyf
== ==
|- ^+ [ova +>.^$] |- ^+ [ova +>.^$]
?~ ova ?~ ova
@ -10149,7 +10252,7 @@
|= [now=@da hap=path] |= [now=@da hap=path]
^- (unit) ^- (unit)
?~ hap [~ hoon] ?~ hap [~ hoon]
=+ rob=((slod ~(beck (is vil eny bud fan) now)) hap) =+ rob=((slod ~(beck (is vil eny bud niz) now)) hap)
?~ rob ~ ?~ rob ~
?~ u.rob ~ ?~ u.rob ~
[~ u.u.rob] [~ u.u.rob]
@ -10159,8 +10262,8 @@
=. eny (mix eny (shax now)) =. eny (mix eny (shax now))
:: ~& [%poke -.q.ovo] :: ~& [%poke -.q.ovo]
^- [(list ovum) _+>] ^- [(list ovum) _+>]
=^ zef fan =^ zef niz
(~(hurl (is vil eny bud fan) now) lac ovo) (~(hurl (is vil eny bud niz) now) lac ovo)
[zef +>.$] [zef +>.$]
:: ::
++ vega :: reboot kernel ++ vega :: reboot kernel
@ -10179,7 +10282,7 @@
~& [%vega-compiled hoon nex] ~& [%vega-compiled hoon nex]
?> (lte nex hoon) ?> (lte nex hoon)
=+ gat=.*(ken .*(ken [0 ?:(=(nex hoon) 86 11)])) =+ gat=.*(ken .*(ken [0 ?:(=(nex hoon) 86 11)]))
=+ sam=[eny ova fan] =+ sam=[eny ova q.niz]
=+ raw=.*([-.gat [sam +>.gat]] -.gat) =+ raw=.*([-.gat [sam +>.gat]] -.gat)
[[[~ %vega hap] ((list ovum) -.raw)] +.raw] [[[~ %vega hap] ((list ovum) -.raw)] +.raw]
:: ::
@ -10192,15 +10295,17 @@
=+ vax=(slap pit gen) =+ vax=(slap pit gen)
+>.$(bud vax) +>.$(bud vax)
%_ +> %_ +>
fan q.niz
|- ^+ fan |- ^+ q.niz
?~ fan ?~ q.niz
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)] ~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
[[lal.fav ves:(vint lal.fav vil bud pax.fav txt.fav)] fan] [[lal.fav q.sew:(vint lal.fav vil bud pax.fav txt.fav)] q.niz]
?. =(lal.fav p.i.fan) ?. =(lal.fav p.i.q.niz)
[i.fan $(fan t.fan)] [i.q.niz $(q.niz t.q.niz)]
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)] ~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
[[p.i.fan ves:(ruck:(vent lal.fav vil bud q.i.fan) pax.fav txt.fav)] t.fan] :_ t.q.niz
:- p.i.q.niz
q.sew:(ruck:(vent lal.fav vil bud [p.niz q.i.q.niz]) pax.fav txt.fav)
== ==
:: ::
++ wish :: external compute ++ wish :: external compute

View File

@ -62,7 +62,7 @@
=+ lox=((soft axle) old) =+ lox=((soft axle) old)
^+ ..^$ ^+ ..^$
?~ lox ?~ lox
~& %lunt-reset ~& %khan-reset
..^$ ..^$
..^$(+>- u.lox) ..^$(+>- u.lox)
:: ::

793
main/app/rodeo/core.hook Normal file
View File

@ -0,0 +1,793 @@
::
:::: /hook/core/rodeo/app
::
/? 314
/- *rodeo
/+ rodeo
::
::::
::
!:
=> |% :: data structures
++ house ,[%1 house-1] :: full state
++ house-any :: app history
$% [%1 house-1] :: 1: rodeo
[%0 house-0] :: 0: initial version
== ::
++ house-1 ::
$: stories=(map span story) :: conversations
general=(set bone) :: meta-subscribe
outbox=(pair ,@ud (map ,@ud thought)) :: urbit outbox
sent=(map ,@ud serial) :: own tweets
folks=(map ship human) :: human identities
== ::
++ house-0 :: legacy state
%+ map path ::
,[p=(list zong) q=(map ship ,?)] ::
:: ::
++ zong :: legacy messages
$% $: %mess p=@da q=ship ::
$= r ::
$% [%do p=@t] ::
[%exp p=@t q=tank] ::
[%say p=@t] ::
== == == ::
++ story :: a conversation
$: count=@ud :: (lent grams)
grams=(list telegram) :: all history
locals=(map ship (pair ,@da status)) :: local presence
remotes=(map station atlas) :: remote presence
sequence=(map station ,@ud) :: stations heard
shape=config :: configuration
known=(map serial ,@ud) :: messages heard
guests=(map bone river) :: message followers
viewers=(set bone) :: presence followers
owners=(set bone) :: config followers
== ::
++ river (pair point point) :: stream definition
++ point :: stream endpoint
$% [%ud p=@ud] :: by number
[%da p=@da] :: by date
== ::
++ gift :: result
$% [%rust %rodeo-report report] :: refresh
[%mean ares] :: cancel
[%nice ~] :: accept
== ::
++ sign :: response
$% $: %e :: from %eyre
$% [%thou p=httr] :: HTTP response
== == ::
$: %g :: application
$% [%mean p=ares] :: cancel
[%nice ~] :: acknowledge
[%rust %rodeo-report report] :: refresh
== == ::
$: %t ::
$% [%wake ~] :: timer wakeup
== == == ::
++ move ,[p=bone q=(mold note gift)] :: all actions
++ hapt ,[p=ship q=path] :: app instance
++ note :: requests
$% $: %c ::
$% [%info p=@p q=@tas r=nori] ::
== == ::
$: %e :: through %eyre
$% [%them p=(unit hiss)] :: HTTP request
== == ::
$: %g :: network
$% [%mess p=hapt q=ship r=cage] :: message
[%nuke p=hapt q=ship] :: cancel
[%show p=hapt q=ship r=path] :: subscribe
== == ::
$: %t ::
$% [%wait p=@da] ::
== == == ::
++ twim :: twitter endpoints
$%([%mine p=span] [%stat p=@uv]) ::
--
|_ [hid=hide house]
++ ra :: transaction core
|_ [ost=bone moves=(list move)]
++ ra-abet :: resolve core
^- [(list move) _+>]
[(flop moves) +>]
::
++ ra-emil :: ra-emit move list
|= mol=(list move)
%_(+> moves (welp (flop mol) moves))
::
++ ra-emit :: emit a move
|= mov=move
%_(+> moves [mov moves])
::
++ ra-ever :: emit success
(ra-emit ost %give %nice ~)
::
++ ra-evil :: emit error
|= msg=cord
~& [%ra-evil msg]
(ra-emit ost %give %mean ~ msg ~)
::
++ ra-hiss :: emit http request
|= [pax=path hiz=hiss]
(ra-emit ost %pass pax %e %them ~ hiz)
::
++ ra-house :: emit stations
|= ost=bone
%+ ra-emit ost
:^ %give %rust %rodeo-report
:- %house
%- ~(gas in *(set span))
^- (list span)
(turn (~(tap by stories) ~) |=([a=span *] a))
::
++ ra-homes :: update stations
=+ gel=general
|- ^+ +>
?~ gel +>
=. +> $(gel l.gel)
=. +> $(gel r.gel)
(ra-house n.gel)
::
++ ra-init :: initialize rodeo
=+ sir=(sein our.hid)
%+ ra-apply our.hid
:+ %design (main our.hid)
:- ~
:_ [%| ~]
?:(=(sir our.hid) ~ [[%& sir (main sir)] ~ ~])
::
++ ra-apply :: apply command
|= [her=ship cod=command]
^+ +>
:: ~& [%ra-apply cod]
?- -.cod
%design
?. =(her our.hid)
(ra-evil %rodeo-no-owner)
?~ q.cod
?. (~(has by stories) p.cod)
(ra-evil %rodeo-no-story)
=. +>.$ (ra-config p.cod *config)
ra-ever(stories (~(del by stories) p.cod))
=. +>.$ (ra-config p.cod u.q.cod)
ra-ever
::
%review ra-ever:(ra-think | her +.cod)
%publish ra-ever:(ra-think & her +.cod)
%ping (ra-notice her +.cod)
==
::
++ ra-config :: configure story
|= [man=span con=config]
^+ +>
=+ :- neu=(~(has by stories) man)
pur=(fall (~(get by stories) man) *story)
=. +>.$ pa-abet:(~(pa-reform pa man pur) con)
?:(neu +>.$ ra-homes)
::
++ ra-friend :: %friend response
|= [man=span sih=sign]
^+ +>
=+ pur=(~(get by stories) man)
?~ pur ~& [%ra-friend-none man] +>.$
pa-abet:(~(pa-friend pa man u.pur) sih)
::
++ ra-stalk :: %stalk response
|= [man=span tay=station sih=sign]
^+ +>
=+ pur=(~(get by stories) man)
?~ pur ~& [%ra-stalk-none man] +>.$
pa-abet:(~(pa-stalk pa man u.pur) tay sih)
::
++ ra-timer :: timeout
^+ .
=+ paz=stories
|- ^+ +>
?~ paz +>.$
=. +>.$ $(paz l.paz)
=. +>.$ $(paz r.paz)
pa-abet:~(pa-timer pa p.n.paz q.n.paz)
::
++ ra-twitter :: %twitter response
|= [met=twim sih=sign]
^+ +>
!!
::
++ ra-repeat :: %repeat response
|= [num=@ud her=ship man=span sih=sign]
=+ oot=(~(get by q.outbox) num)
?~ oot ~& [%ra-repeat-none num] +>.$
=. q.outbox (~(del by q.outbox) num)
=. q.u.oot
%+ ~(put by q.u.oot)
[%& her man]
?+ sih !!
[%g %mean *] ~&([%rodeo-repeat-rejected num her man sih] %rejected)
[%g %nice ~] %received
==
(ra-think | our.hid u.oot ~)
::
++ ra-cancel :: drop a bone
%_ .
general (~(del in general) ost)
stories
|- ^- (map span story)
?~ stories ~
:- :- p.n.stories
%= q.n.stories
guests (~(del by guests.q.n.stories) ost)
viewers (~(del in viewers.q.n.stories) ost)
owners (~(del in owners.q.n.stories) ost)
==
[$(stories l.stories) $(stories r.stories)]
==
::
++ ra-subscribe :: listen to
|= [her=ship pax=path]
^+ +>
:: ~& [%ra-subscribe her pax]
?: ?=(~ pax)
(ra-house(general (~(put in general) ost)) ost)
?. ?=([@ @ *] pax)
(ra-evil %rodeo-bad-path)
=+ ^= vab ^- (set ,@tas)
=| vab=(set ,@tas)
|- ^+ vab
?: =(0 i.pax) vab
$(i.pax (rsh 3 1 i.pax), vab (~(put in vab) (end 3 1 i.pax)))
=+ pur=(~(get by stories) i.t.pax)
?~ pur
~& [%bad-subscribe-story-c i.t.pax]
(ra-evil %rodeo-no-story)
=+ soy=~(. pa i.t.pax u.pur)
=. soy ?.((~(has in vab) %a) soy (pa-watch:soy her))
=. soy ?.((~(has in vab) %x) soy (pa-master:soy her))
=. soy ?.((~(has in vab) %f) soy (pa-listen:soy her t.t.pax))
pa-abet:soy
::
++ ra-think :: publish/review
|= [pub=? her=ship tiz=(list thought)]
^+ +>
?~ tiz +>
$(tiz t.tiz, +> (ra-consume pub her i.tiz))
::
++ ra-consume :: consume thought
|= [pub=? her=ship tip=thought]
=+ aud=`(list (pair station delivery))`(~(tap by q.tip) ~)
|- ^+ +>.^$
?~ aud +>.^$
$(aud t.aud, +>.^$ (ra-conduct pub her p.i.aud tip))
::
++ ra-notice :: declare presence
|= [her=ship vig=(map station presence)]
^+ +>
=+ sul=(~(tap by vig) ~)
|- ^+ +>.^$
?~ sul ra-ever
=. +>.^$ $(sul t.sul)
?- -.p.i.sul
%| +>.^$
%& ?: =(`ship`p.p.p.i.sul our.hid)
(ra-appear her q.p.p.i.sul q.i.sul)
?: =(her our.hid)
(ra-provoke p.p.p.i.sul i.sul)
(ra-evil %rodeo-unauthorized-presence)
==
::
++ ra-appear :: review presence
|= [her=ship man=span per=presence]
=^ who folks
=+ who=(~(get by folks) her)
?^ who [u.who folks]
=+ who=`human`[~ `(scot %p her)] :: XX do right
[who (~(put by folks) her who)]
=+ pur=(~(get by stories) man)
?~ pur
~& [%bad-appear man]
(ra-evil %rodeo-no-story)
pa-abet:(~(pa-notify pa man u.pur) her per who)
::
++ ra-provoke :: forward presence
|= [him=ship tay=station per=presence]
%+ ra-emit ost
:* %pass
/provoke
%g
%mess
[him /rodeo]
our.hid
[%rodeo-command !>(`command`[%ping [[tay per] ~ ~]])]
==
::
++ ra-conduct :: thought to station
|= [pub=? her=ship tay=station tip=thought]
^+ +>
:: ~& [%ra-conduct pub her tay]
?- -.tay
%& ?: pub
=. her our.hid :: XX security!
?: =(her p.p.tay)
(ra-record q.p.tay p.p.tay tip)
(ra-transmit p.tay tip)
?. =(our.hid p.p.tay)
+>
(ra-record q.p.tay her tip)
%| ?. pub +>
?- -.p.tay
%twitter
!!
== ==
::
++ ra-record :: add to story
|= [man=span gam=telegram]
^+ +>
=+ pur=(~(get by stories) man)
?~ pur
~& [%no-story man]
+>.$
pa-abet:(~(pa-learn pa man u.pur) gam)
::
++ ra-transmit :: send to neighbor
|= [cuz=cousin tip=thought]
^+ +>
=. +>
%+ ra-emit ost
:* %pass
/repeat/(scot %ud p.outbox)/(scot %p p.cuz)/[q.cuz]
%g
%mess
[p.cuz /rodeo]
our.hid
[%rodeo-command !>(`command`[%review tip ~])]
==
+>(p.outbox +(p.outbox), q.outbox (~(put by q.outbox) p.outbox tip))
::
++ pa :: story core
|_ $: man=span
story
==
++ pa-abet
^+ +>
+>(stories (~(put by stories) man `story`+<+))
::
++ pa-admire :: accept from
|= her=ship
^- ?
::?- -.cordon.shape
:: %& (~(has in p.cordon.shape) her)
:: %| !(~(has in p.cordon.shape) her)
::==
&
::
++ pa-timer :: timer expire
^+ .
=+ cul=(~(tap by locals) ~)
=+ ^= hay
%+ skim cul
|= [a=ship b=@da c=status]
(lte lat.hid (add ~m2 b))
?: =(cul hay) +>
%. viewers
pa-display(locals (~(gas by *(map ship (pair ,@da status))) hay))
::
++ pa-watch :: watch presence
|= her=ship
?. (pa-admire her)
(pa-sauce ost [[%mean ~ %rodeo-watch-unauthorized ~] ~])
=. viewers (~(put in viewers) ost)
(pa-display ost ~ ~)
::
++ pa-master :: hear config
|= her=ship
?. (pa-admire her)
(pa-sauce ost [[%mean ~ %rodeo-master-unauthorized ~] ~])
=. owners (~(put in owners) ost)
:: ~& [%pa-master her man shape]
(pa-sauce ost [[%rust %rodeo-report %config shape] ~])
::
++ pa-display :: update presence
|= vew=(set bone)
=+ ^= reg
:_ remotes
|- ^- atlas
?~ locals ~
[[p.n.locals q.q.n.locals] $(locals l.locals) $(locals r.locals)]
:: ~& [%pa-display man reg]
|- ^+ +>.^$
?~ vew +>.^$
=. +>.^$ $(vew l.vew)
=. +>.^$ $(vew r.vew)
(pa-sauce n.vew [[%rust %rodeo-report %group reg] ~])
::
++ pa-monitor :: update config
=+ owe=owners
|- ^+ +>
?~ owe +>
=. +> $(owe l.owe)
=. +> $(owe r.owe)
:: ~& [%pa-monitor man shape]
(pa-sauce n.owe [[%rust %rodeo-report %config shape] ~])
::
++ pa-friend :: subscribed update
|= sih=sign
^+ +>
?+ sih ~&([%rodeo-bad-friend sih] !!)
[%g %nice ~]
:: ~& %pa-friend-nice
+>.$
::
[%g %rust %rodeo-report *]
:: ~& [%pa-friend-report +>+.sih]
?+ -.+>+.sih ~&([%rodeo-odd-friend sih] !!)
%config +>.$
%group +>.$
%grams (pa-lesson q.+.+>+.sih)
==
==
::
++ pa-stalk :: subscribed present
|= [tay=station sih=sign]
^+ +>
?+ sih ~&([%rodeo-bad-friend sih] !!)
[%g %nice ~]
:: ~& %pa-stalk-nice
+>.$
::
[%g %rust %rodeo-report *]
?+ -.+>+.sih ~&([%rodeo-odd-friend sih] !!)
%group
(pa-remind tay +.+>+.sih)
==
==
::
++ pa-scrub :: pass forward
|= [ost=bone bub=(list (pair path note))]
%_ +>.$
moves
(welp (flop (turn bub |=(a=(pair path note) [ost %pass a]))) moves)
==
::
++ pa-sauce :: send backward
|= [ost=bone gub=(list gift)]
%_ +>.$
moves
(welp (flop (turn gub |=(a=gift [ost %give a]))) moves)
==
::
++ pa-abjure :: unsubscribe move
|= tal=(list station)
%+ pa-scrub 0
%- zing
%+ turn tal
|= tay=station
?- -.tay
%| ~& tweet-abjure/p.p.tay
!!
::
%& :: ~& [%pa-abjure [our.hid man] [p.p.tay q.p.tay]]
:~ :- /friend/nuke/[man]
[%g %nuke [p.p.tay /rodeo] our.hid]
:- /stalk/nuke/[man]
[%g %nuke [p.p.tay /rodeo] our.hid]
==
==
::
++ pa-acquire :: subscribe to
|= tal=(list station)
%+ pa-scrub 0
%- zing
%+ turn tal
|= tay=station
^- (list (pair path note))
=+ num=(fall (~(get by sequence) tay) 0)
?- -.tay
%| ~& tweet-acquire/p.p.tay
!!
::
%& ~& [%pa-acquire [our.hid man] [p.p.tay q.p.tay]]
:~ :- /friend/show/[man]
[%g %show [p.p.tay /rodeo] our.hid /af/[q.p.tay]/(scot %ud num)]
==
==
::
++ pa-reform :: reconfigure, ugly
|= cof=config
=+ ^= dif ^- (pair (list station) (list station))
=+ old=`(list station)`(~(tap in sources.shape) ~)
=+ new=`(list station)`(~(tap in sources.cof) ~)
:- (skip new |=(a=station (~(has in sources.shape) a)))
(skip old |=(a=station (~(has in sources.cof) a)))
=. +>.$ (pa-acquire p.dif)
=. +>.$ (pa-abjure q.dif)
=. shape cof
pa-monitor
::
++ pa-cancel :: unsubscribe from
^+ .
:: ~& [%pa-cancel ost]
=. guests (~(del in guests) ost)
(pa-sauce ost [[%mean ~] ~])
::
++ pa-notify :: local presence
|= [her=ship saz=status]
^+ +>
=+ guz=(~(get by locals) her)
=. locals (~(put by locals) her lat.hid saz)
?. |(?=(~ guz) !=(saz q.u.guz))
+>.$
(pa-display viewers)
::
++ pa-remind :: remote presence
|= [tay=station loc=atlas rem=(map station atlas)]
=+ ^= buk
=+ mer=(turn (~(tap by rem) ~) |=([* a=atlas] a))
|- ^- atlas
?~ mer loc
=. loc $(mer t.mer)
=+ dur=`(list (pair ship status))`(~(tap by i.mer) ~)
|- ^- atlas
?~ dur loc
=. loc $(dur t.dur)
=+ fuy=(~(get by loc) p.i.dur)
?~ fuy (~(put by loc) p.i.dur q.i.dur)
?: =(`presence`p.q.i.dur `presence`p.u.fuy)
loc
?- p.u.fuy
%gone (~(del by loc) p.i.dur q.i.dur)
%talk loc
%hear (~(put by loc) p.i.dur q.i.dur)
==
=+ gub=(~(get by remotes) tay)
:: ~& [%pa-remind tay gub buk]
?. |(?=(~ gub) !=(buk u.gub))
+>.$
=. remotes (~(put by remotes) tay buk)
(pa-display viewers)
::
++ pa-start :: start stream
|= riv=river
^+ +>
=- =. +>.$ (pa-sauce ost [[%rust %rodeo-report %grams q.lab r.lab] ~])
?: p.lab
(pa-sauce ost [[%mean ~] ~])
+>.$(guests (~(put by guests) ost riv))
^= lab
=+ [end=count gaz=grams dun=| zeg=*(list telegram)]
|- ^- (trel ,? ,@ud (list telegram))
?~ gaz [dun end (flop zeg)]
?: ?- -.q.riv :: after the end
%ud (lte p.q.riv end)
%da (lte p.q.riv p.r.q.i.gaz)
==
$(end (dec end), gaz t.gaz)
?: ?- -.p.riv :: before the start
%ud (lth end p.p.riv)
%da (lth p.r.q.i.gaz p.p.riv)
==
[dun end (flop zeg)]
$(end (dec end), gaz t.gaz, zeg [i.gaz zeg])
::
++ pa-listen :: subscribe
|= [her=ship pax=path]
^+ +>
=. +> (pa-watch her)
=. +> (pa-master her)
?. (pa-admire her)
(pa-sauce ost [[%mean ~ %rodeo-listen-unauthorized ~] ~])
=+ ^= ruv ^- (unit river)
?: ?=(~ pax)
`[[%ud count] [%da (dec (bex 128))]]
?: ?=([@ ~] pax)
=+ say=(slay i.pax)
?. ?=([~ %$ ?(%ud %da) @] say) ~
`[(point +>.say) [%da (dec (bex 128))]]
?. ?=([@ @ ~] pax) ~
=+ [say=(slay i.pax) den=(slay i.t.pax)]
?. ?=([~ %$ ?(%ud %da) @] say) ~
?. ?=([~ %$ ?(%ud %da) @] den) ~
`[(point +>.say) (point +>.den)]
:: ~& [%pa-listen her pax ruv]
?~ ruv
(pa-sauce ost [[%mean ~ %rodeo-malformed ~] ~])
(pa-start u.ruv)
::
++ pa-refresh :: update stream
|= [num=@ud gam=telegram]
:: ~& [%pa-refresh num gam]
=+ ^= moy
|- ^- (pair (list bone) (list move))
?~ guests [~ ~]
:: ~& [%pa-refresh num n.guests]
=+ lef=$(guests l.guests)
=+ rit=$(guests r.guests)
=+ old=[p=(welp p.lef p.rit) q=(welp q.lef q.rit)]
?: ?- -.q.q.n.guests :: after the end
%ud (lte p.q.q.n.guests num)
%da (lte p.q.q.n.guests p.r.q.gam)
==
[[p.n.guests p.old] [[p.n.guests %give %mean ~] q.old]]
?: ?- -.p.q.n.guests :: before the start
%ud (gth p.p.q.n.guests num)
%da (gth p.p.q.n.guests p.r.q.gam)
==
old
:- p.old
[[p.n.guests %give %rust %rodeo-report %grams num gam ~] q.old]
=. moves (welp q.moy moves)
|- ^+ +>.^$
?~ p.moy +>.^$
$(p.moy t.p.moy, guests (~(del by guests) i.p.moy))
::
++ pa-lesson :: learn multiple
|= gaz=(list telegram)
^+ +>
?~ gaz +>
$(gaz t.gaz, +> (pa-learn i.gaz))
::
++ pa-learn :: learn message
|= gam=telegram
^+ +>
?. (pa-admire p.gam)
~& %pa-admire-rejected
+>.$
=. q.q.gam (~(put by q.q.gam) [%& our.hid man] %received)
=+ old=(~(get by known) p.q.gam)
?~ old
(pa-append gam)
(pa-revise u.old gam)
::
++ pa-append :: append new
|= gam=telegram
^+ +>
%+ %= pa-refresh
grams [gam grams]
count +(count)
known (~(put by known) p.q.gam count)
==
count
gam
::
++ pa-revise :: revise existing
|= [num=@ud gam=telegram]
=+ way=(sub count num)
=. grams (welp (scag (dec way) grams) [gam (slag way grams)])
(pa-refresh num gam)
--
--
++ peer
|= [ost=bone her=ship pax=path]
^- [(list move) _+>]
:: ~& [%rodeo-peer ost her pax]
ra-abet:(~(ra-subscribe ra ost ~) her pax)
::
++ poke-rodeo-command
|= [ost=bone her=ship cod=command]
^- [(list move) _+>]
:: ~& [%rodeo-poke-command her cod]
ra-abet:(~(ra-apply ra ost ~) her cod)
::
++ pour
|= [ost=bone pax=path sih=*]
^- [(list move) _+>]
:: ~& sih=sih
=+ sih=((hard sign) sih)
:: ~& [%rodeo-pour ost pax sih]
?+ pax ~& [%rodeo-strange-path pax] !!
::
[%provoke ~] [~ +>.$]
[%time ~]
?> ?=(0 ost)
=^ moz +>.$ ra-abet:~(ra-timer ra 0 ~)
:_(+>.$ :_(moz [0 %pass /time %t %wait (add ~s10 lat.hid)]))
::
[%twitter *]
=- ra-abet:(~(ra-twitter ra ost ~) met sih)
^= met
?+ t.pax ~& [%rodeo-twitter-strange-path pax] !!
[%mine @ @ ~]
[i.t.pax i.t.t.t.pax]
[%stat @ ~]
[i.t.pax (slav %uv i.t.t.pax)]
==
::
[%friend *]
?> ?=([@ @ ~] t.pax)
?. =(%show i.t.pax)
~& [%pour-friend-nuke-nuke pax]
[~ +>.$]
ra-abet:(~(ra-friend ra ost ~) i.t.t.pax sih)
::
[%stalk *]
?> ?=([@ @ @ @ ~] t.pax)
?. =(%show i.t.pax)
~& [%pour-friend-nuke-nuke pax]
[~ +>.$]
=+ [man tay]=[i.t.t.pax [%& (slav %p i.t.t.t.pax) i.t.t.t.t.pax]]
ra-abet:(~(ra-stalk ra ost ~) man tay sih)
::
[%repeat *]
?> ?=([@ @ @ ~] t.pax)
=+ [num her man]=[(slav %ud i.t.pax) (slav %p i.t.t.pax) i.t.t.t.pax]
ra-abet:(~(ra-repeat ra ost ~) num her man sih)
==
::
++ pull
|= ost=bone
^- [(list move) _+>]
:: ~& [%rodeo-pull ost]
ra-abet:~(ra-cancel ra ost ~)
::
++ poke-bit
|= [ost=bone you=ship ~]
^- [(list move) _+>]
:_ +>.$
=+ paf=/(scot %p our.hid)/try/(scot %da lat.hid)/rodeo/backlog/jam
[ost %pass /jamfile %c %info our.hid (foal paf (jam +<+.+>.$))]~
::
++ prep
|= old=(unit (unit house-any))
^- [(list move) _+>]
?> ?=(^ old)
=+ moz=`(list move)`[0 %pass /time %t %wait (add ~s10 lat.hid)]~
|-
?~ u.old
=+ paf=/(scot %p our.hid)/try/(scot %da lat.hid)/rodeo/backlog/jam
?. ?=([%0 %0 %0] [.^(%cy paf)])
$(u.old (some ((hard house-any) (cue ((hard ,@) .^(%cx paf))))))
~& %rodeo-prep-new
ra-abet:~(ra-init ra 0 moz)
~& %rodeo-prep-old
:- moz
|-
?- -.u.u.old
%1 %_(+>.^^$ +<+ u.u.old)
%0 $(u.u.old [%1 (house-0-to-house-1 +.u.u.old)])
==
::
++ house-0-to-house-1
|= vat=house-0
^- house-1
=- :* stories=-
general=~
outbox=[0 ~]
sent=~
folks=~
==
^- (map span story)
=- %- ~(run by -)
|= grams=(list telegram)
^- story
:* count=(lent grams)
grams=grams
locals=~
remotes=~
sequence=~
shape=[.(cordon [%| ~])]:*config
^= known %- mo ^- (list ,[serial @]) =< +
(roll grams |=([telegram a=@ b=(list ,[serial @])] [+(a) [a p.q] b]))
guests=~
viewers=~
owners=~
==
^- (map span (list telegram))
%- mo %+ turn (~(tap by vat))
|= [a=path b=(list zong) c=(map ship ,?)]
=+ ^= par
?: =(/ a) 'hub'
=+ (turn a |=(d=span leaf/(trip d)))
(crip ~(ram re %rose ["_" ~ ~] -))
:- par
=+ aud=`audience`[[[%& our.hid par] %received] `~]
=+ ^= spe
|= r=_r:*zong ^- speech
?- -.r
%say [%lin %& p.r]
%do [%lin %| p.r]
%exp [%fat [%tank q.r ~] [%exp p.r]]
==
%+ turn b
|= d=zong ^- telegram
[q.d (sham eny.hid d) aud p.d (spe r.d)]
--

File diff suppressed because it is too large Load Diff

19
main/lib/rodeo/core.hook Normal file
View File

@ -0,0 +1,19 @@
::
:::: /hook/core/rodeo/lib
::
:: This file is in the public domain.
::
/? 314
/- *rodeo
::
::::
::
|%
++ main :: main story
|= our=ship ^- cord
=+ can=(clan our)
?+ can %porch
%czar %court
%king %floor
==
--

View File

@ -0,0 +1,91 @@
::
:::: /hook/door/rodeo-command/mar
::
/? 314
/- *rodeo
!:
|_ cod=command
::
++ grab :: convert from
|%
++ noun command :: clam from %noun
++ json
=> [jo ..command]
|= a=json ^- command
=- (need ((of -) a))
=< :~ publish/(ar thot)
review/(ar thot)
design/(ot party/so config/(mu conf) ~)
ping/auri
==
|%
++ op :: parse keys of map
|* [fel=_rule wit=fist]
%+ cu mo
%- ci :_ (om wit)
|= a=(map cord ,_(need *wit))
^- (unit (list ,_[(wonk *fel) (need *wit)]))
(zl (turn (~(tap by a)) (head-rush fel)))
::
++ as :: array as set
:: |*(a=fist (cu sa (ar a))) :: XX types
|* a=fist
%- cu :_ (ar a)
~(gas in *(set ,_(need *a)))
::
++ lake |*(a=_,* $+(json (unit a)))
++ peach
|* a=_[rule rule]
|= tub=nail
^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a))))
%. tub
;~(pose (stag %& -.a) (stag %| +.a))
::
++ head-rush
|* a=_rule
|* [b=cord c=*]
=+ nit=(rush b a)
?~ nit ~
(some [u.nit c])
::
::
++ thot
^- $+(json (unit thought))
%- ot :~
serial/(ci (slat %uv) so)
audience/audi
statement/stam
==
::
++ audi (op stati (ci (soft delivery) so)) :: audience
++ auri (op stati (ci (soft presence) so))
::
++ stati
^- $+(nail (like station))
%+ peach
;~((glue fas) ;~(pfix sig fed:ag) urs:ab)
%+ sear (soft partner)
;~((glue fas) sym urs:ab) :: XX [a-z0-9_]{1,15}
::
++ stam
^- $+(json (unit statement))
=- (ot now/di speech/(of -) ~)
:~ own/so
say/so
lin/(ot say/bo txt/so ~)
:: exp/(cu |=(a=cord [a ~]) so)
:: inv/(ot ship/(su fed:ag) party/(su urs:ab) ~)
==
::
::
++ conf
^- $+(json (unit config))
%- ot :~
sources/(as (su stati))
:- %cordon
%+ cu |*(a=^ ?~(-.a a a)) :: XX do type stuff
(ot white/bu list/(as (su fed:ag)) ~)
==
--
-- --

View File

@ -0,0 +1,93 @@
::
:::: /hook/door/rodeo-report/mar
::
/? 314
/- *rodeo
!:
|_ rep=report
::
++ grab :: convert from
|%
++ noun report :: clam from %noun
--
++ grow
|%
++ mime [/text/json (taco (crip (pojo json)))]
++ json
=> +
|^ %+ joba -.rep
?- -.rep
%config ~! rep (conf +.rep)
%house [%a (turn (~(tap by +.rep)) joce)]
%grams (jobe num/(jone p.rep) tele/[%a (turn q.rep gram)] ~)
::%group (grop +.rep)
%group (jobe local/(grop p.rep) global/%.(q.rep (jome stan grop)) ~)
==
++ joce |=(a=span [%s a])
++ jope |=(a=ship (jape +:<a>)) ::[%s (crip +:(scow %p a))])
++ joke |=(a=tank [%s (role (turn (wash 0^80 a) crip))])
++ jode |=(a=time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1)))
:: ++ jase
:: |* a=,json
:: |= b=(set ,_+<.a) ^- json
:: ~! b
:: [%a (turn (~(tap in b)) a)]
::
++ jome :: stringify keys
|* [a=_cord b=_json]
|= c=(map ,_+<.a ,_+<.b)
(jobe (turn (~(tap by c)) (both a b)))
::
++ both :: cons two gates
|* [a=_,* b=_,*]
|=(c=_[+<.a +<.b] [(a -.c) (b +.c)])
::
::
++ grop (jome phon stas) :: (map ship status)
++ phon |=(a=ship (scot %p a))
++ stas |=(status (jobe presence/(joce p) human/(huma q) ~))
++ gram |=(telegram (jobe ship/(jope p) thought/(thot q) ~))
++ thot
|= thought
(jobe serial/(jape <p>) audience/(audi q) statement/(stam r) ~)
::
++ audi (jome stan joce)
++ stan
|= a=station ^- cord
%- crip
?~ -.a "{<p.p.a>}/{(trip q.p.a)}"
?- -.p.a
%twitter "{(trip -.p.a)}/{(trip p.p.a)}"
==
::
++ stam |=(statement (jobe time/(jode p) speech/(spec q) ~))
++ spec
|= a=speech
%+ joba -.a
?+ -.a !!
?(%own %say) [%s p.a]
%lin (jobe say/[%b p.a] txt/[%s q.a] ~)
%exp (jobe code/[%s p.a] done/?~(q.a ~ (joke u.q.a)) ~)
:: %inv (jobe ship/(jope p.a) party/[%s q.a] ~)
==
::
++ huma
|= human
%^ jobe
hand/?~(hand ~ [%s u.hand])
:- %true
?~ true ~
=+ u.true
(jobe first/[%s p] middle/?~(q ~ [%s u.q]) last/[%s r] ~)
~
::
++ conf
|= config
%- jobe :~
sources/[%a (turn (~(tap in sources)) |=(a=station [%s (stan a)]))]
=- cordon/(jobe white/[%b -.cordon] list/[%a -] ~)
(turn (~(tap in p.cordon)) jope) :: XX jase
==
--
-- --

70
main/sur/rodeo/core.hook Normal file
View File

@ -0,0 +1,70 @@
::
:::: /hook/core/rodeo/sur
::
|%
++ ache |*([a=$+(* *) b=$+(* *)] $%([| p=b] [& p=a])) :: PM 314
++ audience (map station delivery) :: destination/state
++ atlas (map ship status) :: presence map
++ command :: effect on party
$% [%design (pair span (unit config))] :: configure/destroy
[%publish (list thought)] :: originate
[%review (list thought)] :: deliver
[%ping (map station presence)] :: declare status
== ::
++ config :: party configuration
$: sources=(set station) :: pulls from
cordon=control :: & white, | black
== ::
++ cousin (pair ship span) :: domestic flow
++ control (ache (set ship) (set ship)) :: & white, | black
++ delivery :: delivery state
$? %pending :: undelivered
%received :: delivered
%rejected :: undeliverable
%released :: sent one-way
%accepted :: fully processed
== ::
++ human :: human identifier
$: true=(unit (trel ,@t (unit ,@t) ,@t)) :: true name
hand=(unit ,@t) :: handle
== ::
++ partner :: foreign flow
$% [%twitter p=@t] :: twitter
== ::
++ presence ?(%gone %hear %talk) :: status type
++ register (pair atlas (map station atlas)) :: ping me, ping srcs
++ report :: unified rush/rust
$% [%house (set span)] :: meta-changes
[%grams (pair ,@ud (list telegram))] :: beginning, thoughts
[%group register] :: presence
[%config config] :: reconfigure
== ::
++ speech :: narrative action
:: XX unify %own and %say to %lin
::
$% [%lan p=span q=@t] :: local announce
[%own p=@t] :: XX @ or /me
[%exp p=@t] :: hoon line
[%non ~] :: no content
[%ext p=@tas q=*] :: extended action
[%fat p=torso q=speech] :: attachment
:: [%inv p=station] :: invite to station
[%ire p=serial q=speech] :: in-reply-to
[%lin p=? q=@t] :: no=@, text line
[%mor p=(list speech)] :: XX deleteme
[%say p=@t] :: XX normal line
== ::
++ serial ,@uvH :: unique identity
++ station (each cousin partner) :: interlocutor
++ status (pair presence human) :: participant
++ statement (pair ,@da speech) :: when this
++ telegram (pair ship thought) :: who which whom what
++ thought (trel serial audience statement) :: which whom what
++ torso :: attachment
$% [%text (list ,@t)] :: text lines
[%tank (list tank)] :: tank list
== ::
:: markdown
:: image
:: mime object
--