~/bend-docscommunity

main.bend source

main.bend on the hub · documented module

import Baseimport ./lisp.bend as Limport ./core.bend as Cimport ./stg.bend as Simport ./stg_c.bend as G# bend-machines: Root-of-Lisp, Core, STG and STG->C, one package.# Publish as a whole: bend main.bend --publish# Use from the hub: import 0x<hash>/main.bend as M, then M.demo()def demo() -> (List<&2, L.LExp> & List<&2, C.CVal>) & List<&2, S.SVal>:  ((L.l_batch(50n, [L.LCar{L.LCons{L.LQuote{L.LSym{"a"}}, L.LQuote{L.LSym{"b"}}}}]), C.c_batch(30n, [C.CAdd{C.CLit{2n}, C.CLit{3n}}])), S.s_batch(30n, [S.SLet{S.SLit{42n}, S.SAdd{S.SVar{0}, S.SVar{0}}}]))def demo_c() -> String:  G.s_prog(G.demo84())def main() -> IO(Unit):  do IO<Unit>:    IO.print("lisp + core + stg packed; see demo(), demo_c().")