neo: minimum viable ford

This commit is contained in:
Liam Fitzgerald 2024-03-12 15:17:52 -04:00
parent 6dc2e84628
commit 86e84ae8c7
11 changed files with 159 additions and 1 deletions

View File

View File

View File

@ -0,0 +1,25 @@
|%
++ run
|= txt=@t
(scan (trip txt) apex:rein)
+$ file
$: deps=(list path)
=hoon
==
++ rein
|%
++ dep
^- $-(nail (like path))
(ifix [;~(plug fas lus gap) gay] stap)
++ deps
(star dep)
++ hone
=+ vaz=vast
(ifix [gay gay] tall:vaz)
++ apex
:: ^- $-(nail (like file))
:: ^- rule
;~(plug deps hone)
--
--

View File

@ -0,0 +1,35 @@
/- neo
=>
|%
++ card card:neo
++ reef ^~(!>(..zuse))
--
^- firm:neo
|%
+$ state [cache=(unit vase) ~]
+$ poke ~
++ kids ~
++ deps ~
++ form
^- form:neo
|_ [=bowl:neo case=@ud state-vase=vase *]
+* sta !<(state state-vase)
++ call
|= [old-state=vase act=*]
*(list card:neo)
++ reduce
|= pok=*
^- vase
state-vase
++ init
|= old=(unit vase)
!>(`state`[`reef ~])
++ born *(list card:neo)
++ echo
|= [=pith val=*]
*(list card:neo)
++ take
|= =sign:neo
*(list card:neo)
--
--

View File

View File

0
pkg/arvo/lib/ford.hoon Normal file
View File

71
pkg/arvo/lib/nhoon.hoon Normal file
View File

@ -0,0 +1,71 @@
/- neo
=>
|%
++ card card:neo
++ get-sut
|= =bowl:neo
^- (unit vase)
=+ !<([cac=(unit vase) *] q:(~(got by deps.bowl) %sut))
cac
++ build
|= [=bowl:neo =hoon]
^- (unit vase)
?~ sut=(get-sut bowl)
~
`(slap u.sut hoon)
--
^- firm:neo
|%
+$ state [cache=(unit vase) =hoon]
+$ poke
$% [%dep ~]
[%hoon =hoon]
==
++ kids ~
++ deps
=< apex
|%
++ apex
%- ~(gas by *deps:neo)
:~ sut/sut
==
++ sut
[& ,[cache=(unit vase) *] ,*]
--
++ form
^- form:neo
|_ [=bowl:neo case=@ud state-vase=vase *]
+* sta !<(state state-vase)
++ call
|= [old-state=vase act=*]
*(list card)
++ reduce
|= pok=*
^- vase
=+ ;;(=poke pok)
=/ sta sta
=? hoon.sta ?=(%hoon -.poke)
hoon.poke
=. cache.sta (build bowl hoon.sta)
!>(sta)
++ init
|= vax=(unit vase)
?~ vax !>(*state)
=+ !<([cac=(unit vase) =hoon] u.vax)
!>(`state`[~ hoon])
++ born
=- ~[-]
[%neo were.bowl %poke %dep ~]
++ echo
|= [=pith val=*]
*(list card:neo)
++ take
|= =sign:neo
^- (list card:neo)
?. ?=([%neo %conf %val @] sign)
!!
=- ~[-]
[%neo were.bowl %poke %dep ~]
--
--

View File

@ -0,0 +1,2 @@
/+ /~met/sys/reef
zuse

View File

@ -0,0 +1,20 @@
/- spider, neo
/+ io=strandio, ford=ford-parser
=, strand=strand:spider
=< run
|%
++ poke-neo
|= =note:neo
(poke-our:io %neo noun+!>(note))
++ run
^- thread:spider
|= =vase
=/ m (strand ,vase)
=+ !<([~ pax=(pole knot)] vase)
=/ =beam (need (de-beam pax))
;< =cage bind:m (read-file:io beam)
?> ?=(%hoon p.cage)
=+ !<(src=@t q.cage)
=/ =file:ford (scan (trip src) apex:rein:ford)
=* loop $
;< ~ bind:m (poke-neo

View File

@ -50,8 +50,13 @@
=/ result=(each ^vase tang)
(mule |.(q:(need (need (on-peek:ag /x/dbug/state)))))
?:(?=(%& -.result) p.result on-save:ag)
=/ prelude=^vase
=/ bek
/(scot %p our.bowl)/[q.byk.bowl]/(scot %da now.bowl)
=+ .^(=open:clay %cs (welp bek /open/foo))
(fall (mole |.((open /app/[dap.bowl]/hoon))) !>(..zuse))
%+ slap
(slop state !>([bowl=bowl ..zuse]))
:(slop state !>(bowl=bowl) prelude)
(ream grab.dbug)
::
%incoming