on master help sign in
Merge remote-tracking branch 'origin/cleanorg' into cleanorg
commit424cd1406c3625fb43347a4193d04afe7fc07933 authorC. Guy Yarvin <cgyarvin@gmail.com> dateTue 19 Apr 2016, 02:06 (11 years ago) parenta93ad09262c9d8
298 files changed+204−1979
docs/programming.md+2−10 docs/programming/advanced.md−10 docs/programming/advanced/arvo.md−9 docs/programming/advanced/nock.md−7 docs/programming/advanced/nock/reference.md−737 docs/programming/advanced/nock/tutorial.md−1044 docs/programming/arvo.md+10 docs/programming/advanced/arvo/internals.md → docs/programming/arvo/internals.md docs/programming/advanced/arvo/internals/ames.md → docs/programming/arvo/internals/ames.md docs/programming/advanced/arvo/internals/ames/commentary.md → docs/programming/arvo/internals/ames/commentary.md docs/programming/advanced/arvo/internals/behn.md → docs/programming/arvo/internals/behn.md docs/programming/advanced/arvo/internals/clay.md → docs/programming/arvo/internals/clay.md docs/programming/advanced/arvo/internals/clay/architecture.md → docs/programming/arvo/internals/clay/architecture.md docs/programming/advanced/arvo/internals/clay/commentary.md → docs/programming/arvo/internals/clay/commentary.md docs/programming/advanced/arvo/internals/dill.md → docs/programming/arvo/internals/dill.md docs/programming/advanced/arvo/internals/eyre.md → docs/programming/arvo/internals/eyre.md docs/programming/advanced/arvo/internals/eyre/commentary.md → docs/programming/arvo/internals/eyre/commentary.md docs/programming/advanced/arvo/internals/ford.md → docs/programming/arvo/internals/ford.md docs/programming/advanced/arvo/internals/ford/commentary.md → docs/programming/arvo/internals/ford/commentary.md docs/programming/advanced/arvo/internals/gall.md → docs/programming/arvo/internals/gall.md docs/programming/advanced/arvo/system.md → docs/programming/arvo/system.md docs/programming/advanced/arvo/system/api.md → docs/programming/arvo/system/api.md docs/programming/advanced/arvo/system/basic.md → docs/programming/arvo/system/basic.md docs/programming/advanced/arvo/system/generators.md → docs/programming/arvo/system/generators.md docs/programming/advanced/arvo/system/http.md → docs/programming/arvo/system/http.md docs/programming/advanced/arvo/system/marks.md → docs/programming/arvo/system/marks.md docs/programming/advanced/arvo/system/network.md → docs/programming/arvo/system/network.md docs/programming/advanced/arvo/system/security-driver.md → docs/programming/arvo/system/security-driver.md docs/programming/advanced/arvo/system/state.md → docs/programming/arvo/system/state.md docs/programming/advanced/arvo/system/subject.md → docs/programming/arvo/system/subject.md docs/programming/advanced/arvo/system/subscriptions.md → docs/programming/arvo/system/subscriptions.md docs/programming/advanced/arvo/system/web-apps.md → docs/programming/arvo/system/web-apps.md docs/programming/hoon.md+10 docs/programming/advanced/catalog.md → docs/programming/hoon/catalog.md docs/programming/advanced/catalog/bar-core.md → docs/programming/hoon/catalog/bar-core.md docs/programming/advanced/catalog/bar-core/cab-door.md → docs/programming/hoon/catalog/bar-core/cab-door.md docs/programming/advanced/catalog/bar-core/cen-core.md → docs/programming/hoon/catalog/bar-core/cen-core.md docs/programming/advanced/catalog/bar-core/dot-trap.md → docs/programming/hoon/catalog/bar-core/dot-trap.md docs/programming/advanced/catalog/bar-core/hep-loop.md → docs/programming/hoon/catalog/bar-core/hep-loop.md docs/programming/advanced/catalog/bar-core/tar-gill.md → docs/programming/hoon/catalog/bar-core/tar-gill.md docs/programming/advanced/catalog/bar-core/tis-gate.md → docs/programming/hoon/catalog/bar-core/tis-gate.md docs/programming/advanced/catalog/buc-mold.md → docs/programming/hoon/catalog/buc-mold.md docs/programming/advanced/catalog/buc-mold/cab-shoe.md → docs/programming/hoon/catalog/buc-mold/cab-shoe.md docs/programming/advanced/catalog/buc-mold/cen-book.md → docs/programming/hoon/catalog/buc-mold/cen-book.md docs/programming/advanced/catalog/buc-mold/col-bank.md → docs/programming/hoon/catalog/buc-mold/col-bank.md docs/programming/advanced/catalog/buc-mold/hep-lamb.md → docs/programming/hoon/catalog/buc-mold/hep-lamb.md docs/programming/advanced/catalog/buc-mold/ket-bush.md → docs/programming/hoon/catalog/buc-mold/ket-bush.md docs/programming/advanced/catalog/buc-mold/pat-claw.md → docs/programming/hoon/catalog/buc-mold/pat-claw.md docs/programming/advanced/catalog/buc-mold/tis-coat.md → docs/programming/hoon/catalog/buc-mold/tis-coat.md docs/programming/advanced/catalog/buc-mold/wut-pick.md → docs/programming/hoon/catalog/buc-mold/wut-pick.md docs/programming/advanced/catalog/cen-call.md → docs/programming/hoon/catalog/cen-call.md docs/programming/advanced/catalog/cen-call/dot-lace.md → docs/programming/hoon/catalog/cen-call/dot-lace.md docs/programming/advanced/catalog/cen-call/hep-call.md → docs/programming/hoon/catalog/cen-call/hep-call.md docs/programming/advanced/catalog/cen-call/ket-calq.md → docs/programming/hoon/catalog/cen-call/ket-calq.md docs/programming/advanced/catalog/cen-call/lus-calt.md → docs/programming/hoon/catalog/cen-call/lus-calt.md docs/programming/advanced/catalog/cen-call/sig-open.md → docs/programming/hoon/catalog/cen-call/sig-open.md docs/programming/advanced/catalog/cen-call/tis-make.md → docs/programming/hoon/catalog/cen-call/tis-make.md docs/programming/advanced/catalog/col-cell.md → docs/programming/hoon/catalog/col-cell.md docs/programming/advanced/catalog/col-cell/cab-scon.md → docs/programming/hoon/catalog/col-cell/cab-scon.md docs/programming/advanced/catalog/col-cell/hep-cons.md → docs/programming/hoon/catalog/col-cell/hep-cons.md docs/programming/advanced/catalog/col-cell/ket-conq.md → docs/programming/hoon/catalog/col-cell/ket-conq.md docs/programming/advanced/catalog/col-cell/lus-cont.md → docs/programming/hoon/catalog/col-cell/lus-cont.md docs/programming/advanced/catalog/col-cell/sig-conl.md → docs/programming/hoon/catalog/col-cell/sig-conl.md docs/programming/advanced/catalog/col-cell/tar-conp.md → docs/programming/hoon/catalog/col-cell/tar-conp.md docs/programming/advanced/catalog/dot-nock.md → docs/programming/hoon/catalog/dot-nock.md docs/programming/advanced/catalog/dot-nock/ket-wish.md → docs/programming/hoon/catalog/dot-nock/ket-wish.md docs/programming/advanced/catalog/dot-nock/lus-bump.md → docs/programming/hoon/catalog/dot-nock/lus-bump.md docs/programming/advanced/catalog/dot-nock/tar-nock.md → docs/programming/hoon/catalog/dot-nock/tar-nock.md docs/programming/advanced/catalog/dot-nock/tis-same.md → docs/programming/hoon/catalog/dot-nock/tis-same.md docs/programming/advanced/catalog/dot-nock/wut-deep.md → docs/programming/hoon/catalog/dot-nock/wut-deep.md docs/programming/advanced/catalog/ket-cast.md → docs/programming/hoon/catalog/ket-cast.md docs/programming/advanced/catalog/ket-cast/bar-iron.md → docs/programming/hoon/catalog/ket-cast/bar-iron.md docs/programming/advanced/catalog/ket-cast/hep-cast.md → docs/programming/hoon/catalog/ket-cast/hep-cast.md docs/programming/advanced/catalog/ket-cast/lus-like.md → docs/programming/hoon/catalog/ket-cast/lus-like.md docs/programming/advanced/catalog/ket-cast/pam-zinc.md → docs/programming/hoon/catalog/ket-cast/pam-zinc.md docs/programming/advanced/catalog/ket-cast/sig-burn.md → docs/programming/hoon/catalog/ket-cast/sig-burn.md docs/programming/advanced/catalog/ket-cast/tis-name.md → docs/programming/hoon/catalog/ket-cast/tis-name.md docs/programming/advanced/catalog/ket-cast/wut-lead.md → docs/programming/hoon/catalog/ket-cast/wut-lead.md docs/programming/advanced/catalog/misc.md → docs/programming/hoon/catalog/misc.md docs/programming/advanced/catalog/misc/base.md → docs/programming/hoon/catalog/misc/base.md docs/programming/advanced/catalog/misc/buc-bunt.md → docs/programming/hoon/catalog/misc/buc-bunt.md docs/programming/advanced/catalog/misc/bust.md → docs/programming/hoon/catalog/misc/bust.md docs/programming/advanced/catalog/misc/dbug.md → docs/programming/hoon/catalog/misc/dbug.md docs/programming/advanced/catalog/misc/hand.md → docs/programming/hoon/catalog/misc/hand.md docs/programming/advanced/catalog/misc/knit.md → docs/programming/hoon/catalog/misc/knit.md docs/programming/advanced/catalog/misc/leaf.md → docs/programming/hoon/catalog/misc/leaf.md docs/programming/advanced/catalog/misc/limb.md → docs/programming/hoon/catalog/misc/limb.md docs/programming/advanced/catalog/misc/lost.md → docs/programming/hoon/catalog/misc/lost.md docs/programming/advanced/catalog/misc/rock.md → docs/programming/hoon/catalog/misc/rock.md docs/programming/advanced/catalog/misc/sand.md → docs/programming/hoon/catalog/misc/sand.md docs/programming/advanced/catalog/misc/tell.md → docs/programming/hoon/catalog/misc/tell.md docs/programming/advanced/catalog/misc/tune.md → docs/programming/hoon/catalog/misc/tune.md docs/programming/advanced/catalog/misc/wing.md → docs/programming/hoon/catalog/misc/wing.md docs/programming/advanced/catalog/misc/yell.md → docs/programming/hoon/catalog/misc/yell.md docs/programming/advanced/catalog/sem-make.md → docs/programming/hoon/catalog/sem-make.md docs/programming/advanced/catalog/sem-make/col-wad.md → docs/programming/hoon/catalog/sem-make/col-wad.md docs/programming/advanced/catalog/sem-make/fas-nub.md → docs/programming/hoon/catalog/sem-make/fas-nub.md docs/programming/advanced/catalog/sem-make/sem-fry.md → docs/programming/hoon/catalog/sem-make/sem-fry.md docs/programming/advanced/catalog/sem-make/sig-dip.md → docs/programming/hoon/catalog/sem-make/sig-dip.md docs/programming/advanced/catalog/sig-hint.md → docs/programming/hoon/catalog/sig-hint.md docs/programming/advanced/catalog/sig-hint/bar-show.md → docs/programming/hoon/catalog/sig-hint/bar-show.md docs/programming/advanced/catalog/sig-hint/buc-poll.md → docs/programming/hoon/catalog/sig-hint/buc-poll.md docs/programming/advanced/catalog/sig-hint/cab-lurk.md → docs/programming/hoon/catalog/sig-hint/cab-lurk.md docs/programming/advanced/catalog/sig-hint/cen-fast.md → docs/programming/hoon/catalog/sig-hint/cen-fast.md docs/programming/advanced/catalog/sig-hint/fas-funk.md → docs/programming/hoon/catalog/sig-hint/fas-funk.md docs/programming/advanced/catalog/sig-hint/gal-thin.md → docs/programming/hoon/catalog/sig-hint/gal-thin.md docs/programming/advanced/catalog/sig-hint/gar-hint.md → docs/programming/hoon/catalog/sig-hint/gar-hint.md docs/programming/advanced/catalog/sig-hint/lus-memo.md → docs/programming/hoon/catalog/sig-hint/lus-memo.md docs/programming/advanced/catalog/sig-hint/pam-dump.md → docs/programming/hoon/catalog/sig-hint/pam-dump.md docs/programming/advanced/catalog/sig-hint/tis-ddup.md → docs/programming/hoon/catalog/sig-hint/tis-ddup.md docs/programming/advanced/catalog/sig-hint/wut-warn.md → docs/programming/hoon/catalog/sig-hint/wut-warn.md docs/programming/advanced/catalog/sig-hint/zap-peep.md → docs/programming/hoon/catalog/sig-hint/zap-peep.md docs/programming/advanced/catalog/tis-flow.md → docs/programming/hoon/catalog/tis-flow.md docs/programming/advanced/catalog/tis-flow/bar-new.md → docs/programming/hoon/catalog/tis-flow/bar-new.md docs/programming/advanced/catalog/tis-flow/col-fix.md → docs/programming/hoon/catalog/tis-flow/col-fix.md docs/programming/advanced/catalog/tis-flow/dot-set.md → docs/programming/hoon/catalog/tis-flow/dot-set.md docs/programming/advanced/catalog/tis-flow/fas-var.md → docs/programming/hoon/catalog/tis-flow/fas-var.md docs/programming/advanced/catalog/tis-flow/gal-rap.md → docs/programming/hoon/catalog/tis-flow/gal-rap.md docs/programming/advanced/catalog/tis-flow/gar-per.md → docs/programming/hoon/catalog/tis-flow/gar-per.md docs/programming/advanced/catalog/tis-flow/hep-nip.md → docs/programming/hoon/catalog/tis-flow/hep-nip.md docs/programming/advanced/catalog/tis-flow/ket-sip.md → docs/programming/hoon/catalog/tis-flow/ket-sip.md docs/programming/advanced/catalog/tis-flow/lus-pin.md → docs/programming/hoon/catalog/tis-flow/lus-pin.md docs/programming/advanced/catalog/tis-flow/sem-rev.md → docs/programming/hoon/catalog/tis-flow/sem-rev.md docs/programming/advanced/catalog/tis-flow/sig-tow.md → docs/programming/hoon/catalog/tis-flow/sig-tow.md docs/programming/advanced/catalog/tis-flow/tar-aka.md → docs/programming/hoon/catalog/tis-flow/tar-aka.md docs/programming/advanced/catalog/tis-flow/ts/tsbr.md → docs/programming/hoon/catalog/tis-flow/ts/tsbr.md docs/programming/advanced/catalog/tis-flow/ts/tscl.md → docs/programming/hoon/catalog/tis-flow/ts/tscl.md docs/programming/advanced/catalog/tis-flow/ts/tsdt.md → docs/programming/hoon/catalog/tis-flow/ts/tsdt.md docs/programming/advanced/catalog/tis-flow/ts/tsgl.md → docs/programming/hoon/catalog/tis-flow/ts/tsgl.md docs/programming/advanced/catalog/tis-flow/ts/tsgr.md → docs/programming/hoon/catalog/tis-flow/ts/tsgr.md docs/programming/advanced/catalog/tis-flow/ts/tshp.md → docs/programming/hoon/catalog/tis-flow/ts/tshp.md docs/programming/advanced/catalog/tis-flow/ts/tskt.md → docs/programming/hoon/catalog/tis-flow/ts/tskt.md docs/programming/advanced/catalog/tis-flow/ts/tsls.md → docs/programming/hoon/catalog/tis-flow/ts/tsls.md docs/programming/advanced/catalog/tis-flow/ts/tssg.md → docs/programming/hoon/catalog/tis-flow/ts/tssg.md docs/programming/advanced/catalog/tis-flow/ts/tstr.md → docs/programming/hoon/catalog/tis-flow/ts/tstr.md docs/programming/advanced/catalog/wut-test.md → docs/programming/hoon/catalog/wut-test.md docs/programming/advanced/catalog/wut-test/bar-or.md → docs/programming/hoon/catalog/wut-test/bar-or.md docs/programming/advanced/catalog/wut-test/col-if.md → docs/programming/hoon/catalog/wut-test/col-if.md docs/programming/advanced/catalog/wut-test/dot-lest.md → docs/programming/hoon/catalog/wut-test/dot-lest.md docs/programming/advanced/catalog/wut-test/gal-deny.md → docs/programming/hoon/catalog/wut-test/gal-deny.md docs/programming/advanced/catalog/wut-test/gar-sure.md → docs/programming/hoon/catalog/wut-test/gar-sure.md docs/programming/advanced/catalog/wut-test/hep-case.md → docs/programming/hoon/catalog/wut-test/hep-case.md docs/programming/advanced/catalog/wut-test/ket-ifcl.md → docs/programming/hoon/catalog/wut-test/ket-ifcl.md docs/programming/advanced/catalog/wut-test/lus-deft.md → docs/programming/hoon/catalog/wut-test/lus-deft.md docs/programming/advanced/catalog/wut-test/pam-and.md → docs/programming/hoon/catalog/wut-test/pam-and.md docs/programming/advanced/catalog/wut-test/pat-ifat.md → docs/programming/hoon/catalog/wut-test/pat-ifat.md docs/programming/advanced/catalog/wut-test/sig-ifno.md → docs/programming/hoon/catalog/wut-test/sig-ifno.md docs/programming/advanced/catalog/wut-test/tis-fits.md → docs/programming/hoon/catalog/wut-test/tis-fits.md docs/programming/advanced/catalog/wut-test/zap-not.md → docs/programming/hoon/catalog/wut-test/zap-not.md docs/programming/advanced/catalog/zap-wild.md → docs/programming/hoon/catalog/zap-wild.md docs/programming/advanced/catalog/zap-wild/com-twig.md → docs/programming/hoon/catalog/zap-wild/com-twig.md docs/programming/advanced/catalog/zap-wild/gar-wrap.md → docs/programming/hoon/catalog/zap-wild/gar-wrap.md docs/programming/advanced/catalog/zap-wild/sem-spit.md → docs/programming/hoon/catalog/zap-wild/sem-spit.md docs/programming/advanced/catalog/zap-wild/tis-code.md → docs/programming/hoon/catalog/zap-wild/tis-code.md docs/programming/advanced/catalog/zap-wild/wut-need.md → docs/programming/hoon/catalog/zap-wild/wut-need.md docs/programming/advanced/catalog/zap-wild/zap-fail.md → docs/programming/hoon/catalog/zap-wild/zap-fail.md docs/programming/cheat-sheets.md → docs/programming/hoon/cheat-sheets.md docs/programming/cheat-sheets/hoon.md → docs/programming/hoon/cheat-sheets/hoon.md docs/programming/cheat-sheets/odors.md → docs/programming/hoon/cheat-sheets/odors.md docs/programming/cheat-sheets/pronunciation.md → docs/programming/hoon/cheat-sheets/pronunciation.md docs/programming/concepts.md → docs/programming/hoon/concepts.md docs/programming/demo.md → docs/programming/hoon/demo.md docs/programming/examples.md → docs/programming/hoon/examples.md docs/programming/advanced/library.md → docs/programming/hoon/library.md docs/programming/advanced/library/1a.md → docs/programming/hoon/library/1a.md docs/programming/advanced/library/1b.md → docs/programming/hoon/library/1b.md docs/programming/advanced/library/1c.md → docs/programming/hoon/library/1c.md docs/programming/advanced/library/2a.md → docs/programming/hoon/library/2a.md docs/programming/advanced/library/2b.md → docs/programming/hoon/library/2b.md docs/programming/advanced/library/2c.md → docs/programming/hoon/library/2c.md docs/programming/advanced/library/2d.md → docs/programming/hoon/library/2d.md docs/programming/advanced/library/2e.md → docs/programming/hoon/library/2e.md docs/programming/advanced/library/2f.md → docs/programming/hoon/library/2f.md docs/programming/advanced/library/2g.md → docs/programming/hoon/library/2g.md docs/programming/advanced/library/2h.md → docs/programming/hoon/library/2h.md docs/programming/advanced/library/2i.md → docs/programming/hoon/library/2i.md docs/programming/advanced/library/2j.md → docs/programming/hoon/library/2j.md docs/programming/advanced/library/2k.md → docs/programming/hoon/library/2k.md docs/programming/advanced/library/2l.md → docs/programming/hoon/library/2l.md docs/programming/advanced/library/2m.md → docs/programming/hoon/library/2m.md docs/programming/advanced/library/2n.md → docs/programming/hoon/library/2n.md docs/programming/advanced/library/2o.md → docs/programming/hoon/library/2o.md docs/programming/advanced/library/2p.md → docs/programming/hoon/library/2p.md docs/programming/advanced/library/2q.md → docs/programming/hoon/library/2q.md docs/programming/advanced/library/3a.md → docs/programming/hoon/library/3a.md docs/programming/advanced/library/3b.md → docs/programming/hoon/library/3b.md docs/programming/advanced/library/3c.md → docs/programming/hoon/library/3c.md docs/programming/advanced/library/3d.md → docs/programming/hoon/library/3d.md docs/programming/advanced/library/3e.md → docs/programming/hoon/library/3e.md docs/programming/advanced/library/3f.md → docs/programming/hoon/library/3f.md docs/programming/advanced/library/3g.md → docs/programming/hoon/library/3g.md docs/programming/advanced/library/4a.md → docs/programming/hoon/library/4a.md docs/programming/advanced/library/4b.md → docs/programming/hoon/library/4b.md docs/programming/advanced/library/4c.md → docs/programming/hoon/library/4c.md docs/programming/advanced/library/4d.md → docs/programming/hoon/library/4d.md docs/programming/advanced/library/4e.md → docs/programming/hoon/library/4e.md docs/programming/advanced/library/4f.md → docs/programming/hoon/library/4f.md docs/programming/advanced/library/4g.md → docs/programming/hoon/library/4g.md docs/programming/advanced/library/4h.md → docs/programming/hoon/library/4h.md docs/programming/advanced/library/4i.md → docs/programming/hoon/library/4i.md docs/programming/advanced/library/4j.md → docs/programming/hoon/library/4j.md docs/programming/advanced/library/4k.md → docs/programming/hoon/library/4k.md docs/programming/advanced/library/4l.md → docs/programming/hoon/library/4l.md docs/programming/advanced/library/4m.md → docs/programming/hoon/library/4m.md docs/programming/advanced/library/4n.md → docs/programming/hoon/library/4n.md docs/programming/advanced/library/4o.md → docs/programming/hoon/library/4o.md docs/programming/advanced/library/5a.md → docs/programming/hoon/library/5a.md docs/programming/advanced/library/5b.md → docs/programming/hoon/library/5b.md docs/programming/advanced/library/5c.md → docs/programming/hoon/library/5c.md docs/programming/advanced/library/5d.md → docs/programming/hoon/library/5d.md docs/programming/advanced/library/5e.md → docs/programming/hoon/library/5e.md docs/programming/advanced/library/5f.md → docs/programming/hoon/library/5f.md docs/programming/advanced/library/5g.md → docs/programming/hoon/library/5g.md docs/programming/advanced/arvo/zuse.md → docs/programming/hoon/library/zuse.md docs/programming/advanced/arvo/zuse/core/crua.md → docs/programming/hoon/library/zuse/core/crua.md docs/programming/advanced/arvo/zuse/core/epur.md → docs/programming/hoon/library/zuse/core/epur.md docs/programming/advanced/arvo/zuse/core/fu.md → docs/programming/hoon/library/zuse/core/fu.md docs/programming/advanced/arvo/zuse/core/jo.md → docs/programming/hoon/library/zuse/core/jo.md docs/programming/advanced/arvo/zuse/core/poja.md → docs/programming/hoon/library/zuse/core/poja.md docs/programming/advanced/arvo/zuse/core/poxa.md → docs/programming/hoon/library/zuse/core/poxa.md docs/programming/advanced/arvo/zuse/core/poxo.md → docs/programming/hoon/library/zuse/core/poxo.md docs/programming/advanced/arvo/zuse/core/yu.md → docs/programming/hoon/library/zuse/core/yu.md docs/programming/advanced/arvo/zuse/diff.md → docs/programming/hoon/library/zuse/diff.md docs/programming/advanced/arvo/zuse/gate/clan.md → docs/programming/hoon/library/zuse/gate/clan.md docs/programming/advanced/arvo/zuse/gate/dawn.md → docs/programming/hoon/library/zuse/gate/dawn.md docs/programming/advanced/arvo/zuse/gate/daws.md → docs/programming/hoon/library/zuse/gate/daws.md docs/programming/advanced/arvo/zuse/gate/deal.md → docs/programming/hoon/library/zuse/gate/deal.md docs/programming/advanced/arvo/zuse/gate/deft.md → docs/programming/hoon/library/zuse/gate/deft.md docs/programming/advanced/arvo/zuse/gate/dust.md → docs/programming/hoon/library/zuse/gate/dust.md docs/programming/advanced/arvo/zuse/gate/earl.md → docs/programming/hoon/library/zuse/gate/earl.md docs/programming/advanced/arvo/zuse/gate/earn.md → docs/programming/hoon/library/zuse/gate/earn.md docs/programming/advanced/arvo/zuse/gate/fain.md → docs/programming/hoon/library/zuse/gate/fain.md docs/programming/advanced/arvo/zuse/gate/feel.md → docs/programming/hoon/library/zuse/gate/feel.md docs/programming/advanced/arvo/zuse/gate/file.md → docs/programming/hoon/library/zuse/gate/file.md docs/programming/advanced/arvo/zuse/gate/foal.md → docs/programming/hoon/library/zuse/gate/foal.md docs/programming/advanced/arvo/zuse/gate/fray.md → docs/programming/hoon/library/zuse/gate/fray.md docs/programming/advanced/arvo/zuse/gate/fuel.md → docs/programming/hoon/library/zuse/gate/fuel.md docs/programming/advanced/arvo/zuse/gate/furl.md → docs/programming/hoon/library/zuse/gate/furl.md docs/programming/advanced/arvo/zuse/gate/glam.md → docs/programming/hoon/library/zuse/gate/glam.md docs/programming/advanced/arvo/zuse/gate/glon.md → docs/programming/hoon/library/zuse/gate/glon.md docs/programming/advanced/arvo/zuse/gate/gnom.md → docs/programming/hoon/library/zuse/gate/gnom.md docs/programming/advanced/arvo/zuse/gate/jape.md → docs/programming/hoon/library/zuse/gate/jape.md docs/programming/advanced/arvo/zuse/gate/jesc.md → docs/programming/hoon/library/zuse/gate/jesc.md docs/programming/advanced/arvo/zuse/gate/joba.md → docs/programming/hoon/library/zuse/gate/joba.md docs/programming/advanced/arvo/zuse/gate/jobe.md → docs/programming/hoon/library/zuse/gate/jobe.md docs/programming/advanced/arvo/zuse/gate/jone.md → docs/programming/hoon/library/zuse/gate/jone.md docs/programming/advanced/arvo/zuse/gate/lead.md → docs/programming/hoon/library/zuse/gate/lead.md docs/programming/advanced/arvo/zuse/gate/mang.md → docs/programming/hoon/library/zuse/gate/mang.md docs/programming/advanced/arvo/zuse/gate/meat.md → docs/programming/hoon/library/zuse/gate/meat.md docs/programming/advanced/arvo/zuse/gate/moon.md → docs/programming/hoon/library/zuse/gate/moon.md docs/programming/advanced/arvo/zuse/gate/mung.md → docs/programming/hoon/library/zuse/gate/mung.md docs/programming/advanced/arvo/zuse/gate/perk.md → docs/programming/hoon/library/zuse/gate/perk.md docs/programming/advanced/arvo/zuse/gate/pojo.md → docs/programming/hoon/library/zuse/gate/pojo.md docs/programming/advanced/arvo/zuse/gate/saxo.md → docs/programming/hoon/library/zuse/gate/saxo.md docs/programming/advanced/arvo/zuse/gate/scanf.md → docs/programming/hoon/library/zuse/gate/scanf.md docs/programming/advanced/arvo/zuse/gate/sein.md → docs/programming/hoon/library/zuse/gate/sein.md docs/programming/advanced/arvo/zuse/gate/sifo.md → docs/programming/hoon/library/zuse/gate/sifo.md docs/programming/advanced/arvo/zuse/gate/stud.md → docs/programming/hoon/library/zuse/gate/stud.md docs/programming/advanced/arvo/zuse/gate/taco.md → docs/programming/hoon/library/zuse/gate/taco.md docs/programming/advanced/arvo/zuse/gate/tact.md → docs/programming/hoon/library/zuse/gate/tact.md docs/programming/advanced/arvo/zuse/gate/tame.md → docs/programming/hoon/library/zuse/gate/tame.md docs/programming/advanced/arvo/zuse/gate/tell.md → docs/programming/hoon/library/zuse/gate/tell.md docs/programming/advanced/arvo/zuse/gate/tome.md → docs/programming/hoon/library/zuse/gate/tome.md docs/programming/advanced/arvo/zuse/gate/tope.md → docs/programming/hoon/library/zuse/gate/tope.md docs/programming/advanced/arvo/zuse/gate/txml.md → docs/programming/hoon/library/zuse/gate/txml.md docs/programming/advanced/arvo/zuse/gate/unt.md → docs/programming/hoon/library/zuse/gate/unt.md docs/programming/advanced/arvo/zuse/gate/urld.md → docs/programming/hoon/library/zuse/gate/urld.md docs/programming/advanced/arvo/zuse/gate/urle.md → docs/programming/hoon/library/zuse/gate/urle.md docs/programming/advanced/arvo/zuse/mold/udal.md → docs/programming/hoon/library/zuse/mold/udal.md docs/programming/advanced/arvo/zuse/mold/udon.md → docs/programming/hoon/library/zuse/mold/udon.md docs/programming/advanced/arvo/zuse/mold/umph.md → docs/programming/hoon/library/zuse/mold/umph.md docs/programming/advanced/arvo/zuse/mold/unce.md → docs/programming/hoon/library/zuse/mold/unce.md docs/programming/advanced/arvo/zuse/mold/upas.md → docs/programming/hoon/library/zuse/mold/upas.md docs/programming/advanced/arvo/zuse/mold/urge.md → docs/programming/hoon/library/zuse/mold/urge.md docs/programming/advanced/arvo/zuse/rsa.md → docs/programming/hoon/library/zuse/rsa.md docs/programming/mint.md → docs/programming/hoon/mint.md docs/programming/noun.md → docs/programming/hoon/noun.md docs/programming/philosophy.md → docs/programming/hoon/philosophy.md docs/programming/span.md → docs/programming/hoon/span.md docs/programming/troubleshooting.md → docs/programming/hoon/troubleshooting.md docs/programming/twig.md → docs/programming/hoon/twig.md docs/programming/twig/atom.md → docs/programming/hoon/twig/atom.md docs/programming/twig/call.md → docs/programming/hoon/twig/call.md docs/programming/twig/cast.md → docs/programming/hoon/twig/cast.md docs/programming/twig/cell.md → docs/programming/hoon/twig/cell.md docs/programming/twig/core.md → docs/programming/hoon/twig/core.md docs/programming/twig/flow.md → docs/programming/hoon/twig/flow.md docs/programming/twig/limb.md → docs/programming/hoon/twig/limb.md docs/programming/twig/mold.md → docs/programming/hoon/twig/mold.md docs/programming/twig/nock.md → docs/programming/hoon/twig/nock.md docs/programming/twig/syntax.md → docs/programming/hoon/twig/syntax.md docs/programming/twig/syntax/design.md → docs/programming/hoon/twig/syntax/design.md docs/programming/twig/syntax/motivation.md → docs/programming/hoon/twig/syntax/motivation.md docs/programming/twig/test.md → docs/programming/hoon/twig/test.md docs/programming/nock.md+5−162 docs/programming/nock/nock.md+167 docs/programming/runtime.md+10 docs/programming/advanced/runtime.md → docs/programming/runtime/vere.md
docs/programming.md+2−10
@@ -4,14 +4,6 @@ sort: 3
44
55# Programming
66
7−Urbit's programming language is called Hoon. It's a strict,
8−typed functional language without category theory. Hoon is not
9−closely related to any older language.
7+Nock is our interpreter, Hoon is our language and Arvo is our operating environment.
108
11−Hoon is named after a Wallace Stevens poem. Coincidentally, it
12−means "hooligan" in Australian. Practically, "Hoon" is a short
13−punchy name which search engines handle well.
14−
15−To learn to program in Urbit, traverse this tree depth-first:
16−
17−<list/>
9+<kids />
docs/programming/advanced.mddeleted−10
@@ -1,10 +0,0 @@
1−---
2−sort: 11
3−---
4−
5−# Advanced
6−
7−You've read through, or at least skimmed, the Core Hoon documents.
8−Here's the rest of what you need to know to program in Urbit.
9−
10−<list/>
docs/programming/advanced/arvo.mddeleted−9
@@ -1,9 +0,0 @@
1−---
2−sort: 1
3−---
4−
5−# Arvo programming
6−
7−Once you know Hoon, it's time to write programs that actually use Arvo.
8−
9−<list></list>
docs/programming/advanced/nock.mddeleted−7
@@ -1,7 +0,0 @@
1−---
2−sort: 4
3−---
4−
5−# Nock, in more depth
6−
7−<list></list>
docs/programming/advanced/nock/reference.mddeleted−737
@@ -1,737 +0,0 @@
1−Nock Reference
2−==============
3−
4−Nouns
5−-----
6−
7− 1 :: A noun is an atom or a cell.
8− 2 :: An atom is a natural number.
9− 3 :: A cell is an ordered pair of nouns.
10−
11−An **atom** is a natural number - ie, an unsigned integer. Nock does not
12−limit the size of **atoms**, or know what an **atom** means.
13−
14−For instance, the **atom** `97` might mean the number `97`, or it might
15−mean the letter `a` (ASCII 97). A very large **atom** might be the
16−number of grains of sand on the beach - or it might be a GIF of your
17−children playing on the beach. Typically when we represent strings or
18−files as **atoms**, the first byte is the low byte. But even this is
19−just a convention. An **atom** is an **atom**.
20−
21−A **cell** is an ordered pair of any two **nouns** - **cell** or
22−**atom**. We group cells with square brackets:
23−
24− [1 1]
25− [34 45]
26− [[3 42] 12]
27− [[1 0] [0 [1 99]]]
28−
29−*Nouns* are the dumbest data model ever. **Nouns** make JSON look like
30−XML and XML look like ASN.1. It may also remind you of Lisp's
31−S-expressions - you can think of nouns as "S-expressions without the S."
32−
33−To be exact, a *noun* is an S-expression, except that classic
34−S-expressions have multiple **atom** types ("S" is for "symbol"). Since
35−Nock is designed to be used with a higher-level type system (such as
36−Hoon's), it does not need low-level types. An **atom** is just an
37−unsigned integer of any size.
38−
39−For instance, it's common to represent strings (or even whole text
40−files) as atoms, arranging them LSB first - so "foo" becomes `0x6f6f66`.
41−How do we know to print this as "foo", not `0x6f6f66`? We need external
42−information - such as a Hoon type. Similarly, other common atomic
43−types - signed integers, floating point, etc — are all straightforward
44−to map into **atoms**.
45−
46−It's also important to note that, unlike Lisp, Nock cannot create
47−cyclical data structures. It is normal and common for **nouns** in a
48−Nock runtime system to have acyclic structure - shared subtrees. But
49−there is no Nock computation that can make a child point to its parent.
50−One consequence: Nock has no garbage collector. (Nor can dag structure
51−be detected, as with Lisp eq.)
52−
53−There is also no single syntax for **nouns**. If you have **nouns** you
54−have Nock; if you have Nock you have Hoon; if you have Hoon, you can
55−write whatever parser you like.
56−
57−------------------------------------------------------------------------
58−
59−The Nock Function
60−-----------------
61−
62− 5 :: nock(a) *a
63−
64−Nock is a pure (stateless) function from **noun** to **noun**. In our
65−pseudocode (and only in our pseudocode) we express this with the prefix
66−operator `*`.
67−
68−A Nock program is given meaning by a process of reduction. To compute
69−`nock(x)`, where `x` is any **noun**, we step through the rules from the
70−top down, find the first left-hand side that matches `x`, and reduce it
71−to the right-hand side (in more mathematical notation, we might write
72−line 5 as `nock(a) -> *a`, a style we do use in documentation)
73−
74−When we use variable names, like `a`, in the pseudocode spec, we simply
75−mean that the rule fits for any **noun** `a`.
76−
77−So `nock(x)` is `*x`, for any **noun** `x`. And how do we reduce `*x`?
78−Looking up, we see that lines 23 through 39 reduce `*x` - for different
79−patterns of `x`.
80−
81−Normally `a` in `nock(a)` is a **cell** `[s f]`, or
82−
83− [subject formula]
84−
85−Intuitively, the formula is your function and the subject is its
86−argument. Hoon, or any other high-level language built on Nock, will
87−build its own function calling convention which does not map directly to
88−`*[subject formula]`.
89−
90−------------------------------------------------------------------------
91−
92−Bracket Grouping
93−----------------
94−
95− 6 :: [a b c] [a [b c]]
96−
97−Brackets associate to the right.
98−
99−So instead of writing
100−
101− [2 [6 7]]
102− [2 [6 [14 15]]]
103− [2 [6 [[28 29] [30 31]]]]
104− [2 [6 [[28 29] [30 [62 63]]]]]
105−
106−we can write
107−
108− [2 6 7]
109− [2 6 14 15]
110− [2 6 [28 29] 30 31]
111− [2 6 [28 29] 30 62 63]
112−
113−While this notational convenience is hardly rocket science, it's
114−surprising how confusing it can be, especially if you have a Lisp
115−background. Lisp's "S-expressions" are very similar to **nouns**, except
116−that Lisp has multiple types of **atom**, and Lisp's syntax
117−automatically adds list terminators to groups.
118−
119−For those with Lisp experience, it's important to note that Nock and
120−Hoon use tuples or "improper lists" much more heavily than Lisp. The
121−list terminator, normally 0, is never automatic. So the Lisp list
122−
123− (a b c)
124−
125−becomes the Nock **noun**
126−
127− [a b c 0]
128−
129−which is equivalent to
130−
131− [a [b [c 0]]]
132−
133−Note that we can and do use unnecessary brackets anyway, for emphasis.
134−
135−------------------------------------------------------------------------
136−
137−Axiomatic Functions
138−-------------------
139−
140− 8 :: ?[a b] 0
141− 9 :: ?a 1
142− 10 :: +[a b] +[a b]
143− 11 :: +a 1 + a
144− 12 :: =[a a] 0
145− 13 :: =[a b] 1
146−
147−Here we define three of Nock's four axiomatic functions: **Cell-test**,
148−**Increment** and **Equals** (the fourth axiomatic function, called
149−**Address**, is defined in lines 16 through 21). These functions are
150−just pseudocode, not actual Nock syntax, and are only used to define the
151−behaviour of certain Nock operators.
152−
153−We should note that in Nock and Hoon, `0` (pronounced "yes") is true,
154−and `1` ("no") is false. This convention is the opposite of
155−old-fashioned booleans, so we try hard to say "yes" and "no" instead of
156−"true" and "false."
157−
158−------------------------------------------------------------------------
159−
160−### Cell-test `?`
161−
162−`?` (pronounced "wut") tests whether is a **noun** is a **cell**. Again,
163−`0` means "yes", `1` means "no":
164−
165− 8 :: ?[a b] 0
166− 9 :: ?a 1
167−
168−------------------------------------------------------------------------
169−
170−### Increment `+`
171−
172−`+` (pronounced "lus") adds `1` to an **atom**:
173−
174− 10 :: +[a b] +[a b]
175− 11 :: +a 1 + a
176−
177−------------------------------------------------------------------------
178−
179−### Equals `=`
180−
181−`=` (pronounced "tis") tests a cell for equality. `0` means "yes", `1`
182−means "no":
183−
184− 12 :: =[a a] 0
185− 13 :: =[a b] 1
186− 14 :: =a =a
187−
188−Testing an **atom** for equality makes no sense and logically fails to
189−terminate.
190−
191−Because `+` works only for **atoms**, whereas `=` works only for
192−**cells**, the error rules match first for `+` and last for `=`.
193−
194−------------------------------------------------------------------------
195−
196−Noun Address
197−------------
198−
199− 16 :: /[1 a] a
200− 17 :: /[2 a b] a
201− 18 :: /[3 a b] b
202− 19 :: /[(a + a) b] /[2 /[a b]]
203− 20 :: /[(a + a + 1) b] /[3 /[a b]]
204− 21 :: /a /a
205−
206−We define a **noun** as a binary tree - where each node branches to a
207−left and right child - and assign an address, or **axis**, to every
208−element in the tree. The root of the tree is `/1`. The left child
209−(**head**) of every node at `/a` is `/2a`; the right child (**tail**) is
210−`/2a+1`. (Writing `(a + a)` is just a clever way to write `2a`, while
211−minimizing the set of pseudocode forms.)
212−
213−`1` is the root. The **head** of every **axis** `n` is `2n`; the
214−**tail** is `2n+1`. Thus a simple tree:
215−
216− 1
217− 2 3
218− 4 5 6 7
219− 14 15
220−
221−If the value of every leaf is its tree address, this tree is
222−
223− [[4 5] [6 14 15]]
224−
225−Let's use the example `[[97 2] [1 42 0]]`. So
226−
227− /[1 [97 2] [1 42 0]] -> [[97 2] [1 42 0]]
228−
229−because `/1` is the root of the tree, ie, the whole **noun**.
230−
231−Its left child (**head**) is `/2` (i.e. `(1 + 1)`):
232−
233− /[2 [97 2] [1 42 0]] -> [97 2]
234−
235−And its right child (**tail**) is `/3` (i.e. `(1 + 1 + 1)`):
236−
237− /[3 [97 2] [1 42 0]] -> [1 42 0]
238−
239−And delving into `/3`, we see `/(3 + 3)` and `/(3 + 3 + 1)`:
240−
241− /[6 [97 2] [1 42 0]] -> 1
242− /[7 [97 2] [1 42 0]] -> [42 0]
243−
244−It's also fun to build nouns in which every atom is its own axis:
245−
246− 1
247− [2 3]
248− [2 6 7]
249− [[4 5] 6 7]
250− [[4 5] 6 14 15]
251− [[4 5] [12 13] 14 15]
252− [[4 [10 11]] [12 13] 14 15]
253− [[[8 9] [10 11]] [12 13] 14 30 31]
254−
255−------------------------------------------------------------------------
256−
257−Distribution
258−------------
259−
260− 23 :: *[a [b c] d] [*[a b c] *[a d]]
261−
262−The practical domain of the Nock function is always a **cell**. When `a`
263−is an **atom**, `*a`, or `nock(a)`, is always an error. Conventionally,
264−Nock proper is always a function of a **cell**. The **head** of this
265−**cell** is the **subject**, the **tail** is the **formula**
266−
267− [subject formula]
268−
269−and the result of passing a **noun** through the Nock function is called
270−the **product**.
271−
272− nock([subject formula]) => product
273−
274−or
275−
276− *[subject formula] => product
277−
278−The **subject** is your data and the **formula** is your code. And the
279−**product** is your code's output.
280−
281−Notice that `a` in the Nock rules is always the **subject**, except line
282−39, which is a crash default for malformed **nouns** that do not
283−evaluate.
284−
285−A **formula** is always a **cell**. But when we look inside that
286−**cell**, we see two basic kinds of **formulas**:
287−
288− [operator operands]
289− [formula-x formula-y]
290−
291−An **operator** is always an **atom** (`0` through `10`). A **formula**
292−is always a **cell**. Line 23 distinguishes these forms:
293−
294− 23 :: *[a [b c] d] [*[a b c] *[a d]]
295−
296−If your code contains multiple **formulas**, the **subject** will
297−distribute over those **formulas**.
298−
299−In other words, if you have two Nock **formulas** `x` and `y`, a
300−**formula** that computes the pair of them is just the **cell** `[x y]`.
301−
302− *[subject [x y]] -> [*[subject x] *[subject y]]
303−
304−No **atom** is a valid **formula**, and every **formula** that does not
305−use line 23 has an atomic **head**.
306−
307−Suppose you have two **formulas** `f` and `g`, each of which computes
308−some function of the **subject** `s`. You can then construct the
309−**formula** `h` as `[f g]`; and `h(s) = [f(s) g(s)]`.
310−
311−For example:
312−
313− *[[19 42] [0 3] 0 2]
314−
315−The **subject** `s` is `[19 42]`. The **formula** `h` is `[[0 3] 0 2]`.
316−
317− *[s h]
318−
319−The **head** of `h` is `f`, which is `[0 3]`. The **tail** of `h` is
320−`g`, which is `[0 2]`.
321−
322− *[s [f g]]
323−
324−by the distribution rule, `*[s [f g]]` is
325−
326− [*[s f] *[s g]]
327−
328−or
329−
330− [*[[19 42] [0 3]] *[[19 42] 0 2]]
331−
332−`*[s f]` is `f(s)` and produces `42`. `*[s g]` is `g(s)` and produces
333−19.
334−
335−Since `h(s)` is `[f(s) g(s)]`, `h(s)` is `[42 19]`:
336−
337− *[[19 42] [0 3] 0 2] -> [42 19]
338−
339−------------------------------------------------------------------------
340−
341−Operator 0: Axis
342−----------------
343−
344− 25 :: *[a 0 b] /[b a]
345−
346−Operator 0 is Nock's tree address or **axis** operator, using the tree
347−addressing structure defined in lines 16 through 20. `*[a 0 b]` simply
348−returns the value of the part of `a` at **axis** `b`. For any subject
349−`a`, the formula `[0 b]` produces `/[b a]`.
350−
351−For example,
352−
353− *[[19 42] 0 3] -> /[3 19 42] -> 42.
354−
355−------------------------------------------------------------------------
356−
357−Operator 1: Just
358−----------------
359−
360− 26 :: *[a 1 b] b
361−
362−`1` is the constant, or **Just operator**. It produces its operand `b`
363−without reference to the **subject**.
364−
365−For example,
366−
367− *[42 1 57] -> 57
368−
369−**Operator 1** is named **Just** because it produces "just" its operand.
370−
371−------------------------------------------------------------------------
372−
373−Operator 2: Fire
374−----------------
375−
376− 27 :: *[a 2 b c] *[*[a b] *[a c]]
377−
378−**Operator 2** is the **Fire operator**, which brings us the essential
379−magic of recursion. Given the **formula** `[2 b c]`, `b` is a
380−**formula** for generating a new **subject**; `c` is a **formula** for
381−generating a new **formula**. To compute `*[a 2 b c]`, we evaluate both
382−`b` and `c` against the current **subject** `a`.
383−
384−A common use of **Fire** is to evaluate data inside the **subject** as
385−code.
386−
387−For example:
388−
389− *[[[40 43] [4 0 1]] [2 [0 4] [0 3]]] -> 41
390−
391− *[[[40 43] [4 0 1]] [2 [0 5] [0 3]]] -> 44
392−
393−**Operator 2** is called **Fire** because it "fires" Nock **formulas**
394−at its (possibly modified) **subject**.
395−
396−------------------------------------------------------------------------
397−
398−Operator 3: Depth
399−-----------------
400−
401− 28 :: *[a 3 b] ?*[a b]
402−
403−**Operator 3** applies the **Cell-test** function defined in lines 8 and
404−9 to the product of `*[a b]`.
405−
406−**Operator 3** is called **Depth** because it tests the "depth" of a
407−noun. **Cell-test** properly refers to the pseudocode function `?`.
408−
409−------------------------------------------------------------------------
410−
411−Operator 4: Bump
412−----------------
413−
414− 29 :: *[a 4 b] +*[a b]
415−
416−**Operator 4** applies the **Increment** function defined in lines 10
417−and 11 to the product of `*[a b]`.
418−
419−**Operator 4** is called **Bump** because it "bumps" the atomic product
420−`*[a b]` up by 1. **Increment** properly refers to the pseudocode
421−function `+`.
422−
423−------------------------------------------------------------------------
424−
425−Operator 5: Same
426−----------------
427−
428− 30 :: *[a 5 b] =*[a b]
429−
430−**Operator 5** applies the Equals function defined in lines 12, 13 and
431−14 to the product of \*[a b].
432−
433−**Operator 5** is called the **Same** operator, because it tests if the
434−head and tail of the product of `*[a b]` are the same. "Equals" properly
435−refers to the pseudocode function "=".
436−
437−------------------------------------------------------------------------
438−
439−Operator 6: If
440−--------------
441−
442− 32 :: *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
443−
444−**Operator 6** is a primitive known to every programmer - **If**. Its
445−operands, a **test formula** `b`, a **then formula** `c` and an **else
446−formula** `d`.
447−
448−If the **test** `b` applied to the **subject** evaluates to `0` ("yes"),
449−
450− *[a b] -> 0
451−
452−then **If** produces the result of `c`, the **then formula**, applied to
453−the **subject**,
454−
455− *[a c]
456−
457−Else, if applying the **test** to the **subject** produces `1` ("no"),
458−
459− *[a b] -> 1
460−
461−**Operator 6** produces the result of `d`, the **else formula**, applied
462−to the **subject**,
463−
464− *[a d]
465−
466−If `*[a b]` produces any value other than `0` ("yes") or `1` ("no"),
467−**If** crashes.
468−
469−Let's examine the internals of **Operator 6**:
470−
471−**If** could have been defined as a built-in pseudocode function, like
472−**Increment**:
473−
474− :: $[0 b c] b
475− :: $[1 b c] c
476−
477−Then **Operator 6** could have been restated quite compactly:
478−
479− :: *[a 6 b c d] *[a $[*[a b] c d]]
480−
481−However, this is unnecessary complexity. **If** can be written as a
482−macro using the primitive operators:
483−
484− 32 :: *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
485−
486−Reducing the right-hand side (an excellent exercise for the reader)
487−produces:
488−
489− *[a *[[c d] [0 *[[2 3] [0 ++*[a b]]]]]]
490−
491−Which is the reduced pseudocode form of **Operator 6**.
492−
493−Additionally, we could simplify the semantics of **If**, at the expense
494−of breaking the system, by creating a macro that works as if and only if
495−`*[a b]` produces either `0` or `1`.
496−
497−This simpler **If** would be:
498−
499− :: *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] [4 4 b]]
500−
501−which reduces to:
502−
503− *[a *[[c d] [0 ++*[a b]]]]
504−
505−Let's examine the internals of this macro with a test example:
506−
507− *[[40 43] [6 [3 0 1] [4 0 2] [4 0 1]]]
508−
509−Fitting this to the reduced form:
510−
511− *[[40 43] *[[4 0 2] [4 0 3]] [0 ++*[[40 43] [3 0 1]]]]]
512−
513−Our test:
514−
515− *[[40 43] [3 0 1]]
516−
517−produces a 0,
518−
519− *[[40 43] *[[[4 0 2] [4 0 3]] [0 ++0]]]]
520−
521−which gets incremented twice
522−
523− *[[40 43] *[[[4 0 2] [4 0 3]] [0 2]]]
524−
525−and is used as an axis to select the head of [[4 0 2] [4 0 3]]
526−
527− *[[40 43] [4 0 2]]
528−
529−which increments `40` to produce `41`. Had the **test** produced a "no"
530−instead of a "yes", **If** would have incremented the **tail** of the
531−subject instead of the **head**.
532−
533−The real **If** is only slightly more complicated:
534−
535− :: *[a 6 b c d] *[a *[[c d] [0 *[[2 3] [0 ++*[a b]]]]]]
536−
537−There is an extra step in the real **If** to prevent unexpected
538−behaviour if the test produces a value other than 0 ("yes") or 1 ("no").
539−The real **If** will crash if this happens and the naive **If** may not
540−(the reader will find it a useful exercise to figure out why).
541−
542−It's worth noting that practical, compiler-generated Nock never does
543−anything as funky as these **Operator 6** macro internals.
544−
545−------------------------------------------------------------------------
546−
547−Operator 7: Compose
548−-------------------
549−
550− 33 :: *[a 7 b c] *[a 2 b 1 c]
551−
552−**Operator 7** implements function composition. To use a bit of math
553−notation, if we define the formula `[7 b c]` as a function `d(x)`:
554−
555− d(a) == c(b(a))
556−
557−This is apparent from the reduced pseudocode form of **Operator 7**:
558−
559− *[*[a b] c]
560−
561−As an example,
562−
563− *[[42 44] [7 [4 0 3] [3 0 1]]] -> 1
564−
565−The above sequentially applies the **formulas** `[4 0 3]` and `[3 0 1]`
566−to our subject `[42 44]`, first incrementing the **head**, then testing
567−the **depth**.
568−
569−------------------------------------------------------------------------
570−
571−Operator 8: Push
572−----------------
573−
574− 34 :: *[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
575−
576−**Operator 8** pushes a new **noun** onto our **subject**, not at all
577−unlike pushing a new variable onto the stack.
578−
579−The internals of **Operator 8** are similar to **Operator 7**, except
580−that the **subject** for `c` is not simply the **product** of `b`, but
581−the ordered pair of the **product** of `b` and the original **subject**.
582−
583−This is apparent from the reduced pseudocode form of **Operator 8**:
584−
585− *[[*[a b] a] c]
586−
587−**Operator 8** evaluates the **formula** `c` with the **cell** of
588−`*[a b]` and the original **subject** `a`. In math notation, if we
589−define `[8 b c]` as `d(x)`:
590−
591− d(a) == c([b(a) a])
592−
593−Suppose, for the purposes of the **formula** `c`, we need not just the
594−**subject** `a`, but some intermediate **noun** computed from the
595−**subject** that will be useful in the calculation of `c`. **Operator
596−8** applies **formula** `c` to a new **subject** that is the pair of the
597−intermediate value and the old **subject**.
598−
599−In higher-level languages that compile to Nock, variable declarations
600−are likely to generate an **Operator 8**, because the variable is
601−computed against the present **subject**, and used in a calculation
602−which depends both on the original **subject** and the new variable.
603−
604−------------------------------------------------------------------------
605−
606−Op 9: Call
607−----------
608−
609− 35 :: *[a 9 b c] *[a 7 c 2 [0 1] 0 b]
610−
611−**Operator 9** is the **Call** operator and is used for calling and
612−applying **formulas** inside **noun** structures called **cores**
613−
614−A **noun** can contain both data and code. By convention, all
615−interesting flow control in Nock is done with **cores**, which are
616−**cells** whose head is code (containing one or more **formulas**) and
617−whose **tail** is data (possibly containing other **cores**):
618−
619−[code data]
620−
621−All flow structures in other languages not built on Nock correspond to
622−**cores**. Functions and/or closures are **cores**, objects are
623−**cores**, modules are **cores**, even loops are **cores** (Nock, of
624−course, does not have a loop operator).
625−
626−The head of a **core** is called the **battery** and the tail is called
627−the **payload**:
628−
629− [battery payload]
630−
631−The **payload** of a core is any useful data needed for computation.
632−
633−The **battery** of a **core** is a **noun** containing one or more
634−**arms**, which are **formulas** whose **subject** is the entire
635−**core**.
636−
637−For example, in the case of the **battery** containing three **arms**:
638−
639− [arm1 [arm2 arm3]]
640−
641−Where `arm1` is at **axis** `/2` in the **battery**, `arm2` is at `/6`,
642−and `arm3` is at `/7`. The **axes** will differ depending on the number
643−of **arms**.
644−
645−Of course, because the **subject** of an **arm** is the entire **core**,
646−an **arm** can invoke itself (or any other **arm** in the **battery**).
647−Hence, it can loop. And this is what a loop is - the simplest of
648−**cores**.
649−
650−Also, by convention, we have terms for different kinds of **cores**,
651−depending on their structure:
652−
653−A **trap** is a **core** whose battery contains a single **arm**. By
654−convention, this arm is called `$` (pronounced 'buc'), which is the
655−empty-name. All **traps** have the following structure:
656−
657− [$ payload]
658−
659−A **door** is a **core** with a **payload** of the form
660−`[sample context]`. The **sample** is dynamic data (such as the
661−arguments of a function) and the **context** is any data that might be
662−useful (such as other **cores**, variables, or the entire kernel of your
663−OS). All **doors** have the following structure:
664−
665− [battery [sample context]]
666−
667−A **gate** is a **core** that is both a **door** and a **trap**.
668−**Gates** are the Nock equivalent of lambdas or functions. All **gates**
669−have the structure:
670−
671− [$ [sample context]]
672−
673−**Operator 9** constructs a **core** and activates it by calling one of
674−its **arms**.
675−
676−Looking reduced pseudocode form of **Call**:
677−
678− *[*[a c] *[*[a c] 0 b]]
679−
680−**Call** applies a **formula** `c` to the **subject** `a`, where
681−`*[a c]` produces a **core**. **Call** then calls an **arm** `b` of the
682−**core** produced by `*[a c]` and reflexively applies it to the same
683−**core**.
684−
685−------------------------------------------------------------------------
686−
687−Op 10: Hint
688−-----------
689−
690− 36 :: *[a 10 [b c] d] *[a 8 c 7 [0 3] d]
691− 37 :: *[a 10 b c] *[a c]
692−
693−**Operator 10** serves a hint to the interpreter.
694−
695−If `b` is an atom and `c` is a **formula**, the **formula** `[10 b c]`
696−appears to be equivalent to `c`. Likewise if `[b c]` is a **cell**,
697−`[10 [b c] d]` appears to be equivalent to `d`. **Operator 10** is
698−actually a hint operator. The `b` or `[b c]`is discarded information -
699−it is not used, formally, in the computation. It may help the
700−interpreter compute the expression more efficiently, however.
701−
702−Every Nock computes the same result - but not all at the same speed.
703−What hints are supported? What do they do? Hints are a higher-level
704−convention which do not, and should not, appear in the Nock spec. Some
705−are defined in Hoon. Indeed, a naive Nock interpreter not optimized for
706−Hoon will run Hoon quite poorly. When it gets the product, however, the
707−product will be right. (Why is the `c` in `[b c]` computed? Because `c`
708−could crash. A correct Nock cannot simply ignore it, and treat both
709−variants of `10` as equivalent.)
710−
711−------------------------------------------------------------------------
712−
713−Op 11: Retrieve
714−-----------
715−
716−**operator 11** retrieves data from the global namespace at the path it is given.
717−
718−nock 11 is an additional nock operation provided by arvo to provide access to the global namespace. It's provided by arvo, so even though it's not technically a part of the nock, any code that arvo runs has access to it. When nock running on top of arvo hits nock 11, it either produces a value or blocks. The most common usage is with clay, where ^(%cx /path/to/file) will produce the referred-to-file.
719−
720−Crash default
721−-------------
722−
723− 39 :: *a *a
724−
725−The nock function is defined for every **noun**, but on many **nouns**
726−it does nothing useful. For instance, if `a` is an **atom**, `*a`
727−reduces to... `*a`. In theory, this means that Nock spins forever in an
728−infinite loop. In other words, Nock produces no result - and in
729−practice, your interpreter will stop.
730−
731−Another way to see this is that Nock has "crash-only" semantics. There
732−is no exception mechanism. The only way to catch Nock errors is to
733−simulate Nock in a higher-level virtual Nock - which, in fact, we do all
734−the time. A simulator (or a practical low-level interpreter) can report,
735−out of band, that Nock would not terminate. It cannot recognize all
736−infinite loops, of course (cf. Halting problem), but it can recognize
737−common and obvious ones, which is usually sufficient in practice.
docs/programming/advanced/nock/tutorial.mddeleted−1044
@@ -1,1044 +0,0 @@
1−---
2−title: Nock tutorial
3−---
4−
5−# Nock tutorial
6−
7−So let's learn Nock! But wait - why learn Nock? After all,
8−we're going to be programming in Hoon, not Nock.
9−
10−Like JVM bytecode, Nock is as inscrutable as assembly language.
11−In fact, you can think of it as a sort of "functional assembly
12−language." There are sometimes reasons to program in real
13−assembly language. There is never a reason to program in Nock.
14−Except to learn Nock.
15−
16−Indeed, it is not necessary for the Hoon programmer to learn
17−Nock. We recommend it strongly, however, because Hoon has a very
18−special relationship with Nock - not unlike the relationship
19−between C and assembly language.
20−
21−Just as C is a very shallow layer over the raw CPU, Hoon is a
22−very shallow layer over raw Nock - often little more than a
23−macro. If you try to learn C without understanding the CPU under
24−it, you will be forever bemused by why it works the way it does.
25−
26−So let's learn Nock! But wait - which Nock? Nock, though more
27−frozen than Walt Disney, does have versions. Nock versions are
28−measured by integer degrees Kelvin, newer being colder. The
29−newest, Nock 5K - roughly the temperature of Neptune. No change
30−is anticipated between 5K and absolute zero, though you never
31−know. Any such change would certainly be quite painful.
32−
33−#1.1 Definition#
34−
35−The best way to learn Nock is to read the spec and write your own
36−naive interpreter. Here is Nock 5K:
37−
38−**1. Structures**
39−
40− A noun is an atom or a cell. An atom is a natural number.
41− A cell is an ordered pair of nouns.
42−
43−**2. Pseudocode**
44−
45− 1 :: nock(a) *a
46− 2 :: [a b c] [a [b c]]
47− 3 ::
48− 4 :: ?[a b] 0
49− 5 :: ?a 1
50− 6 :: +[a b] +[a b]
51− 7 :: +a 1 + a
52− 8 :: =[a a] 0
53− 9 :: =[a b] 1
54− 10 :: =a =a
55− 11 ::
56− 12 :: /[1 a] a
57− 13 :: /[2 [a b]] a
58− 14 :: /[3 [a b]] b
59− 15 :: /[(a + a) b] /[2 /[a b]]
60− 16 :: /[(a + a + 1) b] /[3 /[a b]]
61− 17 :: /a /a
62− 18 ::
63− 19 :: *[a [[b c] d]] [*[a [b c]] *[a d]]
64− 20 ::
65− 21 :: *[a [0 b]] /[b a]
66− 22 :: *[a [1 b]] b
67− 23 :: *[a [2 [b c]]] *[*[a b] *[a c]]
68− 24 :: *[a [3 b]] ?*[a b]
69− 25 :: *[a [4 b]] +*[a b]
70− 26 :: *[a [5 b]] =*[a b]
71− 27 ::
72− 28 :: *[a [6 [b [c d]]]] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
73− 29 :: *[a [7 [b c]]] *[a 2 b 1 c]
74− 30 :: *[a [8 [b c]]] *[a 7 [[7 [0 1] b] 0 1] c]
75− 31 :: *[a [9 [b c]]] *[a 7 c 2 [0 1] 0 b]
76− 32 :: *[a [10 [[b c] d]]] *[a 8 c 7 [0 3] d]
77− 33 :: *[a [10 [b c]]] *[a c]
78− 34 ::
79− 35 :: *a *a
80−
81−Your interpreter should be no more than a page of code in
82−any language. For extra credit, `6`-`10` are macros; implement
83−them directly. For extra extra credit, optimize tail calls.
84−To test your code, write a decrement formula b such that
85−`*[a b]` is `a - 1` for any atomic nonzero `a`.
86−
87−#1.2 Installation#
88−
89−The second best way to learn Nock is to boot up your own Arvo
90−virtual computer. See the Arvo tutorial for instructions.
91−
92−#1.3 Nock#
93−
94−To make Nock make sense, let's work through Nock 5K line by line.
95−First the data model:
96−
97−##1. Structures##
98−
99− A noun is an atom or a cell. An atom is any natural number.
100− A cell is any ordered pair of nouns.
101−
102−Nouns are the dumbest data model ever. Nouns make JSON look like
103−XML and XML look like ASN.1. It may also remind you of Lisp's
104−S-expressions - you can think of nouns as "S-expressions without
105−the S."
106−
107−To be exact, a noun _is_ an S-expression, except that classic
108−S-expressions have multiple atom types ("S" is for "symbol").
109−Since Nock is designed to be used with a higher-level type system
110−(such as Hoon's), it does not need low-level types. An atom is
111−just an unsigned integer of any size.
112−
113−For instance, it's common to represent strings (or even whole
114−text files) as atoms, arranging them LSB first - so "foo" becomes
115−`0x6f6f66`. How do we know to print this as "foo", not `0x6f6f66`?
116−We need external information - such as a Hoon type. Similarly,
117−other common atomic types - signed integers, floating point, etc
118−- are all straightforward to map into atoms.
119−
120−It's also important to note that, unlike Lisp, Nock cannot create
121−cyclical data structures. It is normal and common for nouns in a
122−Nock runtime system to have acyclic structure - shared subtrees.
123−But there is no Nock computation that can make a child point to
124−its parent. One consequence: Nock has no garbage collector.
125−(Nor can dag structure be detected, as with Lisp `eq`.)
126−
127−There is also no single syntax for nouns. If you have nouns you
128−have Nock; if you have Nock you have Hoon; if you have Hoon, you
129−can write whatever parser you like.
130−
131−Let's continue:
132−
133−##2. Pseudocode##
134−
135−It's important to recognize that the pseudocode of the Nock spec
136−is just that: pseudocode. It looks a little like Hoon. It isn't
137−Hoon - it's just pseudocode. Or in other words, just English.
138−At the bottom of every formal system is a system of axioms, which
139−can only be written in English. (Why pseudocode, not Hoon? Since
140−Hoon is defined in Nock, this would only give a false impression
141−of nonexistent precision.)
142−
143−The logic of this pseudocode is a pattern-matching reduction,
144−matching from the top down. To compute Nock, repeatedly reduce
145−with the first line that matches. Let's jump right in!
146−
147−##Line 1:##
148−
149− 1 :: nock(a) *a
150−
151−Nock is a pure (stateless) function from noun to noun. In our
152−pseudocode (and only in our pseudocode) we express this with the
153−prefix operator `*`.
154−
155−This function is defined for every noun, but on many nouns it
156−does nothing useful. For instance, if `a` is an atom, `*a`
157−reduces to... `*a`. In theory, this means that Nock spins
158−forever in an infinite loop. In other words, Nock produces no
159−result - and in practice, your interpreter will stop.
160−
161−(Another way to see this is that Nock has "crash-only" semantics.
162−There is no exception mechanism. The only way to catch Nock
163−errors is to simulate Nock in a higher-level virtual Nock -
164−which, in fact, we do all the time. A simulator (or a practical
165−low-level interpreter) can report, out of band, that Nock would
166−not terminate. It cannot recognize all infinite loops, of
167−course, but it can catch the obvious ones - like `*42`.)
168−
169−Normally `a` in `nock(a)` is a cell `[s f]`, or as we say
170−
171− [subject formula]
172−
173−Intuitively, the formula is your function and the subject is
174−its argument. We call them something different because Hoon,
175−or any other high-level language built on Nock, will build its
176−own function calling convention which *does not* map directly
177−to `*[subject formula]`.
178−
179−##Line 2:##
180−
181− 2 :: [a b c] [a [b c]]
182−
183−Ie, brackets (in our pseudocode, as in Hoon) associate to the
184−right. For those with Lisp experience, it's important to note
185−that Nock and Hoon use tuples or "improper lists" much more
186−heavily than Lisp. The list terminator, normally 0, is never
187−automatic. So the Lisp list
188−
189− (a b c)
190−
191−becomes the Nock noun
192−
193− [a b c 0]
194−
195−which is equivalent to
196−
197− [a [b [c 0]]]
198−
199−Note that we can and do use unnecessary brackets anyway, for
200−emphasis.
201−
202−Let's move on to the axiomatic functions.
203−
204−##Lines 4-10:##
205−
206− 4 :: ?[a b] 0
207− 5 :: ?a 1
208− 6 :: +[a b] +[a b]
209− 7 :: +a 1 + a
210− 8 :: =[a a] 0
211− 9 :: =[a b] 1
212−
213−Here we define more pseudocode operators, which we'll use in
214−reductions further down. So far we have four built-in functions:
215−`*` meaning Nock itself, `?` testing whether a noun is a cell or
216−an atom, `+` incrementing an atom, and `=` testing for equality.
217−Again, no rocket science here.
218−
219−We should note that in Nock and Hoon, `0` (pronounced "yes") is
220−true, and `1` ("no") is false. Why? It's fresh, it's different,
221−it's new. And it's annoying. And it keeps you on your toes.
222−And it's also just intuitively right.
223−
224−
225−##Lines 12-16:##
226−
227− 12 :: /[1 a] a
228− 13 :: /[2 a b] a
229− 14 :: /[3 a b] b
230− 15 :: /[(a + a) b] /[2 /[a b]]
231− 16 :: /[(a + a + 1) b] /[3 /[a b]]
232−
233−Slightly more interesting is our tree numbering. Every noun is of course a tree. The `/` operator - pronounced
234−"slot" - imposes an address space on that tree, mapping every
235−nonzero atom to a tree position.
236−
237−1 is the root. The head of every node `n` is `2n`; the tail is
238−`2n+1`. Thus a simple tree:
239−
240− 1
241− 2 3
242− 4 5 6 7
243− 14 15
244−
245−If the value of every leaf is its tree address, this tree is
246−
247− [[4 5] [6 14 15]]
248−
249−and, for some examples of addressing:
250−
251− /[1 [[4 5] [6 14 15]]]
252−
253−is `[[4 5] [6 14 15]]`
254−
255− /[2 [[4 5] [6 14 15]]]
256−
257−is `[4 5]`
258−
259− /[3 [[4 5] [6 14 15]]]
260−
261−is `[6 14 15]`, and
262−
263− /[7 [[4 5] [6 14 15]]]
264−
265−is `[14 15]`
266−
267−I do hope this isn't so terribly hard to follow.
268−
269−##Line 21:##
270−
271−Now we enter the definition of Nock itself - ie, the `*`
272−operator.
273−
274− 21 :: *[a 0 b] /[b a]
275−
276−`0` is simply Nock's tree-addressing operator. Let's try it out
277−from the Arvo command line.
278−
279−Note that we're using Hoon syntax here. Since we do not use Nock
280−from Hoon all that often (it's sort of like embedding assembly in
281−C), we've left it a little cumbersome. In Hoon, instead of
282−writing `*[a 0 b]`, we write
283−
284− .*(a [0 b])
285−
286−So, to reuse our slot example, let's try the interpreter:
287−
288− ~tasfyn-partyv> .*([[4 5] [6 14 15]] [0 7])
289−
290−gives, while the sky remains blue and the sun rises in the east:
291−
292− [14 15]
293−
294−Even stupider is line 21:
295−
296−##Line 21:##
297−
298− 21 :: *[a 1 b] b
299−
300−`1` is the constant operator. It produces its argument without
301−reference to the subject. So
302−
303− ~tasfyn-partyv> .*(42 [1 153 218])
304−
305−yields
306−
307− [153 218]
308−
309−
310−##Line 23:##
311−
312− 23 :: *[a 2 b c] *[*[a b] *[a c]]
313−
314−Line 22 brings us the essential magic of recursion.
315−`2` is the Nock operator. If you can compute a subject and a
316−formula, you can evaluate them in the interpreter. In most
317−fundamental languages, like Lisp, `eval` is a curiosity. But
318−Nock has no `apply` - so all our work gets done with `2`.
319−
320−Let's convert the previous example into a stupid use of `2`:
321−
322− ~tasfyn-partyv> .*(77 [2 [1 42] [1 1 153 218]])
323−
324−with a constant subject and a constant formula, gives the same
325−
326− [153 218]
327−
328−Like so:
329−
330− *[77 [2 [1 42] [1 1 153 218]]]
331−
332− 22 :: *[a 2 b c] *[*[a b] *[a c]]
333−
334− *[*[77 [1 42]] *[77 [1 1 153 218]]]
335−
336− 21 :: *[a 1 b] b
337−
338− *[42 *[77 [1 1 153 218]]]
339−
340− *[42 1 153 218]
341−
342− [153 218]
343−
344−##Lines 24-26:##
345−
346− 24 :: *[a 3 b] ?*[a b]
347− 25 :: *[a 4 b] +*[a b]
348− 26 :: *[a 5 b] =*[a b]
349−
350−In lines 23-25, we meet our axiomatic functions again:
351−
352−For instance, if `x` is a formula that calculates some product,
353−`[4 x]` calculates that product plus one. Hence:
354−
355− ~tasfyn-partyv> .*(57 [0 1])
356− 57
357−
358−and
359−
360− ~tasfyn-partyv> .*([132 19] [0 3])
361− 19
362−
363−and
364−
365− ~tasfyn-partyv> .*(57 [4 0 1])
366− 58
367−
368−and
369−
370− ~tasfyn-partyv> .*([132 19] [4 0 3])
371− 20
372−
373−If this seems obvious, you're doin' good. Finally, we jump back up
374−to line 18, the trickiest in the spec:
375−
376−##Line 19:##
377−
378− 19 :: *[a [b c] d] [*[a b c] *[a d]]
379−
380−Um, what?
381−
382−Since Nock of an atom just crashes, the practical domain of the
383−Nock function is always a cell. Conventionally, the head of this
384−cell is the "subject," the tail is the "formula," and the result
385−of Nocking it is the "product." Basically, the subject is your
386−data and the formula is your code.
387−
388−We could write line 19 less formally:
389−
390− *[subject [formula-x formula-y]]
391− => [*[subject formula-x] *[subject formula-y]]
392−
393−In other words, if you have two Nock formulas `x` and `y`, a
394−formula that computes the pair of them is just `[x y]`. We can
395−recognize this because no atom is a valid formula, and
396−every formula that _does not_ use line 19 has an atomic head.
397−
398−If you know Lisp, you can think of this feature as a sort of
399−"implicit cons." Where in Lisp you would write `(cons x y)`,
400−in Nock you write `[x y]`.
401−
402−For example,
403−
404− ~tasfyn-partyv> .*(42 [4 0 1])
405−
406−where `42` is the subject (data) and `[4 0 1]` is the formula
407−(code), happens to evaluate to `43`. Whereas
408−
409− ~tasfyn-partyv> .*(42 [3 0 1])
410−
411−is `1`. So if we evaluate
412−
413− ~tasfyn-partyv> .*(42 [[4 0 1] [3 0 1]])
414−
415−we get
416−
417− [43 1]
418−
419−Except for the crash defaults (lines 6, 10, 17, and 35), we've actually
420−completed all the _essential_ aspects of Nock. The operators up
421−through 5 provide all necessary computational functionality.
422−Nock, though very simple, is actually much more complex than it
423−formally needs to be.
424−
425−Operators 6 through 10 are macros. They exist because Nock is
426−not a toy, but a practical interpreter. Let's see them all
427−together:
428−
429−##Lines 28-33:##
430−
431− 28 :: *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
432− 29 :: *[a 7 b c] *[a 2 b 1 c]
433− 30 :: *[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
434− 31 :: *[a 9 b c] *[a 7 c 2 [0 1] 0 b]
435− 32 :: *[a 10 [b c] d] *[a 8 c 7 [0 3] d]
436− 33 :: *[a 10 b c] *[a c]
437−
438−Whoa! Have we entered rocket-science territory? Let's try to
439−figure out what these strange formulas do - simplest first.
440−The simplest is clearly line 33:
441−
442− 33 :: *[a 10 b c] *[a c]
443−
444−If `x` is an atom and `y` is a formula, the formula `[10 x y]`
445−appears to be equivalent to... `y`. For instance:
446−
447− ~tasfyn-partyv> .*([132 19] [10 37 [4 0 3]])
448− 20
449−
450−Why would we want to do this? `10` is actually a hint operator.
451−The `37` in this example is discarded information - it is not
452−used, formally, in the computation. It may help the interpreter
453−compute the expression more efficiently, however.
454−
455−Every Nock computes the same result - but not all at the same
456−speed. What hints are supported? What do they do? Hints are a
457−higher-level convention which do not, and should not, appear in
458−the Nock spec. Some are defined in Hoon. Indeed, a naive Nock
459−interpreter not optimized for Hoon will run Hoon quite poorly.
460−When it gets the product, however, the product will be right.
461−
462−There is another reduction for hints - line 32:
463−
464− 32 :: *[a 10 [b c] d] *[a 8 c 7 [0 3] d]
465−
466−Once we see what `7` and `8` do, we'll see that this complex hint
467−throws away an arbitrary `b`, but computes the formula `c`
468−against the subject and... throws away the product. This formula
469−is simply equivalent to `d`. Of course, in practice the product
470−of `c` will be put to some sordid and useful use. It could even
471−wind up as a side effect, though we try not to get _that_ sordid.
472−
473−(Why do we even care that `c` is computed? Because `c` could
474−crash. A correct Nock cannot simply ignore it, and treat both
475−variants of `10` as equivalent.)
476−
477−We move on to the next simplest operator, `7`. Line 29:
478−
479− 29 :: *[a 7 b c] *[a 2 b 1 c]
480−
481−Suppose we have two formulas, `b` and `c`. What is the formula
482−`[7 b c]`? This example will show you:
483−
484− ~tasfyn-partyv> .*(42 [7 [4 0 1] [4 0 1]])
485− 44
486−
487−`7` is an old mathematical friend, function composition. It's
488−easy to see how this is built out of `2`. The data to evaluate
489−is simply `b`, and the formula is `c` quoted.
490−
491−Line 30 looks very similar:
492−
493− 30 :: *[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
494−
495−Indeed, `8` is `7`, except that the subject for `c` is not simply
496−the product of `b`, but the ordered pair of the product of `b`
497−and the original subject. Hence:
498−
499− ~tasfyn-partyv> .*(42 [8 [4 0 1] [0 1]])
500− [43 42]
501−
502−and
503−
504− ~tasfyn-partyv> .*(42 [8 [4 0 1] [4 0 3]])
505− 43
506−
507−Why would we want to do this? Imagine a higher-level language
508−in which the programmer declares a variable. This language is
509−likely to generate an `8`, because the variable is computed
510−against the present subject, and used in a calculation which
511−depends both on the original subject and the new variable.
512−
513−For extra credit, explain why we can't just define
514−
515− *[a 8 b c] *[a 7 [b 0 1] c]
516−
517−Another simple macro is line 31:
518−
519− 31 :: *[a 9 b c] *[a 7 c 2 [0 1] 0 b]
520−
521−`9` is a calling convention. With `c`, we produce a noun which
522−contains both code and data - a _core_. We use this core as the
523−subject, and apply the formula within it at slot `b`.
524−
525−And finally, we come to the piece de resistance - line 28:
526−
527− 28 :: *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
528−
529−Great giblets! WTF is this doing? It seems we've finally
530−arrived at some real rocket science.
531−
532−Actually, `6` is a primitive known to every programmer - good old
533−"if." If `b` evaluates to `0`, we produce `c`; if `b` evaluates
534−to `1`, we produce `d`; otherwise, we crash.
535−
536−For instance:
537−
538− ~tasfyn-partyv> .*(42 [6 [1 0] [4 0 1] [1 233]])
539− 43
540−
541−and
542−
543− ~tasfyn-partyv> .*(42 [6 [1 1] [4 0 1] [1 233]])
544− 233
545−
546−In real life, of course, the Nock implementor knows that `6` is
547−"if" and implements it as such. There is no practical sense in
548−reducing through this macro, or any of the others. We could have
549−defined "if" as a built-in function, like increment - except that
550−we can write "if" as a macro. If a funky macro.
551−
552−It's a good exercise, however, to peek inside the funk.
553−
554−We can actually simplify the semantics of `6`, at the expense of
555−breaking the system a little, by creating a macro that works as
556−"if" only if `b` is a proper boolean and produces `0` or `1`.
557−Perhaps we have a higher-level type system which checks this.
558−
559−This simpler "if" would be:
560−
561− *[a 6 b c d] *[a [2 [0 1] [2 [1 c d] [[1 0] [4 4 b]]]]]
562−
563−Or without so many unnecessary brackets:
564−
565− *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] [4 4 b]]
566−
567−How does this work? We've replaced `[6 b c d]` with the formula
568−`[2 [0 1] [2 [1 c d] [[1 0] [4 4 b]]]]`. We see two uses of `2`,
569−our evaluation operator - an outer and an inner.
570−
571−Call the inner one `i`. So we have `[2 [0 1] i]`. Which means
572−that, to calculate our product, we use `[0 1]` - that is, the
573−original subject - as the subject; and the product of `i` as
574−the formula.
575−
576−Okay, cool. So `i` is `[2 [1 c d] [[1 0] [4 4 b]]]`. We compute
577−Nock with subject `[1 c d]`, formula `[[1 0] [4 4 b]]`.
578−
579−Obviously, `[1 c d]` produces just `[c d]` - that is, the ordered
580−pair of the "then" and "else" formulas. `[[1 0] [4 4 b]]` is a
581−line 19 cell - its head is `[1 0]`, producing just `0`, its tail
582−`[4 4 b]`, producing... what? Well, if `[4 b]` is `b` plus `1`,
583−`[4 4 b]` is `b` plus `2`.
584−
585−We're assuming that `b` produces either `0` or `1`. So `[4 4 b]`
586−yields either `2` or `3`. `[[1 0] [4 4 b]]` is either `[0 2]` or
587−`[0 3]`. Applied to the subject `[c d]`, this gives us either
588−`c` or `d` - the product of our inner evaluation `i`. This is
589−applied to the original subject, and the result is "if."
590−
591−But we need the full power of the funk, because if `b` produces,
592−say, `7`, all kinds of weirdness will result. We'd really like
593−`6` to just crash if the test product is not a boolean. How can
594−we accomplish this? This is an excellent way to prove to
595−yourself that you understand Nock: figure out what the real `6`
596−does. Or you could just agree that `6` is "if," and move on.
597−
598−(It's worth noting that in practical, compiler-generated Nock, we
599−never do anything as funky as these `6` macro internals. There's
600−no reason we couldn't build formulas at runtime, but we have no
601−reason to and we don't - except when actually metaprogramming.
602−As in most languages, normally code is code and data is data.)
603−
604−#1.4 Decrement in Nock#
605−
606−A good practice exercise for Nock is a decrement formula. Ie, a
607−formula `f` which implements the partial function that produces
608−`(s - 1)` if `s` is a nonzero atom, and otherwise does not
609−terminate.
610−
611−The normal Hoon programmer has written one Nock formula: this
612−one. Since decrement uses all the Nock techniques the Hoon
613−compiler uses, the exercise is a good foundation. After you
614−write decrement (or just follow this example), you'll never need
615−to deal with Nock again.
616−
617−As we know, the equivalent formula for increment is
618−
619− [4 0 1]
620−
621−Thus:
622−
623− ~>tasfyn-partyv .*(42 [4 0 1])
624− 43
625−
626−Of course, increment is built into Nock. So, ha, that's easy.
627−
628−How do we decrement? A good way to start is to gaze fondly on
629−how we'd do it if we actually had a real language, ie, Hoon.
630−Here is a minimal decrement in Hoon:
631−
632− => a=. :: line 1
633− =+ b=0 :: line 2
634− |- :: line 3
635− ?: =(a +(b)) :: line 4
636− b :: line 5
637− $(b +(b)) :: line 6
638−
639−Or for fun, on one line:
640−
641− =>(a=. =+(b=0 |-(?:(=(a +(b)) b $(b +(b))))))
642−
643−Does Hoon actually work?
644−
645− ~tasfyn-partyv> =>(42 =>(a=. =+(b=0 |-(?:(=(a +(b)) b $(b +(b)))))))
646− 41
647−
648−Let's translate this into English. How do we decrement the
649−subject? First (line 1), we rename the subject `a`. Second
650−(line 2), we add a variable, `b`, an atom with value `0`.
651−Third (line 3), we loop. Fourth, we test if `a` equals `b` plus
652−1 (line 4), produce `b` if it does (line 5), repeat the loop with
653−`b` set to `b` plus 1 (line 6) if it doesn't. Obviously, while
654−the syntax is unusual, the algorithm is anything but deep. We
655−are calculating `b` minus one by counting up from `0`.
656−
657−(Obviously, this is an O(n) algorithm. Is there a better way?
658−There is not. Do we actually do this in practice? Yes and no.)
659−
660−Unfortunately we are missing a third of our Rosetta stone. We
661−have decrement in Hoon and we have it in English. How do we
662−express this in Nock? What will the Hoon compiler generate from
663−the code above? Let's work through it line by line.
664−
665−Nock has no types, variable names, etc. So line 1 is a no-op.
666−
667−How do we add a variable (line 2)? We compute a new subject,
668−which is a cell of the present subject and the variable. With
669−this new subject, we execute another formula.
670−
671−Since `0` is a constant, a formula that produces it is
672−
673− [1 0]
674−
675−To combine `0` with the subject, we compute
676−
677− [[1 0] [0 1]]
678−
679−which, if our subject is 42, gives us
680−
681− [0 42]
682−
683−which we can use as the subject for an inner formula, `g`.
684−Composing our new variable with `g`, we have `f` as
685−
686− [2 [[1 0] [0 1]] [1 g]]
687−
688−which seems a little funky for something so simple. But we
689−can simplify it with the composition macro, `7`:
690−
691− [7 [[1 0] [0 1]] g]
692−
693−and still further with the augmentation macro, `8`:
694−
695− [8 [1 0] g]
696−
697−If you refer back to the Nock definition, you'll see that all
698−these formulas are semantically equivalent.
699−
700−Let's continue with our decrement. So what's `g`? We seem to
701−loop. Does Nock have a loop operator? It most certainly does
702−not. So what do we do?
703−
704−We build a noun called a _core_ - a construct which is behind any
705−kind of interesting control flow in Hoon. Of course, the Nock
706−programmer is not constrained to use the same techniques as the
707−Hoon compiler, but it is probably a good idea.
708−
709−In Hoon, all the flow structures from your old life as an Earth
710−programmer become cores. Functions and/or closures are cores,
711−objects are cores modules are cores, even loops are cores.
712−
713−The core is just a cell whose tail is data (possibly containing
714−other cores) and whose head is code (containing one or more
715−formulas). The tail is the _payload_ and the head is the
716−_battery_. Hence your core is
717−
718− [bat pay]
719−
720−To activate a core, pick a formula out of the battery, and use
721−the entire core (_not_ just the payload) as the subject.
722−
723−(A core formula is called an _arm_. An arm is almost like an
724−object-oriented method, but not quite - a method would be an arm
725−that produces a function on an argument. The arm is just a
726−function of the core, ie, a computed attribute.)
727−
728−Of course, because we feed it the entire core, our arm can
729−invoke itself (or any other formula in the battery). Hence, it
730−can loop. And this is what a loop is - the simplest of cores.
731−
732−We need to do two things with this core: create it, and activate
733−it. To be precise, we need two formulas: a formula which
734−produces the core, and one which activates its subject. We can
735−compose these functions with the handy `7` operator:
736−
737− [8 [1 0] [7 p a]]
738−
739−`p` produces our core, `a` activates it. Let's take these in
740−reverse order. How do we activate a core?
741−
742−Since we have only one formula, it's the battery itself.
743−Thus we want to execute Nock with the whole core (already the
744−subject, and the entire battery (slot `2`). Hence, `a` is
745−
746− [2 [0 1] [0 2]]
747−
748−We could also use the handy `9` macro - which almost seems
749−designed for firing arms on cores:
750−
751− [9 2 [0 1]]
752−
753−Which leaves us seeking
754−
755− [8 [1 0] [7 p [9 2 0 1]]]
756−
757−And all we have to do is build the core, `p`. How do we build a
758−core? We add code to the subject, just as we added a variable
759−above. The initial value of our counter was a constant, `0`.
760−The initial (and permanent) value of our battery is a constant,
761−the loop formula `l`. So `p` is
762−
763− [8 [1 l] [0 1]]
764−
765−Which would leave us seeking
766−
767− [8 [1 0] [7 [8 [1 l] [0 1]] [9 2 0 1]]]
768−
769−except that we have duplicated the `8` pattern again, since we
770−know
771−
772− [7 [8 [1 l] [0 1]] [9 2 0 1]]
773−
774−is equivalent to
775−
776− [8 [1 l] [9 2 0 1]]
777−
778−so the full value of `f` is
779−
780− [8 [1 0] [8 [1 l] [9 2 0 1]]]
781−
782−Thus our only formula to compose is the loop body, `l`.
783−Its subject is the loop core:
784−
785− [bat pay]
786−
787−where `bat` is just the loop formula, and `pay` is the pair `[a
788−b]`, `a` being the input subject, and `b` the counter. Thus we
789−could also write this subject as
790−
791− [l b a]
792−
793−and we see readily that `a` is at slot `7`, `b` `6`, `l` `2`.
794−With this subject, we need to express the Hoon loop body
795−
796− ?: =(a +(b)) :: line 4
797− b :: line 5
798− $(b +(b)) :: line 6
799−
800−This is obviously an if statement, and it calls for `6`. Ie:
801−
802− [6 t y n]
803−
804−Giving our decrement program as:
805−
806− [8 [1 0] [8 [1 6 t y n] [9 2 0 1]]]
807−
808−For `t`, how do we compute a flag that is yes (`0`) if `a` equals
809−`b` plus one? Equals, we recall, is `5`. So `t` can only be
810−
811− [5 [0 7] [4 0 6]]
812−
813−If so, our product `y` is just the counter `b`:
814−
815− [0 6]
816−
817−And if not? We have to re-execute the loop with the counter
818−incremented. If we were executing it with the same counter,
819−obviously an infinite loop, we could use the same core:
820−
821− [9 2 0 1]
822−
823−But instead we need to construct a new core with the counter
824−incremented:
825−
826− [l +(b) a]
827−
828−ie,
829−
830− [[0 2] [4 0 6] [0 7]]
831−
832−and `n` is:
833−
834− [9 2 [[0 2] [4 0 6] [0 7]]]
835−
836−Hence our complete decrement. Let's reformat vertically so we
837−can actually read it:
838−
839− [8
840− [1 0]
841− [ 8
842− [ 1
843− [ 6
844− t
845− y
846− n
847− ]
848− ]
849− [9 2 0 1]
850− ]
851− ]
852−
853−which becomes
854−
855− [8
856− [1 0]
857− [ 8
858− [ 1
859− [ 6
860− [5 [0 7] [4 0 6]]
861− [0 6]
862− [9 2 [[0 2] [4 0 6] [0 7]]]
863− ]
864− ]
865− [9 2 0 1]
866− ]
867− ]
868−
869−or, on one line without superfluous brackets:
870−
871− [8 [1 0] 8 [1 6 [5 [0 7] 4 0 6] [0 6] 9 2 [0 2] [4 0 6] 0 7] 9 2 0 1]
872−
873−which works for the important special case, 42:
874−
875− ~tasfyn-partyv> .*(42 [8 [1 0] 8 [1 6 [5 [0 7] 4 0 6] [0 6] 9 2 [0 2] [4 0 6] 0 7] 9 2 0 1])
876− 41
877−
878−If you understood this, you understand Nock. At least in principle!
879−
880−If you want to play around more with Nock, the command line will
881−start getting unwieldy. Fortunately, the standard install
882−contains the above Nock decrement packaged as an Arvo app, which
883−you can edit and change if you'd like to get ambitious. Just run
884−
885− ~tasfyn-partyv> :toy/ndec 19
886− 18
887−
888−The file driving this is
889−
890− hub/$seat/toy/app/ndec.holw
891−
892−Edit this file, ignoring everything above the Nock formula, and
893−hit return in the console to see it update:
894−
895− ~tasfyn-partyv>
896− : ~tasfyn-partyv/toy/app/ndec/holw/
897−
898−If decrement seems fun - why not write add? I wrote a Nock adder
899−a long, long time ago. But I've forgotten where I put it. There
900−is absolutely no use in this exercise, except to prove to
901−yourself that you've mastered Nock.
902−
903−#Appendix A: Operator Reductions#
904−
905−##`6` Reduction:##
906−
907− 28 :: *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
908−
909− *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
910−
911− 23 :: *[a 2 b c] *[*[a b] *[a c]]
912−
913− *[*[a 0 1] *[a 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]]
914−
915− 21 :: *[a 0 b] /[b a]
916−
917− *[a *[a 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]]
918−
919− 23 :: *[a 2 b c] *[*[a b] *[a c]]
920−
921− *[a *[*[a [1 c d]] *[a [1 0] 2 [1 2 3] [1 0] 4 4 b]]]
922−
923− 22 :: *[a 1 b] b
924−
925− 19 :: *[a [b c] d] [*[a b c] *[a d]]
926−
927− *[a *[[c d] [*[a 1 0] *[a 2 [1 2 3] [1 0] 4 4 b]]]]
928−
929− 22 :: *[a 1 b] b
930−
931− *[a *[[c d] [0 *[a 2 [1 2 3] [1 0] 4 4 b]]]]
932−
933− 23 :: *[a 2 b c] *[*[a b] *[a c]]
934−
935− *[a *[[c d] [0 *[*[a [1 2 3]] *[a [1 0] 4 4 b]]]]]
936−
937− 22 :: *[a 1 b] b
938−
939− *[a *[[c d] [0 *[[2 3] *[a [1 0] 4 4 b]]]]]
940−
941− 19 :: *[a [b c] d] [*[a b c] *[a d]]
942−
943− *[a *[[c d] [0 *[[2 3] [*[a [1 0]] *[a 4 4 b]]]]]]
944−
945− 22 :: *[a 1 b] b
946−
947− *[a *[[c d] [0 *[[2 3] [0 *[a 4 4 b]]]]]]
948−
949− 25 :: *[a 4 b] +*[a b]
950−
951− *[a *[[c d] [0 *[[2 3] [0 ++*[a b]]]]]]
952−
953−**`6` Reduced:**
954−
955− 6r :: *[a 6 b c d] *[a *[[c d] [0 *[[2 3] [0 ++*[a b]]]]]]
956−
957−##`7` Reduction:##
958−
959− 29 :: *[a 7 b c] *[a 2 b 1 c]
960−
961− *[a 2 b 1 c]
962−
963− 23 :: *[a 2 b c] *[*[a b] *[a c]]
964−
965− *[*[a b] *[a 1 c]]
966−
967− 22: *[a 1 b] b
968−
969− *[*[a b] c]
970−
971−**`7` Reduced:**
972−
973− 7r :: *[a 7 b c] *[*[a b] c]
974−
975−##`8` Reduction:##
976−
977− 30 :: *[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
978−
979− *[a 7 [[7 [0 1] b] 0 1] c]
980−
981− 7r :: *[a 7 b c] *[*[a b] c]
982−
983− *[*[a [7 [0 1] b] 0 1]] c]
984−
985− 19 :: *[a [b c] d] [*[a b c] *[a d]]
986−
987− *[[*[a [7 [0 1] b]] *[a 0 1]] c]
988−
989− 21 :: *[a 0 b] /[b a]
990−
991− *[[*[a [7 [0 1] b]] /[1 a]] c]
992−
993− 12 :: /[1 a] a
994−
995− *[[*[a [7 [0 1] b]] a] c]
996−
997− 7r :: *[a 7 b c] *[*[a b] c]
998−
999− *[[*[*[a 0 1]] b] a] c]
1000−
1001−**`8` Reduced:**
1002−
1003− 8r :: *[a 8 b c] *[[*[a b] a] c]
1004−
1005−
1006−##`9` Reduction:##
1007−
1008− 31 :: *[a 9 b c] *[a 7 c [2 [0 1] [0 b]]]
1009−
1010− *[a 7 c [2 [0 1] [0 b]]]
1011−
1012− 7r :: *[a 7 b c] *[*[a b] c]
1013−
1014− *[*[a c] [2 [0 1] [0 b]]]
1015−
1016− 23 :: *[a 2 b c] *[*[a b] *[a c]]
1017−
1018− *[*[*[a c] [0 1]] *[*[a c] [0 b]]]
1019−
1020− 21 :: *[a 0 b] /[b a]
1021−
1022−**`9` Reduced:**
1023−
1024− 9r :: *[a 9 b c] *[*[a c] *[*[a c] 0 b]]
1025−
1026−
1027−##`10` Reduction:##
1028−
1029− *[a 10 [b c] d] *[a 8 c 7 [0 3] d]
1030−
1031− 8r :: *[a 8 b c] [[*[a b] a] c]
1032−
1033− *[[*[a c] a] 7 [0 2] d]
1034−
1035− 7r :: *[a 7 b c] *[*[a b] c]
1036−
1037− *[*[[*[a c] a] 0 3] d]
1038−
1039− 21 :: *[a 0 b] /[b a]
1040−
1041−**`10` reduced:**
1042−
1043− 10r :: *[a 10 [b c] d] *[a d]
1044−
docs/programming/arvo.mdnew file+10
@@ -0,0 +1,10 @@
1+---
2+sort: 3
3+title: Arvo
4+---
5+
6+## Arvo
7+
8+Arvo is the Urbit operating environment.
9+
10+<list src="."></list>
docs/programming/advanced/arvo/internals.md → docs/programming/arvo/internals.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/ames.md → docs/programming/arvo/internals/ames.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/ames/commentary.md → docs/programming/arvo/internals/ames/commentary.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/behn.md → docs/programming/arvo/internals/behn.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/clay.md → docs/programming/arvo/internals/clay.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/clay/architecture.md → docs/programming/arvo/internals/clay/architecture.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/clay/commentary.md → docs/programming/arvo/internals/clay/commentary.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/dill.md → docs/programming/arvo/internals/dill.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/eyre.md → docs/programming/arvo/internals/eyre.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/eyre/commentary.md → docs/programming/arvo/internals/eyre/commentary.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/ford.md → docs/programming/arvo/internals/ford.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/ford/commentary.md → docs/programming/arvo/internals/ford/commentary.mdrenamed

The content is the same.

docs/programming/advanced/arvo/internals/gall.md → docs/programming/arvo/internals/gall.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system.md → docs/programming/arvo/system.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/api.md → docs/programming/arvo/system/api.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/basic.md → docs/programming/arvo/system/basic.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/generators.md → docs/programming/arvo/system/generators.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/http.md → docs/programming/arvo/system/http.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/marks.md → docs/programming/arvo/system/marks.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/network.md → docs/programming/arvo/system/network.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/security-driver.md → docs/programming/arvo/system/security-driver.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/state.md → docs/programming/arvo/system/state.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/subject.md → docs/programming/arvo/system/subject.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/subscriptions.md → docs/programming/arvo/system/subscriptions.mdrenamed

The content is the same.

docs/programming/advanced/arvo/system/web-apps.md → docs/programming/arvo/system/web-apps.mdrenamed

The content is the same.

docs/programming/hoon.mdnew file+10
@@ -0,0 +1,10 @@
1+---
2+sort: 2
3+title: Hoon
4+---
5+
6+## Hoon
7+
8+Hoon is our programming language
9+
10+<list src="."></list>
docs/programming/advanced/catalog.md → docs/programming/hoon/catalog.mdrenamed

The content is the same.

docs/programming/advanced/catalog/bar-core.md → docs/programming/hoon/catalog/bar-core.mdrenamed

The content is the same.

docs/programming/advanced/catalog/bar-core/cab-door.md → docs/programming/hoon/catalog/bar-core/cab-door.mdrenamed

The content is the same.

docs/programming/advanced/catalog/bar-core/cen-core.md → docs/programming/hoon/catalog/bar-core/cen-core.mdrenamed

The content is the same.

docs/programming/advanced/catalog/bar-core/dot-trap.md → docs/programming/hoon/catalog/bar-core/dot-trap.mdrenamed

The content is the same.

docs/programming/advanced/catalog/bar-core/hep-loop.md → docs/programming/hoon/catalog/bar-core/hep-loop.mdrenamed

The content is the same.

docs/programming/advanced/catalog/bar-core/tar-gill.md → docs/programming/hoon/catalog/bar-core/tar-gill.mdrenamed

The content is the same.

docs/programming/advanced/catalog/bar-core/tis-gate.md → docs/programming/hoon/catalog/bar-core/tis-gate.mdrenamed

The content is the same.

docs/programming/advanced/catalog/buc-mold.md → docs/programming/hoon/catalog/buc-mold.mdrenamed

The content is the same.

docs/programming/advanced/catalog/buc-mold/cab-shoe.md → docs/programming/hoon/catalog/buc-mold/cab-shoe.mdrenamed

The content is the same.

docs/programming/advanced/catalog/buc-mold/cen-book.md → docs/programming/hoon/catalog/buc-mold/cen-book.mdrenamed

The content is the same.

docs/programming/advanced/catalog/buc-mold/col-bank.md → docs/programming/hoon/catalog/buc-mold/col-bank.mdrenamed

The content is the same.

docs/programming/advanced/catalog/buc-mold/hep-lamb.md → docs/programming/hoon/catalog/buc-mold/hep-lamb.mdrenamed

The content is the same.

docs/programming/advanced/catalog/buc-mold/ket-bush.md → docs/programming/hoon/catalog/buc-mold/ket-bush.mdrenamed

The content is the same.

docs/programming/advanced/catalog/buc-mold/pat-claw.md → docs/programming/hoon/catalog/buc-mold/pat-claw.mdrenamed

The content is the same.

docs/programming/advanced/catalog/buc-mold/tis-coat.md → docs/programming/hoon/catalog/buc-mold/tis-coat.mdrenamed

The content is the same.

docs/programming/advanced/catalog/buc-mold/wut-pick.md → docs/programming/hoon/catalog/buc-mold/wut-pick.mdrenamed

The content is the same.

docs/programming/advanced/catalog/cen-call.md → docs/programming/hoon/catalog/cen-call.mdrenamed

The content is the same.

docs/programming/advanced/catalog/cen-call/dot-lace.md → docs/programming/hoon/catalog/cen-call/dot-lace.mdrenamed

The content is the same.

docs/programming/advanced/catalog/cen-call/hep-call.md → docs/programming/hoon/catalog/cen-call/hep-call.mdrenamed

The content is the same.

docs/programming/advanced/catalog/cen-call/ket-calq.md → docs/programming/hoon/catalog/cen-call/ket-calq.mdrenamed

The content is the same.

docs/programming/advanced/catalog/cen-call/lus-calt.md → docs/programming/hoon/catalog/cen-call/lus-calt.mdrenamed

The content is the same.

docs/programming/advanced/catalog/cen-call/sig-open.md → docs/programming/hoon/catalog/cen-call/sig-open.mdrenamed

The content is the same.

docs/programming/advanced/catalog/cen-call/tis-make.md → docs/programming/hoon/catalog/cen-call/tis-make.mdrenamed

The content is the same.

docs/programming/advanced/catalog/col-cell.md → docs/programming/hoon/catalog/col-cell.mdrenamed

The content is the same.

docs/programming/advanced/catalog/col-cell/cab-scon.md → docs/programming/hoon/catalog/col-cell/cab-scon.mdrenamed

The content is the same.

docs/programming/advanced/catalog/col-cell/hep-cons.md → docs/programming/hoon/catalog/col-cell/hep-cons.mdrenamed

The content is the same.

docs/programming/advanced/catalog/col-cell/ket-conq.md → docs/programming/hoon/catalog/col-cell/ket-conq.mdrenamed

The content is the same.

docs/programming/advanced/catalog/col-cell/lus-cont.md → docs/programming/hoon/catalog/col-cell/lus-cont.mdrenamed

The content is the same.

docs/programming/advanced/catalog/col-cell/sig-conl.md → docs/programming/hoon/catalog/col-cell/sig-conl.mdrenamed

The content is the same.

docs/programming/advanced/catalog/col-cell/tar-conp.md → docs/programming/hoon/catalog/col-cell/tar-conp.mdrenamed

The content is the same.

docs/programming/advanced/catalog/dot-nock.md → docs/programming/hoon/catalog/dot-nock.mdrenamed

The content is the same.

docs/programming/advanced/catalog/dot-nock/ket-wish.md → docs/programming/hoon/catalog/dot-nock/ket-wish.mdrenamed

The content is the same.

docs/programming/advanced/catalog/dot-nock/lus-bump.md → docs/programming/hoon/catalog/dot-nock/lus-bump.mdrenamed

The content is the same.

docs/programming/advanced/catalog/dot-nock/tar-nock.md → docs/programming/hoon/catalog/dot-nock/tar-nock.mdrenamed

The content is the same.

docs/programming/advanced/catalog/dot-nock/tis-same.md → docs/programming/hoon/catalog/dot-nock/tis-same.mdrenamed

The content is the same.

docs/programming/advanced/catalog/dot-nock/wut-deep.md → docs/programming/hoon/catalog/dot-nock/wut-deep.mdrenamed

The content is the same.

docs/programming/advanced/catalog/ket-cast.md → docs/programming/hoon/catalog/ket-cast.mdrenamed

The content is the same.

docs/programming/advanced/catalog/ket-cast/bar-iron.md → docs/programming/hoon/catalog/ket-cast/bar-iron.mdrenamed

The content is the same.

docs/programming/advanced/catalog/ket-cast/hep-cast.md → docs/programming/hoon/catalog/ket-cast/hep-cast.mdrenamed

The content is the same.

docs/programming/advanced/catalog/ket-cast/lus-like.md → docs/programming/hoon/catalog/ket-cast/lus-like.mdrenamed

The content is the same.

docs/programming/advanced/catalog/ket-cast/pam-zinc.md → docs/programming/hoon/catalog/ket-cast/pam-zinc.mdrenamed

The content is the same.

docs/programming/advanced/catalog/ket-cast/sig-burn.md → docs/programming/hoon/catalog/ket-cast/sig-burn.mdrenamed

The content is the same.

docs/programming/advanced/catalog/ket-cast/tis-name.md → docs/programming/hoon/catalog/ket-cast/tis-name.mdrenamed

The content is the same.

docs/programming/advanced/catalog/ket-cast/wut-lead.md → docs/programming/hoon/catalog/ket-cast/wut-lead.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc.md → docs/programming/hoon/catalog/misc.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/base.md → docs/programming/hoon/catalog/misc/base.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/buc-bunt.md → docs/programming/hoon/catalog/misc/buc-bunt.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/bust.md → docs/programming/hoon/catalog/misc/bust.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/dbug.md → docs/programming/hoon/catalog/misc/dbug.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/hand.md → docs/programming/hoon/catalog/misc/hand.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/knit.md → docs/programming/hoon/catalog/misc/knit.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/leaf.md → docs/programming/hoon/catalog/misc/leaf.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/limb.md → docs/programming/hoon/catalog/misc/limb.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/lost.md → docs/programming/hoon/catalog/misc/lost.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/rock.md → docs/programming/hoon/catalog/misc/rock.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/sand.md → docs/programming/hoon/catalog/misc/sand.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/tell.md → docs/programming/hoon/catalog/misc/tell.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/tune.md → docs/programming/hoon/catalog/misc/tune.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/wing.md → docs/programming/hoon/catalog/misc/wing.mdrenamed

The content is the same.

docs/programming/advanced/catalog/misc/yell.md → docs/programming/hoon/catalog/misc/yell.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sem-make.md → docs/programming/hoon/catalog/sem-make.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sem-make/col-wad.md → docs/programming/hoon/catalog/sem-make/col-wad.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sem-make/fas-nub.md → docs/programming/hoon/catalog/sem-make/fas-nub.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sem-make/sem-fry.md → docs/programming/hoon/catalog/sem-make/sem-fry.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sem-make/sig-dip.md → docs/programming/hoon/catalog/sem-make/sig-dip.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint.md → docs/programming/hoon/catalog/sig-hint.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/bar-show.md → docs/programming/hoon/catalog/sig-hint/bar-show.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/buc-poll.md → docs/programming/hoon/catalog/sig-hint/buc-poll.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/cab-lurk.md → docs/programming/hoon/catalog/sig-hint/cab-lurk.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/cen-fast.md → docs/programming/hoon/catalog/sig-hint/cen-fast.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/fas-funk.md → docs/programming/hoon/catalog/sig-hint/fas-funk.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/gal-thin.md → docs/programming/hoon/catalog/sig-hint/gal-thin.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/gar-hint.md → docs/programming/hoon/catalog/sig-hint/gar-hint.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/lus-memo.md → docs/programming/hoon/catalog/sig-hint/lus-memo.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/pam-dump.md → docs/programming/hoon/catalog/sig-hint/pam-dump.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/tis-ddup.md → docs/programming/hoon/catalog/sig-hint/tis-ddup.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/wut-warn.md → docs/programming/hoon/catalog/sig-hint/wut-warn.mdrenamed

The content is the same.

docs/programming/advanced/catalog/sig-hint/zap-peep.md → docs/programming/hoon/catalog/sig-hint/zap-peep.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow.md → docs/programming/hoon/catalog/tis-flow.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/bar-new.md → docs/programming/hoon/catalog/tis-flow/bar-new.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/col-fix.md → docs/programming/hoon/catalog/tis-flow/col-fix.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/dot-set.md → docs/programming/hoon/catalog/tis-flow/dot-set.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/fas-var.md → docs/programming/hoon/catalog/tis-flow/fas-var.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/gal-rap.md → docs/programming/hoon/catalog/tis-flow/gal-rap.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/gar-per.md → docs/programming/hoon/catalog/tis-flow/gar-per.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/hep-nip.md → docs/programming/hoon/catalog/tis-flow/hep-nip.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ket-sip.md → docs/programming/hoon/catalog/tis-flow/ket-sip.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/lus-pin.md → docs/programming/hoon/catalog/tis-flow/lus-pin.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/sem-rev.md → docs/programming/hoon/catalog/tis-flow/sem-rev.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/sig-tow.md → docs/programming/hoon/catalog/tis-flow/sig-tow.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/tar-aka.md → docs/programming/hoon/catalog/tis-flow/tar-aka.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ts/tsbr.md → docs/programming/hoon/catalog/tis-flow/ts/tsbr.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ts/tscl.md → docs/programming/hoon/catalog/tis-flow/ts/tscl.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ts/tsdt.md → docs/programming/hoon/catalog/tis-flow/ts/tsdt.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ts/tsgl.md → docs/programming/hoon/catalog/tis-flow/ts/tsgl.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ts/tsgr.md → docs/programming/hoon/catalog/tis-flow/ts/tsgr.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ts/tshp.md → docs/programming/hoon/catalog/tis-flow/ts/tshp.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ts/tskt.md → docs/programming/hoon/catalog/tis-flow/ts/tskt.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ts/tsls.md → docs/programming/hoon/catalog/tis-flow/ts/tsls.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ts/tssg.md → docs/programming/hoon/catalog/tis-flow/ts/tssg.mdrenamed

The content is the same.

docs/programming/advanced/catalog/tis-flow/ts/tstr.md → docs/programming/hoon/catalog/tis-flow/ts/tstr.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test.md → docs/programming/hoon/catalog/wut-test.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/bar-or.md → docs/programming/hoon/catalog/wut-test/bar-or.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/col-if.md → docs/programming/hoon/catalog/wut-test/col-if.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/dot-lest.md → docs/programming/hoon/catalog/wut-test/dot-lest.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/gal-deny.md → docs/programming/hoon/catalog/wut-test/gal-deny.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/gar-sure.md → docs/programming/hoon/catalog/wut-test/gar-sure.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/hep-case.md → docs/programming/hoon/catalog/wut-test/hep-case.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/ket-ifcl.md → docs/programming/hoon/catalog/wut-test/ket-ifcl.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/lus-deft.md → docs/programming/hoon/catalog/wut-test/lus-deft.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/pam-and.md → docs/programming/hoon/catalog/wut-test/pam-and.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/pat-ifat.md → docs/programming/hoon/catalog/wut-test/pat-ifat.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/sig-ifno.md → docs/programming/hoon/catalog/wut-test/sig-ifno.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/tis-fits.md → docs/programming/hoon/catalog/wut-test/tis-fits.mdrenamed

The content is the same.

docs/programming/advanced/catalog/wut-test/zap-not.md → docs/programming/hoon/catalog/wut-test/zap-not.mdrenamed

The content is the same.

docs/programming/advanced/catalog/zap-wild.md → docs/programming/hoon/catalog/zap-wild.mdrenamed

The content is the same.

docs/programming/advanced/catalog/zap-wild/com-twig.md → docs/programming/hoon/catalog/zap-wild/com-twig.mdrenamed

The content is the same.

docs/programming/advanced/catalog/zap-wild/gar-wrap.md → docs/programming/hoon/catalog/zap-wild/gar-wrap.mdrenamed

The content is the same.

docs/programming/advanced/catalog/zap-wild/sem-spit.md → docs/programming/hoon/catalog/zap-wild/sem-spit.mdrenamed

The content is the same.

docs/programming/advanced/catalog/zap-wild/tis-code.md → docs/programming/hoon/catalog/zap-wild/tis-code.mdrenamed

The content is the same.

docs/programming/advanced/catalog/zap-wild/wut-need.md → docs/programming/hoon/catalog/zap-wild/wut-need.mdrenamed

The content is the same.

docs/programming/advanced/catalog/zap-wild/zap-fail.md → docs/programming/hoon/catalog/zap-wild/zap-fail.mdrenamed

The content is the same.

docs/programming/cheat-sheets.md → docs/programming/hoon/cheat-sheets.mdrenamed

The content is the same.

docs/programming/cheat-sheets/hoon.md → docs/programming/hoon/cheat-sheets/hoon.mdrenamed

The content is the same.

docs/programming/cheat-sheets/odors.md → docs/programming/hoon/cheat-sheets/odors.mdrenamed

The content is the same.

docs/programming/cheat-sheets/pronunciation.md → docs/programming/hoon/cheat-sheets/pronunciation.mdrenamed

The content is the same.

docs/programming/concepts.md → docs/programming/hoon/concepts.mdrenamed

The content is the same.

docs/programming/demo.md → docs/programming/hoon/demo.mdrenamed

The content is the same.

docs/programming/examples.md → docs/programming/hoon/examples.mdrenamed

The content is the same.

docs/programming/advanced/library.md → docs/programming/hoon/library.mdrenamed

The content is the same.

docs/programming/advanced/library/1a.md → docs/programming/hoon/library/1a.mdrenamed

The content is the same.

docs/programming/advanced/library/1b.md → docs/programming/hoon/library/1b.mdrenamed

The content is the same.

docs/programming/advanced/library/1c.md → docs/programming/hoon/library/1c.mdrenamed

The content is the same.

docs/programming/advanced/library/2a.md → docs/programming/hoon/library/2a.mdrenamed

The content is the same.

docs/programming/advanced/library/2b.md → docs/programming/hoon/library/2b.mdrenamed

The content is the same.

docs/programming/advanced/library/2c.md → docs/programming/hoon/library/2c.mdrenamed

The content is the same.

docs/programming/advanced/library/2d.md → docs/programming/hoon/library/2d.mdrenamed

The content is the same.

docs/programming/advanced/library/2e.md → docs/programming/hoon/library/2e.mdrenamed

The content is the same.

docs/programming/advanced/library/2f.md → docs/programming/hoon/library/2f.mdrenamed

The content is the same.

docs/programming/advanced/library/2g.md → docs/programming/hoon/library/2g.mdrenamed

The content is the same.

docs/programming/advanced/library/2h.md → docs/programming/hoon/library/2h.mdrenamed

The content is the same.

docs/programming/advanced/library/2i.md → docs/programming/hoon/library/2i.mdrenamed

The content is the same.

docs/programming/advanced/library/2j.md → docs/programming/hoon/library/2j.mdrenamed

The content is the same.

docs/programming/advanced/library/2k.md → docs/programming/hoon/library/2k.mdrenamed

The content is the same.

docs/programming/advanced/library/2l.md → docs/programming/hoon/library/2l.mdrenamed

The content is the same.

docs/programming/advanced/library/2m.md → docs/programming/hoon/library/2m.mdrenamed

The content is the same.

docs/programming/advanced/library/2n.md → docs/programming/hoon/library/2n.mdrenamed

The content is the same.

docs/programming/advanced/library/2o.md → docs/programming/hoon/library/2o.mdrenamed

The content is the same.

docs/programming/advanced/library/2p.md → docs/programming/hoon/library/2p.mdrenamed

The content is the same.

docs/programming/advanced/library/2q.md → docs/programming/hoon/library/2q.mdrenamed

The content is the same.

docs/programming/advanced/library/3a.md → docs/programming/hoon/library/3a.mdrenamed

The content is the same.

docs/programming/advanced/library/3b.md → docs/programming/hoon/library/3b.mdrenamed

The content is the same.

docs/programming/advanced/library/3c.md → docs/programming/hoon/library/3c.mdrenamed

The content is the same.

docs/programming/advanced/library/3d.md → docs/programming/hoon/library/3d.mdrenamed

The content is the same.

docs/programming/advanced/library/3e.md → docs/programming/hoon/library/3e.mdrenamed

The content is the same.

docs/programming/advanced/library/3f.md → docs/programming/hoon/library/3f.mdrenamed

The content is the same.

docs/programming/advanced/library/3g.md → docs/programming/hoon/library/3g.mdrenamed

The content is the same.

docs/programming/advanced/library/4a.md → docs/programming/hoon/library/4a.mdrenamed

The content is the same.

docs/programming/advanced/library/4b.md → docs/programming/hoon/library/4b.mdrenamed

The content is the same.

docs/programming/advanced/library/4c.md → docs/programming/hoon/library/4c.mdrenamed

The content is the same.

docs/programming/advanced/library/4d.md → docs/programming/hoon/library/4d.mdrenamed

The content is the same.

docs/programming/advanced/library/4e.md → docs/programming/hoon/library/4e.mdrenamed

The content is the same.

docs/programming/advanced/library/4f.md → docs/programming/hoon/library/4f.mdrenamed

The content is the same.

docs/programming/advanced/library/4g.md → docs/programming/hoon/library/4g.mdrenamed

The content is the same.

docs/programming/advanced/library/4h.md → docs/programming/hoon/library/4h.mdrenamed

The content is the same.

docs/programming/advanced/library/4i.md → docs/programming/hoon/library/4i.mdrenamed

The content is the same.

docs/programming/advanced/library/4j.md → docs/programming/hoon/library/4j.mdrenamed

The content is the same.

docs/programming/advanced/library/4k.md → docs/programming/hoon/library/4k.mdrenamed

The content is the same.

docs/programming/advanced/library/4l.md → docs/programming/hoon/library/4l.mdrenamed

The content is the same.

docs/programming/advanced/library/4m.md → docs/programming/hoon/library/4m.mdrenamed

The content is the same.

docs/programming/advanced/library/4n.md → docs/programming/hoon/library/4n.mdrenamed

The content is the same.

docs/programming/advanced/library/4o.md → docs/programming/hoon/library/4o.mdrenamed

The content is the same.

docs/programming/advanced/library/5a.md → docs/programming/hoon/library/5a.mdrenamed

The content is the same.

docs/programming/advanced/library/5b.md → docs/programming/hoon/library/5b.mdrenamed

The content is the same.

docs/programming/advanced/library/5c.md → docs/programming/hoon/library/5c.mdrenamed

The content is the same.

docs/programming/advanced/library/5d.md → docs/programming/hoon/library/5d.mdrenamed

The content is the same.

docs/programming/advanced/library/5e.md → docs/programming/hoon/library/5e.mdrenamed

The content is the same.

docs/programming/advanced/library/5f.md → docs/programming/hoon/library/5f.mdrenamed

The content is the same.

docs/programming/advanced/library/5g.md → docs/programming/hoon/library/5g.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse.md → docs/programming/hoon/library/zuse.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/core/crua.md → docs/programming/hoon/library/zuse/core/crua.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/core/epur.md → docs/programming/hoon/library/zuse/core/epur.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/core/fu.md → docs/programming/hoon/library/zuse/core/fu.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/core/jo.md → docs/programming/hoon/library/zuse/core/jo.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/core/poja.md → docs/programming/hoon/library/zuse/core/poja.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/core/poxa.md → docs/programming/hoon/library/zuse/core/poxa.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/core/poxo.md → docs/programming/hoon/library/zuse/core/poxo.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/core/yu.md → docs/programming/hoon/library/zuse/core/yu.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/diff.md → docs/programming/hoon/library/zuse/diff.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/clan.md → docs/programming/hoon/library/zuse/gate/clan.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/dawn.md → docs/programming/hoon/library/zuse/gate/dawn.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/daws.md → docs/programming/hoon/library/zuse/gate/daws.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/deal.md → docs/programming/hoon/library/zuse/gate/deal.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/deft.md → docs/programming/hoon/library/zuse/gate/deft.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/dust.md → docs/programming/hoon/library/zuse/gate/dust.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/earl.md → docs/programming/hoon/library/zuse/gate/earl.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/earn.md → docs/programming/hoon/library/zuse/gate/earn.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/fain.md → docs/programming/hoon/library/zuse/gate/fain.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/feel.md → docs/programming/hoon/library/zuse/gate/feel.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/file.md → docs/programming/hoon/library/zuse/gate/file.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/foal.md → docs/programming/hoon/library/zuse/gate/foal.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/fray.md → docs/programming/hoon/library/zuse/gate/fray.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/fuel.md → docs/programming/hoon/library/zuse/gate/fuel.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/furl.md → docs/programming/hoon/library/zuse/gate/furl.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/glam.md → docs/programming/hoon/library/zuse/gate/glam.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/glon.md → docs/programming/hoon/library/zuse/gate/glon.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/gnom.md → docs/programming/hoon/library/zuse/gate/gnom.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/jape.md → docs/programming/hoon/library/zuse/gate/jape.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/jesc.md → docs/programming/hoon/library/zuse/gate/jesc.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/joba.md → docs/programming/hoon/library/zuse/gate/joba.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/jobe.md → docs/programming/hoon/library/zuse/gate/jobe.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/jone.md → docs/programming/hoon/library/zuse/gate/jone.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/lead.md → docs/programming/hoon/library/zuse/gate/lead.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/mang.md → docs/programming/hoon/library/zuse/gate/mang.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/meat.md → docs/programming/hoon/library/zuse/gate/meat.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/moon.md → docs/programming/hoon/library/zuse/gate/moon.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/mung.md → docs/programming/hoon/library/zuse/gate/mung.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/perk.md → docs/programming/hoon/library/zuse/gate/perk.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/pojo.md → docs/programming/hoon/library/zuse/gate/pojo.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/saxo.md → docs/programming/hoon/library/zuse/gate/saxo.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/scanf.md → docs/programming/hoon/library/zuse/gate/scanf.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/sein.md → docs/programming/hoon/library/zuse/gate/sein.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/sifo.md → docs/programming/hoon/library/zuse/gate/sifo.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/stud.md → docs/programming/hoon/library/zuse/gate/stud.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/taco.md → docs/programming/hoon/library/zuse/gate/taco.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/tact.md → docs/programming/hoon/library/zuse/gate/tact.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/tame.md → docs/programming/hoon/library/zuse/gate/tame.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/tell.md → docs/programming/hoon/library/zuse/gate/tell.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/tome.md → docs/programming/hoon/library/zuse/gate/tome.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/tope.md → docs/programming/hoon/library/zuse/gate/tope.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/txml.md → docs/programming/hoon/library/zuse/gate/txml.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/unt.md → docs/programming/hoon/library/zuse/gate/unt.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/urld.md → docs/programming/hoon/library/zuse/gate/urld.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/gate/urle.md → docs/programming/hoon/library/zuse/gate/urle.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/mold/udal.md → docs/programming/hoon/library/zuse/mold/udal.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/mold/udon.md → docs/programming/hoon/library/zuse/mold/udon.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/mold/umph.md → docs/programming/hoon/library/zuse/mold/umph.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/mold/unce.md → docs/programming/hoon/library/zuse/mold/unce.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/mold/upas.md → docs/programming/hoon/library/zuse/mold/upas.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/mold/urge.md → docs/programming/hoon/library/zuse/mold/urge.mdrenamed

The content is the same.

docs/programming/advanced/arvo/zuse/rsa.md → docs/programming/hoon/library/zuse/rsa.mdrenamed

The content is the same.

docs/programming/mint.md → docs/programming/hoon/mint.mdrenamed

The content is the same.

docs/programming/noun.md → docs/programming/hoon/noun.mdrenamed

The content is the same.

docs/programming/philosophy.md → docs/programming/hoon/philosophy.mdrenamed

The content is the same.

docs/programming/span.md → docs/programming/hoon/span.mdrenamed

The content is the same.

docs/programming/troubleshooting.md → docs/programming/hoon/troubleshooting.mdrenamed

The content is the same.

docs/programming/twig.md → docs/programming/hoon/twig.mdrenamed

The content is the same.

docs/programming/twig/atom.md → docs/programming/hoon/twig/atom.mdrenamed

The content is the same.

docs/programming/twig/call.md → docs/programming/hoon/twig/call.mdrenamed

The content is the same.

docs/programming/twig/cast.md → docs/programming/hoon/twig/cast.mdrenamed

The content is the same.

docs/programming/twig/cell.md → docs/programming/hoon/twig/cell.mdrenamed

The content is the same.

docs/programming/twig/core.md → docs/programming/hoon/twig/core.mdrenamed

The content is the same.

docs/programming/twig/flow.md → docs/programming/hoon/twig/flow.mdrenamed

The content is the same.

docs/programming/twig/limb.md → docs/programming/hoon/twig/limb.mdrenamed

The content is the same.

docs/programming/twig/mold.md → docs/programming/hoon/twig/mold.mdrenamed

The content is the same.

docs/programming/twig/nock.md → docs/programming/hoon/twig/nock.mdrenamed

The content is the same.

docs/programming/twig/syntax.md → docs/programming/hoon/twig/syntax.mdrenamed

The content is the same.

docs/programming/twig/syntax/design.md → docs/programming/hoon/twig/syntax/design.mdrenamed

The content is the same.

docs/programming/twig/syntax/motivation.md → docs/programming/hoon/twig/syntax/motivation.mdrenamed

The content is the same.

docs/programming/twig/test.md → docs/programming/hoon/twig/test.mdrenamed

The content is the same.

docs/programming/nock.md+5−162
@@ -1,167 +1,10 @@
11---
2−sort: 5
3−next: true
4−title: Interpreter
2+sort: 1
3+title: Nock
54---
65
7−# Interpreter: `nock`
6+## Nock
87
9−The Nock VM is a Turing-complete function that maps a cell
10−`{subject formula}` to a noun `product`, where `subject` is the
11−data, `formula` is the code, and `product` is the result.
8+This is our great interpreter.
129
13−To program in Hoon, this is all you need to know about Nock.
14−It's probably at least worth skimming the definition, though.
15−
16−(Also, the Hoon programmer should know that (a) tail call
17−elimination in Nock is straightforward; and (b) tail calls in
18−Hoon always become tail calls in Nock.)
19−
20−## Rules
21−
22−Nock is a combinator interpreter defined by the spec below.
23−
24−This pseudocode (any system of axioms is properly defined in
25−pseudocode) is a system of problem reduction rules. Variables
26−match any noun; the first rule from the top matches.
27−
28−A problem that reduces to itself is an infinite loop, hence a
29−crash ("bottom" in formal logic). Obviously a real interpreter
30−can detect this crash and produce an out-of-band value instead.
31−
32−```
33−?[a b] 0
34−?a 1
35−+[a b] +[a b]
36−+a 1 + a
37−=[a a] 0
38−=[a b] 1
39−=a =a
40−
41−/[1 a] a
42−/[2 a b] a
43−/[3 a b] b
44−/[(a + a) b] /[2 /[a b]]
45−/[(a + a + 1) b] /[3 /[a b]]
46−/a /a
47−
48−*[a [b c] d] [*[a b c] *[a d]]
49−
50−*[a 0 b] /[b a]
51−*[a 1 b] b
52−*[a 2 b c] *[*[a b] *[a c]]
53−*[a 3 b] ?*[a b]
54−*[a 4 b] +*[a b]
55−*[a 5 b] =*[a b]
56−
57−*[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0]
58− 2 [1 2 3] [1 0] 4 4 b]
59−*[a 7 b c] *[a 2 b 1 c]
60−*[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
61−*[a 9 b c] *[a 7 c 2 [0 1] 0 b]
62−*[a 10 [b c] d] *[a 8 c 7 [0 3] d]
63−*[a 10 b c] *[a c]
64−
65−*a *a
66−```
67−
68−## Operators
69−
70−The pseudocode notation defines five prefix operators: `?`, `+`,
71−`=`, `/`, and `*`.
72−
73−`?[x]` produces `0` if `x` is a cell, `1` if an atom.
74−
75−`+[x]` produces the atom `x` plus `1`.
76−
77−`=[x y]` produces `0` if `x` and `y` are the same noun, `1`
78−otherwise.
79−
80−`/` (`slot`) is a tree addressing operator. The root of the tree
81−is `1`; the left child of any node `n` is `2n`; the right child
82−is `2n+1`. `/[x y]` is the subtree of `y` at address `x`.
83−
84−(For instance, `/[1 [531 25 99]]` is `[531 25 99]`; `/[2 [531 25
85−99]]` is `531`; `/[3 [531 25 99]]` is `[25 99]`; `/[6 [531 25
86−99]]` is `25`; `/[12 [531 25 99]]` crashes.)
87−
88−`*[x y]` is the Nock interpreter function. `x` is the subject,
89−`y` is the formula.
90−
91−An invalid use of any operator (eg, incrementing a cell) crashes.
92−This is specified as an infinite loop, but it's not actually an
93−infinite loop.
94−
95−## Instructions
96−
97−A valid formula is always a cell. If the head of the formula is a
98−cell, Nock treats both head and tail as formulas, resolves each
99−against the subject, and produces the cell of their products. In
100−other words, the Lisp program `(cons x y)` becomes the Nock
101−formula `[x y]`.
102−
103−If the head of the formula is an atom, it's an instruction from
104−`0` to `10`.
105−
106−A formula `[0 b]` produces the noun at tree address `b`
107−in the subject.
108−
109−A formula `[1 b]` produces the constant noun `b`.
110−
111−A formula `[2 b c]` treats `b` and `c` is formulas, resolves each
112−against the subject, then computes Nock again with the product of
113−`b` as the subject, `c` as the formula.
114−
115−In formulas `[3 b]`, `[4 b]`, and `[5 b]`, `b` is another
116−formula, whose product against the subject becomes the input to
117−an axiomatic operator. `3` is `?`, `4` is `+`, `5` is `=`.
118−
119−Instructions `6` through `10` are macros; deleting them
120−from Nock would decrease compactness, but not expressiveness.
121−
122−`[6 b c d]` is *if* `b`, *then* `c`, *else* `d`. Each of `b`,
123−`c`, `d` is a formula against the subject. Remember that `0` is
124−true and `1` is false.
125−
126−`[7 b c]` composes the formulas `b` and `c`.
127−
128−`[8 b c]` produces the product of formula `c`, against
129−a subject whose head is the product of formula `b` with the
130−original subject, and whose tail is the original subject. (Think
131−of `8` as a ``variable declaration'' or ``stack push.'')
132−
133−`[9 b c]` computes the product of formula `c` with the current
134−subject; from that product `d` it extracts a formula `e` at tree
135−address `b`, then computes `*[d e]`. (`9` is designed to fit
136−Hoon; `d` is a `core` (object), `e` points to an arm (method).)
137−
138−`[10 b c]` is a *hint* semantically equivalent to the formula
139−`c`. If `b` is an atom, it's a *static hint*, which is just
140−discarded. If `b` is a cell, it's a *dynamic* hint; the head of
141−`b` is discarded, and the tail of `b` is executed as a formula
142−against the current subject; the product of this is discarded.
143−
144−A practical interpreter can do anything with discarded data, so
145−long as the result it computes complies with the semantics of
146−Nock. For example, the simplest use of hints is the ordinary
147−"debug printf." It is erroneous for an interpreter to skip
148−computing dynamic hints; they might crash.
149−
150−## Implementation
151−
152−The reader might wonder how an interpreter whose only arithmetic
153−operation is increment can ever be practical.
154−
155−The short answer is that a Nock interpreter doesn't have to use
156−the algorithm above. It just has to get the *same result* as the
157−algorithm above.
158−
159−The algorithm for decrementing an atom is to count up to it, an
160−O(n) operation. But if the interpreter knows it's running a
161−decrement formula, it can use the CPU to decrement directly.
162−
163−Detecting any Nock formula whose semantics match some function,
164−like decrement, is a hard problem. But in practice there is only
165−one decrement we run -- the decrement in the kernel library.
166−Declaring this formula (with a hint, instruction `10` above)
167−and recognizing it is not hard.
10+<list src="."></list>
docs/programming/nock/nock.mdnew file+167
@@ -0,0 +1,167 @@
1+---
2+sort: 5
3+next: true
4+title: Interpreter
5+---
6+
7+# Interpreter: `nock`
8+
9+The Nock VM is a Turing-complete function that maps a cell
10+`{subject formula}` to a noun `product`, where `subject` is the
11+data, `formula` is the code, and `product` is the result.
12+
13+To program in Hoon, this is all you need to know about Nock.
14+It's probably at least worth skimming the definition, though.
15+
16+(Also, the Hoon programmer should know that (a) tail call
17+elimination in Nock is straightforward; and (b) tail calls in
18+Hoon always become tail calls in Nock.)
19+
20+## Rules
21+
22+Nock is a combinator interpreter defined by the spec below.
23+
24+This pseudocode (any system of axioms is properly defined in
25+pseudocode) is a system of problem reduction rules. Variables
26+match any noun; the first rule from the top matches.
27+
28+A problem that reduces to itself is an infinite loop, hence a
29+crash ("bottom" in formal logic). Obviously a real interpreter
30+can detect this crash and produce an out-of-band value instead.
31+
32+```
33+?[a b] 0
34+?a 1
35++[a b] +[a b]
36++a 1 + a
37+=[a a] 0
38+=[a b] 1
39+=a =a
40+
41+/[1 a] a
42+/[2 a b] a
43+/[3 a b] b
44+/[(a + a) b] /[2 /[a b]]
45+/[(a + a + 1) b] /[3 /[a b]]
46+/a /a
47+
48+*[a [b c] d] [*[a b c] *[a d]]
49+
50+*[a 0 b] /[b a]
51+*[a 1 b] b
52+*[a 2 b c] *[*[a b] *[a c]]
53+*[a 3 b] ?*[a b]
54+*[a 4 b] +*[a b]
55+*[a 5 b] =*[a b]
56+
57+*[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0]
58+ 2 [1 2 3] [1 0] 4 4 b]
59+*[a 7 b c] *[a 2 b 1 c]
60+*[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
61+*[a 9 b c] *[a 7 c 2 [0 1] 0 b]
62+*[a 10 [b c] d] *[a 8 c 7 [0 3] d]
63+*[a 10 b c] *[a c]
64+
65+*a *a
66+```
67+
68+## Operators
69+
70+The pseudocode notation defines five prefix operators: `?`, `+`,
71+`=`, `/`, and `*`.
72+
73+`?[x]` produces `0` if `x` is a cell, `1` if an atom.
74+
75+`+[x]` produces the atom `x` plus `1`.
76+
77+`=[x y]` produces `0` if `x` and `y` are the same noun, `1`
78+otherwise.
79+
80+`/` (`slot`) is a tree addressing operator. The root of the tree
81+is `1`; the left child of any node `n` is `2n`; the right child
82+is `2n+1`. `/[x y]` is the subtree of `y` at address `x`.
83+
84+(For instance, `/[1 [531 25 99]]` is `[531 25 99]`; `/[2 [531 25
85+99]]` is `531`; `/[3 [531 25 99]]` is `[25 99]`; `/[6 [531 25
86+99]]` is `25`; `/[12 [531 25 99]]` crashes.)
87+
88+`*[x y]` is the Nock interpreter function. `x` is the subject,
89+`y` is the formula.
90+
91+An invalid use of any operator (eg, incrementing a cell) crashes.
92+This is specified as an infinite loop, but it's not actually an
93+infinite loop.
94+
95+## Instructions
96+
97+A valid formula is always a cell. If the head of the formula is a
98+cell, Nock treats both head and tail as formulas, resolves each
99+against the subject, and produces the cell of their products. In
100+other words, the Lisp program `(cons x y)` becomes the Nock
101+formula `[x y]`.
102+
103+If the head of the formula is an atom, it's an instruction from
104+`0` to `10`.
105+
106+A formula `[0 b]` produces the noun at tree address `b`
107+in the subject.
108+
109+A formula `[1 b]` produces the constant noun `b`.
110+
111+A formula `[2 b c]` treats `b` and `c` is formulas, resolves each
112+against the subject, then computes Nock again with the product of
113+`b` as the subject, `c` as the formula.
114+
115+In formulas `[3 b]`, `[4 b]`, and `[5 b]`, `b` is another
116+formula, whose product against the subject becomes the input to
117+an axiomatic operator. `3` is `?`, `4` is `+`, `5` is `=`.
118+
119+Instructions `6` through `10` are macros; deleting them
120+from Nock would decrease compactness, but not expressiveness.
121+
122+`[6 b c d]` is *if* `b`, *then* `c`, *else* `d`. Each of `b`,
123+`c`, `d` is a formula against the subject. Remember that `0` is
124+true and `1` is false.
125+
126+`[7 b c]` composes the formulas `b` and `c`.
127+
128+`[8 b c]` produces the product of formula `c`, against
129+a subject whose head is the product of formula `b` with the
130+original subject, and whose tail is the original subject. (Think
131+of `8` as a ``variable declaration'' or ``stack push.'')
132+
133+`[9 b c]` computes the product of formula `c` with the current
134+subject; from that product `d` it extracts a formula `e` at tree
135+address `b`, then computes `*[d e]`. (`9` is designed to fit
136+Hoon; `d` is a `core` (object), `e` points to an arm (method).)
137+
138+`[10 b c]` is a *hint* semantically equivalent to the formula
139+`c`. If `b` is an atom, it's a *static hint*, which is just
140+discarded. If `b` is a cell, it's a *dynamic* hint; the head of
141+`b` is discarded, and the tail of `b` is executed as a formula
142+against the current subject; the product of this is discarded.
143+
144+A practical interpreter can do anything with discarded data, so
145+long as the result it computes complies with the semantics of
146+Nock. For example, the simplest use of hints is the ordinary
147+"debug printf." It is erroneous for an interpreter to skip
148+computing dynamic hints; they might crash.
149+
150+## Implementation
151+
152+The reader might wonder how an interpreter whose only arithmetic
153+operation is increment can ever be practical.
154+
155+The short answer is that a Nock interpreter doesn't have to use
156+the algorithm above. It just has to get the *same result* as the
157+algorithm above.
158+
159+The algorithm for decrementing an atom is to count up to it, an
160+O(n) operation. But if the interpreter knows it's running a
161+decrement formula, it can use the CPU to decrement directly.
162+
163+Detecting any Nock formula whose semantics match some function,
164+like decrement, is a hard problem. But in practice there is only
165+one decrement we run -- the decrement in the kernel library.
166+Declaring this formula (with a hint, instruction `10` above)
167+and recognizing it is not hard.
docs/programming/runtime.mdnew file+10
@@ -0,0 +1,10 @@
1+---
2+sort: 4
3+title: Runtime
4+---
5+
6+## Runtime
7+
8+The C code
9+
10+<list src="."></list>
docs/programming/advanced/runtime.md → docs/programming/runtime/vere.mdrenamed

The content is the same.