Merge remote-tracking branches 'philipcmonk/init-reset', 'ohaitch/tree-perf' and 'galenwp/tree-fixes'

Recompile the kernel on initial merge
Profiling-guided performance fixes
Frontend bugfixes
This commit is contained in:
Raymond Pasco 2016-02-25 23:47:37 -05:00
commit 9a0167c99c
13 changed files with 694 additions and 345 deletions

View File

@ -114,6 +114,7 @@
++ poke-helm-verb (wrap poke-verb):from-helm
++ poke-helm-begin (wrap poke-begin):from-helm
++ poke-hood-sync (wrap poke-sync):from-kiln
++ poke-hood-init-sync (wrap poke-init-sync):from-kiln
++ poke-kiln-cp (wrap poke-cp):from-kiln
++ poke-kiln-label (wrap poke-label):from-kiln
++ poke-kiln-merge (wrap poke-merge):from-kiln

View File

@ -213,7 +213,9 @@
=. moz :_(moz [hen %pass ~ %g %conf [[our ram] %load our %home]])
=. +> ?: ?=(?($czar $pawn) can) +>
(sync %base (sein our) %kids)
=. +> (sync %home our %base)
=. +> ?: ?=(?($czar $pawn) can)
(sync %home our %base)
(init-sync %home our %base)
=. +> ?. ?=(?($duke $king $czar) can) +>
(sync %kids our %base)
=. +> autoload
@ -261,6 +263,16 @@
==
==
::
++ init-sync
|= syn/{desk ship desk}
%_ +>.$
moz
:_ moz
:* hen %pass /init-sync %g %deal [our our]
ram %poke %hood-init-sync -:!>(syn) syn
==
==
::
++ autoload
%_ .
moz

View File

