From 9828c024739975da38bf8de7aeb20cfe4be79ed9 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Wed, 2 Jan 2019 11:09:25 -0800 Subject: [PATCH 1/7] Remove duplicated code between arvo and hoon Also removes some dead code from arvo which lets us clean up some ^ in dojo. --- app/dojo.hoon | 4 ++-- sys/arvo.hoon | 19 +-------------- sys/hoon.hoon | 64 --------------------------------------------------- 3 files changed, 3 insertions(+), 84 deletions(-) diff --git a/app/dojo.hoon b/app/dojo.hoon index ba950b2cc..655e1299d 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -1622,7 +1622,7 @@ (he-diff %tan u.p.cit) :: ++ he-lens - |= com/command:^^lens + |= com/command:lens ^+ +> =+ ^- source/dojo-source =| num/@ @@ -1812,7 +1812,7 @@ (wrap he-type):arm :: ++ poke-lens-command - |= com/command:^^lens ~| poke-lens+com %. com + |= com/command:lens ~| poke-lens+com %. com (wrap he-lens):arm :: ++ poke-json diff --git a/sys/arvo.hoon b/sys/arvo.hoon index 7bef73bce..742a1a72f 100644 --- a/sys/arvo.hoon +++ b/sys/arvo.hoon @@ -32,12 +32,9 @@ {$ud p/@ud} :: sequence == :: ++ desk @tas :: ship desk case spur +++ dock (pair @p term) :: message target ++ cage (cask vase) :: global metadata ++ cask |*(a/mold (pair mark a)) :: global data -++ cuff :: permissions - $: p/(unit (set monk)) :: can be read by - q/(set monk) :: caused or created by - == :: ++ curd {p/@tas q/*} :: typeless card ++ duct (list wire) :: causal history ++ hypo |*(a/mold (pair type a)) :: type associated @@ -46,20 +43,6 @@ == :: a :: == :: -++ kirk (unit (set monk)) :: audience -++ lens :: observation core - $_ ^? :: - |% ++ u *(unit (unit $~)) :: existence - ++ v *(unit (unit cage)) :: full history - ++ w *(unit (unit (unit cage))) :: latest diff - ++ x *(unit (unit cage)) :: data at path - ++ y *(unit (unit arch)) :: directory - ++ z *(unit (unit cage)) :: current subtree - -- :: -++ marc :: structured mark - $@ mark :: plain mark - $% {$tabl p/(list (pair marc marc))} :: map - == :: ++ mark @tas :: content type ++ mash |=(* (mass +<)) :: producing mass ++ mass $~ [%$ [%& ~]] :: memory usage diff --git a/sys/hoon.hoon b/sys/hoon.hoon index 0246e19c6..113a8168b 100644 --- a/sys/hoon.hoon +++ b/sys/hoon.hoon @@ -14078,84 +14078,20 @@ :: :::: 5f: molds and mold builders :: -++ arch {fil/(unit @uvI) dir/(map @ta ~)} :: fundamental node -++ arvo (wind {p/term q/mill} mill) :: arvo card -++ beak {p/ship q/desk r/case} :: path prefix -++ beam {{p/ship q/desk r/case} s/spur} :: global name -++ bone @ud :: opaque duct -++ case :: version - $% {$da p/@da} :: date - {$tas p/@tas} :: label - {$ud p/@ud} :: sequence - == :: -++ desk @tas :: ship desk case spur -++ cage (cask vase) :: global metadata -++ cask |*(a/mold (pair mark a)) :: global data -++ cuff :: permissions - $: p/(unit (set monk)) :: can be read by - q/(set monk) :: caused or created by - == :: -++ curd {p/@tas q/*} :: typeless card -++ dock (pair @p term) :: message target -++ duct (list wire) :: causal history -++ hypo |*(a/mold (pair type a)) :: type associated -++ hobo |* a/gate :: task wrapper - $? $% {$soft p/*} :: - == :: - a :: - == :: -++ kirk (unit (set monk)) :: audience -++ lens :: observation core - $_ ^? :: - |% ++ u *(unit (unit ~)) :: existence - ++ v *(unit (unit cage)) :: full history - ++ w *(unit (unit (unit cage))) :: latest diff - ++ x *(unit (unit cage)) :: data at path - ++ y *(unit (unit arch)) :: directory - ++ z *(unit (unit cage)) :: current subtree - -- :: ++ mane $@(@tas {@tas @tas}) :: XML name+space ++ manx $~([[%$ ~] ~] {g/marx c/marl}) :: dynamic XML node -++ marc :: structured mark - $@ mark :: plain mark - $% {$tabl p/(list (pair marc marc))} :: map - == :: -++ mark @tas :: content type ++ marl (list manx) :: XML node list ++ mars {t/{n/$$ a/{i/{n/$$ v/tape} t/~}} c/~} :: XML cdata ++ mart (list {n/mane v/tape}) :: XML attributes ++ marx $~([%$ ~] {n/mane a/mart}) :: dynamic XML tag -++ mash |=(* (mass +<)) :: producing mass -++ mass (pair cord (each noun (list mash))) :: memory usage -++ mill (each vase milt) :: vase+metavase -++ milt {p/* q/*} :: metavase ++ mite (list @ta) :: mime type ++ monk (each ship {p/@tas q/@ta}) :: general identity -++ muse {p/@tas q/duct r/arvo} :: sourced move -++ move {p/duct q/arvo} :: arvo move -++ ovum {p/wire q/curd} :: typeless ovum -++ pane (list {p/@tas q/vase}) :: kernel modules ++ pass @ :: public key -++ pone (list {p/@tas q/vise}) :: kernel modules old ++ ring @ :: private key ++ ship @p :: network identity ++ shop (each ship (list @ta)) :: urbit/dns identity -++ sink (trel bone ship path) :: subscription ++ spur path :: ship desk case spur ++ time @da :: galactic time -++ vile :: reflexive constants - $: typ/type :: -:!>(*type) - duc/type :: -:!>(*duct) - pah/type :: -:!>(*path) - mev/type :: -:!>([%meta *vase]) - == :: -++ wind :: new kernel action - |* {a/gate b/gate} :: forward+reverse - $% {$pass p/path q/a} :: advance - {$slip p/a} :: lateral - {$give p/b} :: retreat - == :: -++ wire path :: event pretext :: :::: 5g: profiling support (XX move) :: From 4d09526390bfdf81f40a43668e875197950ef914 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Wed, 2 Jan 2019 11:24:28 -0800 Subject: [PATCH 2/7] Fix mar/lens/command.hoon --- mar/lens/command.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mar/lens/command.hoon b/mar/lens/command.hoon index a3ec71576..d84021df6 100644 --- a/mar/lens/command.hoon +++ b/mar/lens/command.hoon @@ -16,7 +16,7 @@ =, dejs-soft:format |% ++ source - ^- $-(^^json (unit source:^^lens)) + ^- $-(^^json (unit source:lens)) |= jon/^^json =+ tuple=%.(jon (ar source)) ?^ tuple @@ -40,7 +40,7 @@ == ++ none |=(^^json (some ~)) ++ sink - ^- $-(^^json (unit sink:^^lens)) + ^- $-(^^json (unit sink:lens)) %- of :~ stdout+none output-file+so From b9b0ea40877bd1925ecdf3e67bc056607636aa2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Wed, 2 Jan 2019 18:27:07 -0800 Subject: [PATCH 3/7] Remove a bunch of dependencies --- .travis.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c4849514..8eb605757 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,12 +46,7 @@ addons: - openssl - libssl-dev - libncurses5-dev - - automake - - autoconf - - make - - libtool - - g++ - - re2c + - gcc - libcurl4-gnutls-dev - unzip - gdb From c943b85b9668b7bcd2262609b2539f931b423372 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Thu, 3 Jan 2019 11:42:26 -0800 Subject: [PATCH 4/7] Handle the move which makes the ova first --- sys/vane/behn.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/vane/behn.hoon b/sys/vane/behn.hoon index ecae96b50..b6ac33f7e 100644 --- a/sys/vane/behn.hoon +++ b/sys/vane/behn.hoon @@ -86,9 +86,9 @@ :~ timers+[%& timers] == == - :: reverse moves, since they were constructed backward, and return + :: when we send moves, the unix even from set-wake must be first :: - [(flop moves) ..^^$] + [moves ..^^$] :: +set-timer: set a timer, maintaining the sort order of the :timers list :: ++ set-timer From b8c67e513092c0ca494ad20d7cf5899bc0e81a1b Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Mon, 7 Jan 2019 13:44:04 -0800 Subject: [PATCH 5/7] Move flop to +notify-clients and document +set-wake --- sys/vane/behn.hoon | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/vane/behn.hoon b/sys/vane/behn.hoon index b6ac33f7e..8f8637c57 100644 --- a/sys/vane/behn.hoon +++ b/sys/vane/behn.hoon @@ -86,7 +86,6 @@ :~ timers+[%& timers] == == - :: when we send moves, the unix even from set-wake must be first :: [moves ..^^$] :: +set-timer: set a timer, maintaining the sort order of the :timers list @@ -118,15 +117,18 @@ [i.timers $(timers t.timers)] :: +notify-clients: wake up vanes whose timers have expired :: + :: When we return the list moves to clients, we flop them so they're in + :: the same order as they were in :timers. + :: ++ notify-clients =| moves=(list move) |- ^+ [moves timers] :: ?~ timers - [moves timers] + [(flop moves) timers] :: ?: (gth date.i.timers now) - [moves timers] + [(flop moves) timers] :: %_ $ timers t.timers @@ -134,6 +136,14 @@ == :: +set-wake: set or unset a unix timer to wake us when next timer expires :: + :: We prepend the unix %doze event so that it is handled first. We must + :: handle this first because the moves we emit will get handled in + :: depth-first order. If we're handling a %wake which causes a move to a + :: different vane and another %doze event to send to unix, we need to + :: process the %doze first because the move to the other vane may call + :: back into %behn and emit a second %doze, which means the second %doze + :: which be handled by unix first. + :: ++ set-wake |= moves=(list move) ^+ [moves state] From ca95e56f09ce3ff03b051c6b7da09a86fa11398c Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Mon, 7 Jan 2019 13:47:23 -0800 Subject: [PATCH 6/7] Wording --- sys/vane/behn.hoon | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/vane/behn.hoon b/sys/vane/behn.hoon index 8f8637c57..a5ee628c5 100644 --- a/sys/vane/behn.hoon +++ b/sys/vane/behn.hoon @@ -136,13 +136,13 @@ == :: +set-wake: set or unset a unix timer to wake us when next timer expires :: - :: We prepend the unix %doze event so that it is handled first. We must - :: handle this first because the moves we emit will get handled in + :: We prepend the unix %doze event so that it is handled first. Arvo must + :: handle this first because the moves %behn emits will get handled in :: depth-first order. If we're handling a %wake which causes a move to a - :: different vane and another %doze event to send to unix, we need to - :: process the %doze first because the move to the other vane may call - :: back into %behn and emit a second %doze, which means the second %doze - :: which be handled by unix first. + :: different vane and a %doze event to send to unix, Arvo needs to process + :: the %doze first because the move to the other vane may call back into + :: %behn and emit a second %doze, which means the second %doze would be + :: handled by unix first. :: ++ set-wake |= moves=(list move) From 8d2bdb83c3d38ba09c8d987256fb9e5d22aa80eb Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Mon, 7 Jan 2019 13:58:08 -0800 Subject: [PATCH 7/7] More wording --- sys/vane/behn.hoon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/vane/behn.hoon b/sys/vane/behn.hoon index a5ee628c5..50a1b60d5 100644 --- a/sys/vane/behn.hoon +++ b/sys/vane/behn.hoon @@ -140,9 +140,9 @@ :: handle this first because the moves %behn emits will get handled in :: depth-first order. If we're handling a %wake which causes a move to a :: different vane and a %doze event to send to unix, Arvo needs to process - :: the %doze first because the move to the other vane may call back into - :: %behn and emit a second %doze, which means the second %doze would be - :: handled by unix first. + :: the %doze first because otherwise if the move to the other vane calls + :: back into %behn and emits a second %doze, the second %doze would be + :: handled by unix first which is incorrect. :: ++ set-wake |= moves=(list move)