@ -56,7 +56,8 @@
== ::
++ calx :: concrete cache line
$% {$hood p/calm q/(pair beam cage) r/hood} :: compile
{$bake p/calm q/(trel mark coin beam) r/(unit vase)} :: load
{$bake p/calm q/(pair mark beam) r/(unit vase)} :: load
{$boil p/calm q/(trel coin beam beam) r/vase} :: execute
{$slit p/calm q/{p/span q/span} r/span} :: slam type
{$slim p/calm q/{p/span q/twig} r/(pair span nock)}:: mint
{$slap p/calm q/{p/vase q/twig} r/vase} :: compute
@ -82,6 +83,7 @@
?+ sem !!
$hood ?>(?=($hood -.cax) r.cax)
$bake ?>(?=($bake -.cax) r.cax)
$boil ?>(?=($boil -.cax) r.cax)
$slap ?>(?=($slap -.cax) r.cax)
$slam ?>(?=($slam -.cax) r.cax)
$slim ?>(?=($slim -.cax) r.cax)
@ -262,6 +264,7 @@
::
++ zo
~% %ford-z ..is ~
=| dyv/@
|_ {num/@ud task}
++ abet %_(..zo q.tad.bay (~(put by q.tad.bay) num +<+))
++ amok
@ -558,29 +561,26 @@
%_(+> mow :_(mow [hen %give gef]))
::
++ fade :: compile to hood
~/ %fade
|= {cof/cafe for/mark bem/beam}
^- (bolt hood)
(fape cof for bem bem)
::
++ fape :: XX compile at path
|= {cof/cafe for/mark bem/beam bim/beam}
:: ~& fade+(tope bem)
^- (bolt hood)
%+ cool |.(leaf+"ford: fade {<[(tope bem)]>}")
%+ cope (liar cof %*(. bem s [for s.bem]))
|= {cof/cafe cay/cage}
%+ (clef %hood) (fine cof bim(r [%ud 0]) cay)
%+ (clef %hood) (fine cof bem(r [%ud 0]) cay)
^- (burg (pair beam cage) hood)
|= {cof/cafe bum/beam cay/cage}
~| fade+(tope bum)
=+ rul=(fair bum)
~% %hood-miss ..abet ~
|= {cof/cafe bem/beam cay/cage}
?. ?=(@ q.q.cay)
(flaw cof ~)
=+ vex=((full rul) [[1 1] (trip q.q.cay)])
=+ vex=((full (fair bem)) [[1 1] (trip q.q.cay)])
?~ q.vex
(flaw cof [%leaf "syntax error: {<p.p.vex>} {<q.p.vex>}"] ~)
(fine cof p.u.q.vex)
::
++ fame :: beam with - as /
~/ %fame
|= {cof/cafe bem/beam}
^- (bolt beam)
%+ cope
@ -589,7 +589,7 @@
?~ opt (flue cof)
|- ^- (bolt (unit beam))
=. i.s.bem (tack opt)
%+ cope (lima cof %hoon many+~ bem)
%+ cope (lima cof %hoon bem)
|= {cof/cafe vax/(unit vase)} ^- (bolt (unit beam))
?^ vax (fine cof `bem)
?~ t.opt (flue cof)
@ -601,11 +601,12 @@
::
++ fang :: protocol door
|= {cof/cafe for/mark} ^- (bolt vase)
:: ~& fang+for
(lear cof bek /[for]/mar)
::
++ fair :: hood parsing rule
|= bem/beam
?> ?=({$ud $0} r.bem) :: XX sentinel
?> ?=({$ud $0} r.bem) :: XX sentinel
=+ vez=(vang & (tope bem))
=< hood
|%
@ -616,8 +617,22 @@
[~ u=(^case a)]
nuck:so
::
++ hath (sear plex:vez (stag %conl poor:vez)) :: hood path
++ hath (sear plex (stag %conl poor)):vez :: hood path
++ have (sear tome ;~(pfix fas hath)) :: hood beam
++ hith :: static path
=> vez
(sear plex (stag %conl (more fas hasp)))
::
++ hive :: late-bound path
;~ pfix fas
%+ cook |=(a/hops a)
=> vez
;~ plug
(stag ~ gash)
;~(pose (stag ~ ;~(pfix cen porc)) (easy ~))
==
==
::
++ hood
%+ ifix [gay gay]
;~ plug
@ -678,7 +693,7 @@
(stag %nap ;~(pfix cab day:read))
(stag %now ;~(pfix pat day:read))
(stag %saw ;~(pfix sem saw:read))
(stag %see ;~(pfix col see:read))
(stag %sei ;~(pfix col sei:read))
(stag %sic ;~(pfix ket sic:read))
(stag %toy ;~(sfix toy:read fas))
==
@ -716,7 +731,7 @@
++ for
%+ rail fail
=- ;~(sfix (star -) gap duz)
;~(pfix gap fas ;~(plug hath day))
;~(pfix gap fas ;~(plug hith day))
::
++ lin
%+ rail
@ -736,10 +751,10 @@
;~(plug ;~(sfix wide:vez sem) day)
;~(pfix gap ;~(plug tall:vez day))
::
++ see
++ sei :: XX see
%+ rail
;~(plug ;~(sfix have col) day)
;~(pfix gap ;~(plug have day))
;~(plug ;~(sfix hive col) day)
;~(pfix gap ;~(plug hive day))
::
++ sic
%+ rail
@ -895,8 +910,8 @@
|= {cof/cafe arc/arch}
(fine cof (bind fil.arc $~))
::
++ lace :: load real or virtual
|= {cof/cafe for/mark arg/coin bem/beam}
++ lace :: load file
|= {cof/cafe for/mark bem/beam}
^- (bolt vase)
%+ cool |.(leaf+"ford: load {<for>} {<(tope bem)>}")
=. s.bem [for s.bem]
@ -959,15 +974,18 @@
::
++ lear :: load core
|= {cof/cafe bem/beam} ^- (bolt vase)
(leap cof bem bem many+~)
(leap cof many+~ bem bem)
::
++ leap :: XX load with path
|= {cof/cafe bem/beam bom/beam arg/coin}
~/ %leap
|= {cof/cafe arg/coin bem/beam bom/beam}
%+ (clef %boil) (fine cof arg bem bom)
|= {cof/cafe arg/coin bem/beam bom/beam}
%+ cope (lamp cof bem)
|= {cof/cafe bem/beam}
%+ cope (fame cof bem)
|= {cof/cafe bem/beam}
(cope (fape cof %hoon bem bom) abut:(meow bom arg))
(cope (fade cof %hoon bem) abut:(meow bom arg))
::
++ lend :: load arch
|= {cof/cafe bem/beam}
@ -981,6 +999,7 @@
(flag bem (fine cof arc))
::
++ liar :: load cage
~/ %liar
|= {cof/cafe bem/beam}
^- (bolt cage)
?: =([%ud 0] r.bem)
@ -993,6 +1012,7 @@
(fine cof u.u.von)
::
++ lily
~/ %lily
|= {cof/cafe for/mark} ^- (bolt (set @tas))
%+ cope (coop (fang cof for) |=(cof/cafe (fine cof %void ~)))
%- flux
@ -1005,33 +1025,37 @@
(fall ((soft (list mark)) q) ~)
::
++ lima :: load at depth
|= {cof/cafe for/mark arg/coin bem/beam}
%+ (clef %bake) [p=cof q=[%0 p=[bem `~] q=[for arg bem]]]
|= {cof/cafe for/mark arg/coin bem/beam}
~/ %lima
|= {cof/cafe for/mark bem/beam}
%+ (clef %bake) (flag bem (fine cof for bem))
|= {cof/cafe for/mark bem/beam}
^- (bolt (unit vase))
%+ cope (laze cof bem)
|= {cof/cafe mal/(map mark $~)}
?: (~(has by mal) for)
(cope (lace cof for arg bem) (flux some))
(cope (lace cof for bem) (flux some))
=+ opt=(silt (turn (~(tap by mal)) head)) :: XX asymptotics
%+ cope (lion cof for opt)
|= {cof/cafe wuy/(list @tas)}
?~ wuy (flue cof)
%+ cope
(lace cof i.wuy arg bem)
(lace cof i.wuy bem)
|= {cof/cafe hoc/vase}
(cope (lope cof i.wuy t.wuy hoc) (flux some))
::
++ lime :: load beam
|= {cof/cafe for/mark arg/coin bem/beam}
^- (bolt vase)
%+ cope (lima cof for arg bem)
%+ cope (lima cof for bem)
|= {cof/cafe vux/(unit vase)}
?^ vux (fine cof u.vux)
(leap cof [-.bem /[for]/ren] bem arg)
(leap cof arg [-.bem /[for]/ren] bem)
::
++ link :: translate
~/ %link
|= {cof/cafe too/mark for/mark vax/vase}
=* link-jet .
:: ~$ link
^- (bolt vase)
:: %+ cool |.(leaf+"ford: link {<too>} {<for>} {<p.vax>}")
?: =(too for) (fine cof vax)
@ -1039,27 +1063,39 @@
((lake too) cof vax)
%+ cope (fang cof for)
|= {cof/cafe pro/vase} ^- (bolt vase)
?: &((slob %grow p.pro) (slob too p:(slap pro [%limb %grow])))
?: :: =< $ ~% %limb-grow link-jet ~ |.
&((slob %grow p.pro) (slob too p:(slap pro [%limb %grow])))
:: ~$ link-grow
:: =< $ ~% %grow link-jet ~ |.
%+ cope (keel cof pro [[%& 6]~ vax]~)
|= {cof/cafe pox/vase}
(maim cof pox [%per [%limb %grow] [%limb too]])
%+ cope (fang cof too)
~% %grab link-jet ~
|= {cof/cafe pro/vase}
=+ ^= zat ^- (unit vase)
=+ :: =< $ ~% %limb-grab + ~ |.
^= zat ^- (unit vase)
?. (slob %grab p.pro) ~
=+ gab=(slap pro [%limb %grab])
?. (slob for p.gab) ~
`(slap gab [%limb for])
?~ zat
:: ~$ link-miss
(flaw cof [%leaf "ford: no link: {<[for too]>}"]~)
:: ~$ link-grab
~| [%link-maul for too]
(maul cof u.zat vax)
::
++ lion :: translation search
~/ %lion
|= {cof/cafe too/mark fro/(set mark)}
:: ~& lion+[too=too fro=(silt fro)]
=* lion-jet .
:: ~& lion+[too=too fro=fro]
:: =- =+ (cope - (flux |=(a/(list mark) ~&(lioned+a ~))))
:: +<
^- (bolt (list mark))
=- %+ coop (gro cof too ~ ~) :: XX better grab layer
~% %grab lion-jet ~
|= cof/cafe
%+ cope (fang cof too)
|= {cof/cafe vax/vase} ^- (bolt (list mark))
@ -1097,6 +1133,7 @@
^$(cof cof, for i.yaw, yaw t.yaw, vax yed)
::
++ mail :: cached mint
~/ %mail
|= {cof/cafe sut/span gen/twig}
^- (bolt (pair span nock))
%+ (clef %slim) (fine cof sut gen)
@ -1108,6 +1145,7 @@
==
::
++ maim :: slap
~/ %maim
|= {cof/cafe vax/vase gen/twig}
^- (bolt vase)
%+ cope (mail cof p.vax gen)
@ -1120,18 +1158,20 @@
%+ cope (lamp cof bek ~)
|=({cof/cafe byk/beak *} (make(bek byk) cof kas))
::
++ abbrev :: shorten coin
|=(a/coin ?-(-.a $$ a, $blob a(p (mug p.a)), $many a(p (turn p.a ..$))))
::
++ make :: reduce silk
|= {cof/cafe kas/silk}
:: =+ ^= pre
:: ?+ -.kas -.kas
:: ?+ -.kas `term`-.kas
:: ^ %cell
:: :: %boil [-.kas p.kas (tope q.kas)]
:: %bake [-.kas p.kas (tope q.kas)]
:: %core [-.kas (tope p.kas)]
:: $bake [-.kas p.kas (tope r.kas) ~(rent co (abbrev q.kas))]
:: $core [-.kas (tope p.kas)]
:: ==
:: ~& [dyv `term`(cat 3 %make (fil 3 dyv ' ')) pre]
:: =- ~& [dyv `term`(cat 3 %made (fil 3 dyv ' ')) pre] -
:: =. dyv +(dyv)
:: ~? !=(%$ pre) [dyv `term`(cat 3 %make (fil 3 dyv ' ')) pre]
:: =- ~? !=(%$ pre) [dyv `term`(cat 3 %made (fil 3 dyv ' ')) pre] -
=. dyv +(dyv)
^- (bolt gage)
?- -.kas
^
@ -1194,6 +1234,9 @@
%+ cope $(kas q.kas)
%- tabl-run
|= {cof/cafe cay/cage}
:: ~$ make-cast
:: ~> %live. :: ~$(make-cast-{to}--{from} ~)
:: (rap 3 %make-cast- p.kas '--' p.cay ~)
^- (bolt gage)
%+ cool |.(leaf+"ford: casting {<p.cay>} to {<p.kas>}")
%+ cope (lion cof p.kas p.cay `~)
@ -1291,6 +1334,7 @@
==
::
++ malt :: cached slit
~/ %slit
|= {cof/cafe gat/span sam/span}
^- (bolt span)
%+ (clef %slit) (fine cof gat sam)
@ -1304,6 +1348,7 @@
==
::
++ maul :: slam
~/ %maul
|= {cof/cafe gat/vase sam/vase}
^- (bolt vase)
%+ cope (malt cof p.gat p.sam)
@ -1497,9 +1542,19 @@
%+ cope (maul cof gat sam)
(flux |=(a/vase noun+a))
::
$see
$see :: XX remove on breach
=. r.p.hon ?:(?=({$ud $0} r.p.hon) r.how r.p.hon)
$(hon q.hon, how p.hon)
::
$sei :: XX see
=+ vez=(vang & (tope how))
=+ tuz=(posh:vez p.hon)
?~ tuz (flaw cof leaf+"bad tusk: {<p.hon>}" ~)
=+ pax=(plex:vez %conl u.tuz)
?~ pax (flaw cof leaf+"bad path: {<u.tuz>}" ~)
=+ bem=(tome u.pax)
?~ bem (flaw cof leaf+"bad beam: {<u.pax>}" ~)
$(hon q.hon, how u.bem)
::
$sic
%+ cope $(hon q.hon)
@ -1759,7 +1814,7 @@
~
::
++ load :: highly forgiving
|=(old/axle ..^$(+>- old))
:: |=(old/axle ..^$(+>- old))
::=. old
:: ?. ?=([%0 *] old) old :: remove at 1
:: :- %1
@ -1768,13 +1823,13 @@
:: ?> ?=([n=[p=* q=[tad=* dym=* deh=* jav=*]] l=* r=*] +.old)
:: :- [p.n.+.old [tad.q.n.+.old dym.q.n.+.old deh.q.n.+.old ~]]
:: [$(+.old l.+.old) $(+.old r.+.old)]
::|= old=*
::=+ lox=((soft axle) old)
::^+ ..^$
::?~ lox
:: ~& %ford-reset
:: ..^$
::..^$(+>- u.lox)
|= old/*
=+ lox=((soft axle) old)
^+ ..^$
?~ lox
~& %ford-reset
..^$
..^$(+>- u.lox)
::
++ scry
|= {fur/(unit (set monk)) ren/@tas who/ship syd/desk lot/coin tyl/path}

View File

@ -10371,54 +10371,65 @@
(welp (scow %ud (div (mul 100 euq.mon) tot)) "e ")
==
::
++ pi-tell :: produce dump
++ pi-tell :: produce dump
|= day/doss
^- (list tape)
?: =(day *doss) ~
=+ tot=(pi-moth mon.day)
;: welp
[(welp "events: " (pi-mumm mon.day)) ~]
::
%+ turn
(~(tap by hit.day) ~)
|= {nam/term num/@ud}
:(welp (trip nam) ": " (scow %ud num))
["" ~]
::
^- wall
%- zing
^- (list (list tape))
%+ turn
%+ sort (~(tap by cut.day))
|= {one/(pair path hump) two/(pair path hump)}
(gth (pi-moth mon.q.one) (pi-moth mon.q.two))
|= {pax/path hup/hump}
=+ ott=(pi-moth mon.hup)
=- (sort - lor)
%+ turn (~(tap by cut.day))
|=({p/path q/hump} [(pi-moth mon.q) p q])
|= {ott/@u pax/path hup/hump}
?: (lth (mul 15 ott) tot) ~ :: omit misc
;: welp
[(welp "label: " (spud pax)) ~]
[(welp "price: " (scow %ud (div (mul 100 ott) tot))) ~]
[(welp "shape: " (pi-mumm mon.hup)) ~]
::
?: =(~ out.hup) ~
:- "into:"
%+ turn
%+ sort (~(tap by out.hup) ~)
|=({{* a/@ud} {* b/@ud}} (gth a b))
|= {pax/path num/@ud}
^- tape
:(welp " " (spud pax) ": " (scow %ud num))
::
?: =(~ inn.hup) ~
?: &(?=([^ ~ ~] inn.hup) =(ott q.n.inn.hup))
["from: {(spud p.n.inn.hup)}" ~]
:- "from:"
%+ turn
^- wall
%+ murn
%+ sort (~(tap by inn.hup) ~)
|=({{* a/@ud} {* b/@ud}} (gth a b))
|=({{* a/@ud} {* b/@ud}} (lth a b))
|= {pax/path num/@ud}
^- tape
:(welp " " (spud pax) ": " (scow %ud num))
^- (unit tape)
?: (lth (mul 20 num) ott) ~
=. num (div (mul 100 num) ott)
(some :(welp " " (spud pax) ": " (scow %ud num)))
::
?: =(~ out.hup) ~
:: ?: &(?=([^ ~ ~] out.hup) =(ott q.n.out.hup))
:: ["into: {(spud p.n.out.hup)}" ~]
:- "into:"
^- wall
%+ murn
%+ sort (~(tap by out.hup) ~)
|=({{* a/@ud} {* b/@ud}} (lth a b))
|= {pax/path num/@ud}
^- (unit tape)
?: (lth (mul 20 num) ott) ~
=. num (div (mul 100 num) ott)
(some :(welp " " (spud pax) ": " (scow %ud num)))
::
["" ~]
~
==
::
[(welp "events: " (pi-mumm mon.day)) "" ~]
::
%+ turn
(~(tap by hit.day) ~)
|= {nam/term num/@ud}
:(welp (trip nam) ": " (scow %ud num))
==
--
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::

View File

@ -2197,6 +2197,7 @@
$% {$& p/twig} :: direct twig
{$| p/beam} :: resource location
== ::
++ hops {pre/(unit tyke) pof/(unit {p/@ud q/tyke})} :: XX late-bound path
++ horn :: resource tree
$% {$ape p/twig} :: /~ twig by hand
{$arg p/twig} :: /$ argument
@ -2211,7 +2212,8 @@
{$nap p/horn} :: /_ homo map
{$now p/horn} :: /@ list by @da
{$saw p/twig q/horn} :: /; operate on
{$see p/beam q/horn} :: /: relative to
{$see p/beam q/horn} :: XX remove on breach
{$sei p/hops q/horn} :: /: relative to XX see
{$sic p/twig q/horn} :: /^ cast
{$toy p/? q/mark} :: /mark/ static/hook
== ::

View File

@ -119,7 +119,13 @@
|= hos/kiln-sync
?: (~(has by syn) hos)
abet:(spam (render "already syncing" [sud her syd]:hos) ~)
abet:abet:start-sync:(auto hos)
abet:abet:(start-sync:(auto hos) |)
::
++ poke-init-sync
|= hos/kiln-sync
?: (~(has by syn) hos)
abet:(spam (render "already syncing" [sud her syd]:hos) ~)
abet:abet:(start-sync:(auto hos) &)
::
++ poke-unsync ::
|= hus/kiln-unsync
@ -210,23 +216,23 @@
::
++ take-mere-sync ::
|= {way/wire mes/(each (set path) (pair term tang))}
?> ?=({@ @ @ $~} way)
?> ?=({@ @ @ *} way)
=+ ^- hos/kiln-sync
:* syd=(slav %tas i.way)
her=(slav %p i.t.way)
sud=(slav %tas i.t.t.way)
==
abet:abet:(mere:(auto hos) mes)
abet:abet:(mere:(auto hos) .?(t.t.t.way) mes)
::
++ take-writ-sync ::
|= {way/wire rot/riot}
?> ?=({@ @ @ $~} way)
?> ?=({@ @ @ *} way)
=+ ^- hos/kiln-sync
:* syd=(slav %tas i.way)
her=(slav %p i.t.way)
sud=(slav %tas i.t.t.way)
==
abet:abet:(writ:(auto hos) rot)
abet:abet:(writ:(auto hos) .?(t.t.t.way) rot)
::
++ take-writ-autoload
|= {way/wire rot/riot}
@ -326,15 +332,16 @@
== ==
::
++ start-sync
=> (spam (render "activated sync" sud her syd) ~)
|= reset/?
=. +>.$ (spam (render "activated sync" sud her syd) ~)
%- blab
:~ :* ost %warp
/kiln/sync/[syd]/(scot %p her)/[sud]
[%kiln %sync syd (scot %p her) sud ?:(reset /reset /)]
[our her] sud ~ %sing %w [%da now] /
== ==
::
++ writ
|= rot/riot
|= {reset/? rot/riot}
?~ rot
%^ spam
leaf+"bad %writ response"
@ -343,7 +350,7 @@
=. let ?. ?=($w p.p.u.rot) let ((hard @ud) q.q.r.u.rot)
%- blab ^- (list move) :_ ~
:* ost %merg
/kiln/sync/[syd]/(scot %p her)/[sud]
[%kiln %sync syd (scot %p her) sud ?:(reset /reset /)]
our syd her sud ud+let
?: =(0 .^(* %cw /(scot %p our)/[syd]/(scot %da now)))
%init
@ -351,7 +358,7 @@
==
::
++ mere
|= mes/(each (set path) (pair term tang))
|= {reset/? mes/(each (set path) (pair term tang))}
=. let +(let)
=. +>.$
%- spam
@ -371,6 +378,9 @@
leaf+"note: blank desk {<sud>} on {<her>}"
==
==
=. +>.$
?. reset +>.$
(blab [ost %poke /init-reset [our %hood] %helm-reset ~]~)
%- blab :_ ~
:* ost %warp
/kiln/sync/[syd]/(scot %p her)/[sud]

23
mar/tree/comments.hoon Normal file
View File

@ -0,0 +1,23 @@
::
:::: /hoon/comments/tree/mar
::
/? 310
/+ react
!:
::::
::
|_ all/(list (pair time manx))
::
++ grow :: convert to
|%
++ json
:- %a
%+ turn
(sort all |=({a/* b/*} (lor b a)))
|= {a/time b/manx} ^- ^json
(jobe time+(jode a) body+(react-to-json:react b) ~)
--
++ grab |% :: convert from
++ noun (list {time manx}) :: clam from %noun
::++ elem |=(a=manx `_all`[[/ ((getall %h1) a)] ~ ~])
-- --

View File

@ -9,17 +9,15 @@
/= sect /&json&/tree-index/
/= snip /&snip&elem&/tree-elem/
/= meta /&json&front&/|(/front/ /~[~])
/= comt /^ (list (pair time manx))
/: /%/comments /@ /&elem&/md/
/= comt /&json&/tree-comments/
!:
^- tree-include
=+ rj=react-to-json:react
=+ cj=|=({a/time b/manx} (jobe time+(jode a) body+(rj b) ~))
:* mime
(rj body)
(rj /h1 hed.snip) :: head
(rj /div tal.snip) :: snip
meta
sect
[%a (turn (sort comt |=({a/* b/*} (lor b a))) cj)]
comt
==

9
ren/tree/comments.hoon Normal file
View File

@ -0,0 +1,9 @@
::
:::: /hoon/comments/tree/ren
::
/? 310
/: /%/comments /@ /&elem&/md/ :: XX descend horn
::
::::
::
`(list (pair time manx))`-.-

4
web.md
View File

@ -4,8 +4,6 @@ anchor: none
# Hello.
<hr></hr>
<h2 class="even">
<a class="blue inverse block" href="/~~/talk">Talk</a>
</h2>
@ -13,8 +11,6 @@ anchor: none
<a class="blue inverse block" href="/~~/dojo">Dojo</a>
</h2>
<hr></hr>
<h2 class="even">
<a class="blue inverse block" href="/static">Static files</a>
</h2>

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
@charset "UTF-8";
.col-md-10.body {
padding-left: 2.8125rem; }
padding-left: 0; }
@media (max-width: 767px) {
.col-md-10.body {
@ -83,7 +84,6 @@ img.logo.first {
padding-left: 0;
padding-right: 0;
background-color: #fff;
max-width: 16.66667%;
transition: max-width .2s ease-in-out;
position: fixed;
z-index: 100; }
@ -101,8 +101,7 @@ img.logo.first {
.ctrl a.nav-link {
letter-spacing: 1px; }
.ctrl .selected a.nav-link {
font-weight: 500;
letter-spacing: 0; }
font-weight: 500; }
.ctrl.open,
.ctrl:hover {
@ -253,6 +252,9 @@ img.logo.first {
[data-path^='/docs'] .selected .nav-link {
color: #02D124; }
[data-path^='/docs'] .nav-link {
font-weight: 500; }
[data-path^='/docs'] .home {
background-color: #0500F0;
border-color: #0500F0; }
@ -280,6 +282,13 @@ img.logo.first {
margin-left: .05rem;
font-size: 1rem; } }
[data-path^='/docs/system/hoon/runes'] .nav-link {
font-family: 'scp'; }
[data-path^='/docs/system/hoon/runes'] .nav-link,
[data-path^='/docs/system/hoon/runes'] .ctrl .selected a.nav-link {
font-weight: 600; }
.app {
vertical-align: top;
font-size: 1.6rem;
@ -313,9 +322,46 @@ img.logo.first {
line-height: 1rem;
margin-bottom: 1rem; } }
.lead h1:first-of-type {
padding-bottom: 0; }
.body[data-path^='/docs'] h1 {
color: #0500F0; }
.body[data-path^='/docs'] h1 code {
background-color: transparent;
color: #0500F0;
padding: 0; }
.body[data-path^='/docs'] .book h2 {
color: #B1B7BD; }
.body[data-path^='/docs'] .book h2 code {
color: #0500F0;
background-color: transparent; }
.body[data-path^='/docs'] .book h2 a {
color: #0500F0; }
.body[data-path^='/docs'] .book hr {
margin-bottom: 3rem; }
.body[data-path^='/docs/system/hoon/runes/'] h1 {
color: #B1B7BD; }
.body[data-path^='/docs/system/hoon/runes/basic'] h1 {
color: #0500F0; }
.body[data-path^='/docs/system/hoon/library/'] h3 {
font-size: 1.5rem; }
.body[data-path^='/docs/system/hoon/library/'] h2 {
font-size: 1rem; }
.body[data-path^='/docs/system/hoon/library/'] .toc h3 {
padding-top: 0;
margin-bottom: 0; }
@keyframes menu-open {
0% {
visibility: hidden; }
@ -406,9 +452,13 @@ img.logo.first {
.menu.open .contents {
top: 3rem; } }
.list h1 {
.list h1,
.list h1:first-of-type {
font-size: inherit;
font-weight: inherit; }
font-weight: inherit;
padding-bottom: 0;
margin-bottom: 0;
line-height: 2rem; }
.list h1.error {
font-size: 1.6rem;
@ -427,10 +477,64 @@ img.logo.first {
font-weight: 500;
height: 2rem; }
.body[data-path^='/docs'] .list.runes {
margin-top: 3rem; }
.body[data-path^='/docs'] .list.runes li {
height: 3rem; }
.body[data-path^='/docs'] .list.runes a h1,
.body[data-path^='/docs'] .list.runes a div,
.body[data-path^='/docs'] .list.runes a p {
display: inline; }
.body[data-path^='/docs'] .list.runes a {
text-decoration: none; }
.body[data-path^='/docs'] .list.runes a,
.body[data-path^='/docs'] .list.runes a h1 code {
color: #000; }
.body[data-path^='/docs'] .list.runes a h1 code {
margin-right: 1rem;
background-color: transparent;
color: #0500F0; }
.body[data-path^='/docs'] .list.runes a code {
background-color: #eceeef; }
.body[data-path^='/docs'] .list.runes a code {
padding: .3rem; }
.body[data-path^='/docs'] .list.runes a:after {
content: "▶";
width: 1rem;
font-size: .6rem;
vertical-align: middle;
padding: .3rem;
padding-top: .4rem;
line-height: 1rem;
margin-left: 1rem;
background-color: #B1B7BD;
color: #fff; }
.body[data-path^='/docs'] .list.runes a:hover:after {
background-color: #0500F0; }
.kids.runes h1 {
padding-top: 3rem; }
.kids.runes h2 {
font-size: 1.5rem;
margin-bottom: 1rem; }
.kids.runes > div {
margin-top: 6rem; }
.kids.runes > hr {
display: none; }
.kids.runes > div p:first-of-type {
font-weight: 500; }
.sections h1 {
font-size: 2rem;
color: #0500F0; }
.sections h1:first-of-type {
padding-bottom: 0; }
.sections li h1 {
font-size: 1.2rem; }
@ -449,6 +553,7 @@ img.logo.first {
display: inline-block;
vertical-align: top;
margin-right: 3rem;
margin-top: 2rem;
min-width: 14rem;
margin-bottom: 3rem; }

View File

@ -275,6 +275,9 @@ module.exports = query({
return $('body').on('click', 'a', function(e) {
var href;
href = $(this).attr('href');
if (href[0] === "#") {
return true;
}
if (href && !/^https?:\/\//i.test(href)) {
e.preventDefault();
if ((href != null ? href[0] : void 0) !== "/") {
@ -301,10 +304,10 @@ module.exports = query({
}
href_parts[0] = next;
if (hist !== false) {
history.pushState({}, "", util.basepath(href_parts.join("")));
history.pushState({}, "", util.basepath(href_parts.join("#")));
}
if (next !== this.props.path) {
React.unmountComponentAtNode($('#body')[0]);
ReactDOM.unmountComponentAtNode($('#body')[0]);
TreeActions.setCurr(next);
return rend(BodyComponent({}, ""), $('#body')[0]);
}
@ -396,15 +399,22 @@ module.exports = function(queries, Child, load) {
}
},
stateFromStore: function() {
var fresh, ref1;
fresh = TreeStore.fulfill(this.getPath(), queries);
var fresh, got, path;
path = this.getPath();
fresh = TreeStore.fulfill(path, queries);
if (!((this.state != null) && path === this.state.path)) {
got = fresh;
} else {
got = this.mergeWith(this.state.got, fresh);
}
return {
path: path,
fresh: fresh,
got: this.mergeWith((ref1 = this.state) != null ? ref1.got : void 0, fresh)
got: got
};
},
mergeWith: function(have, fresh, _queries) {
var got, k, kid, ref1, ref2, ref3, ref4;
var got, k, kid, ref1, ref2, ref3;
if (have == null) {
have = {};
}
@ -424,11 +434,11 @@ module.exports = function(queries, Child, load) {
if (fresh.kids == null) {
got.kids = have.kids;
} else {
got.kids = (ref2 = _.clone(have.kids)) != null ? ref2 : {};
ref3 = fresh.kids;
for (k in ref3) {
kid = ref3[k];
got.kids[k] = this.mergeWith((ref4 = got.kids) != null ? ref4[k] : void 0, kid, _queries.kids);
got.kids = {};
ref2 = fresh.kids;
for (k in ref2) {
kid = ref2[k];
got.kids[k] = this.mergeWith((ref3 = have.kids) != null ? ref3[k] : void 0, kid, _queries.kids);
}
}
}
@ -629,7 +639,7 @@ module.exports = query({
})(this);
containerClas = clas({
"col-md-10": true,
"col-md-offset-2": this.props.meta.anchor !== 'none',
"col-md-offset-3": this.props.meta.anchor !== 'none',
body: true
});
bodyClas = clas((ref1 = this.props.meta.layout) != null ? ref1.split(',') : void 0);
@ -648,6 +658,12 @@ module.exports = query({
}), extra('comments'), extra('footer'))
]);
}
}), recl({
render: function() {
return div({
className: "col-md-offset-3 col-md-10"
}, rele(load));
}
}));
@ -933,7 +949,9 @@ module.exports = recl({
},{"./Reactify.coffee":14}],10:[function(require,module,exports){
var a, div, hr, li, query, reactify, recl, ref, ul;
var a, clas, div, hr, li, query, reactify, recl, ref, ul;
clas = require('classnames');
reactify = require('./Reactify.coffee');
@ -951,11 +969,7 @@ module.exports = query({
}, recl({
displayName: "Kids",
render: function() {
var _k, d, elem, k, keyed, keys, klass, ref1, ref2, ref3, ref4, sorted, str, v;
klass = "kids";
if (this.props.dataType) {
klass += " " + this.props.dataType;
}
var _k, d, elem, k, keyed, keys, ref1, ref2, ref3, ref4, sorted, str, v;
sorted = true;
keyed = {};
ref1 = this.props.kids;
@ -993,8 +1007,12 @@ module.exports = query({
if (this.props.sortBy === 'date') {
keys.reverse();
}
k = clas({
kids: true
}, this.props.className);
return div({
className: klass
className: k,
key: "kids"
}, (function() {
var i, len, ref5, results;
results = [];
@ -1003,7 +1021,8 @@ module.exports = query({
elem = (ref5 = this.props.kids[keyed[k]]) != null ? ref5 : "";
results.push([
div({
key: keyed[k]
key: keyed[k],
id: keyed[k]
}, reactify(elem.body)), hr({})
]);
}
@ -1013,7 +1032,7 @@ module.exports = query({
}));
},{"./Async.coffee":3,"./Reactify.coffee":14}],11:[function(require,module,exports){
},{"./Async.coffee":3,"./Reactify.coffee":14,"classnames":25}],11:[function(require,module,exports){
var a, clas, div, h1, li, pre, query, reactify, recl, ref, span, ul, util;
clas = require('classnames');
@ -1098,6 +1117,12 @@ module.exports = query({
continue;
}
href = util.basepath(path);
if (this.props.linkToFragments != null) {
href = "#" + item;
}
if (this.props.childIsFragment != null) {
href = (util.basepath(this.props.path)) + "#" + item;
}
if (elem.meta.link) {
href = elem.meta.link;
}
@ -1640,9 +1665,14 @@ module.exports = query({
return clearInterval(this.int);
},
collectHeader: function(arg) {
var c, ga, gn;
var c, comp, ga, gn;
gn = arg.gn, ga = arg.ga, c = arg.c;
if (gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN) {
if (this.props.match) {
comp = gn === this.props.match;
} else {
comp = gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN;
}
if (comp) {
ga = _.clone(ga);
ga.onClick = this._click(ga.id);
delete ga.id;
@ -1654,24 +1684,28 @@ module.exports = query({
}
},
parseHeaders: function() {
var i, len, ref, ref1, v;
var contents, i, len, ref, ref1, v;
if (this.props.body.c) {
ref = this.props.body.c;
for (i = 0, len = ref.length; i < len; i++) {
v = ref[i];
if (v.gn === 'div' && ((ref1 = v.ga) != null ? ref1.id : void 0) === "toc") {
contents = [{
gn: "h1",
ga: {
className: "t"
},
c: ["Table of contents"]
}].concat(slice.call(_.filter(v.c.map(this.collectHeader))));
if (this.props.noHeader) {
contents.shift();
}
return {
gn: "div",
ga: {
className: "toc"
},
c: [{
gn: "h1",
ga: {
className: "t"
},
c: ["Table of contents"]
}].concat(slice.call(_.filter(v.c.map(this.collectHeader))))
c: contents
};
}
}
@ -1729,12 +1763,16 @@ $(function() {
},{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":4,"./components/Components.coffee":7,"./utils/scroll.coffee":23,"./utils/util.coffee":24}],21:[function(require,module,exports){
var dedup, util;
var dedup, pending, util, waspWait;
util = require('../utils/util.coffee');
dedup = {};
pending = {};
waspWait = [];
module.exports = {
refresh: function() {
return dedup = {};
@ -1749,11 +1787,17 @@ module.exports = {
return;
}
dedup[url] = true;
pending[url] = true;
return $.get(url, {}, function(data, status, xhr) {
var dep;
delete pending[url];
dep = urb.getXHRWasp(xhr);
urb.sources[dep] = url;
urb.waspData(dep);
waspWait.push(dep);
if (_.isEmpty(pending)) {
waspWait.map(urb.waspData);
waspWait = [];
}
if (cb) {
return cb(null, data);
}