test¶

include scripts¶

include notebook core¶

In [ ]:
. ../../../../scripts/nbs_header.ps1

Include core functions script¶

In [ ]:
. ../../../../scripts/core.ps1

Include spiral library¶

In [ ]:
. ../../../../deps/spiral/lib/spiral/lib.ps1

execute project commands¶

run notebook with retries using spiral supervisor¶

In [ ]:
{ . ../../../../deps/spiral/workspace/target/release/spiral$(_exe) dib --path test.dib --retries 3 } | Invoke-Block
00:00:00 d #1 spiral.main / { args = Array(MutCell(["dib", "--path", "test.dib", "--retries", "3"])) }
00:00:00 d #2 runtime.execute_with_options / { file_name = dotnet; arguments = ["repl", "--exit-after-run", "--run", "/home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib", "--output-path", "/home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib.ipynb"]; options = { command = dotnet repl --exit-after-run --run "/home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib" --output-path "/home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib.ipynb"; cancellation_token = None; environment_variables = Array(MutCell([("TRACE_LEVEL", "Verbose"), ("AUTOMATION", "True")])); on_line = None; stdin = None; trace = false; working_directory = None; stderr = true } }
> 
> ── markdown ────────────────────────────────────────────────────────────────────
> │ # test (Polyglot)
> 
> ── spiral ──────────────────────────────────────────────────────────────────────
> //// test
> 
> open testing
> 
> ── spiral ──────────────────────────────────────────────────────────────────────
> //// test
> //// print_code
> 
> inl jp = [[ "J"; "P" ]]
> inl tf = [[ "T"; "F" ]]
> inl sn = [[ "S"; "N" ]]
> inl ie = [[ "I"; "E" ]]
> 
> (ie, ([[]] : _ string))
> ||> listm.foldBack fun ie' acc =>
>     inl ssnn acc' jp' =
>         (sn, acc')
>         ||> listm.foldBack fun sn' acc' =>
>             inl c' ie' sn' tf' jp' =
>                 $'$"{!ie'}{!sn'}{!tf'}{!jp'}"'
> 
>             if listm.length acc' % 4i32 = 2 then
>                 (tf, acc')
>                 ||> listm.foldBack fun tf' acc'' =>
>                     c' ie' sn' tf' jp' :: acc''
>             else
>                 (acc', tf)
>                 ||> listm.fold fun acc'' tf' =>
>                     c' ie' sn' tf' jp' :: acc''
>     if acc = [[]] then
>         (acc, jp)
>         ||> listm.fold fun acc' jp' =>
>             ssnn acc' jp'
>     else
>         (jp, acc)
>         ||> listm.foldBack fun jp' acc' =>
>             ssnn acc' jp'
> |> listm'.box
> |> listm'.to_array'
> |> _assert_eq' ;[[
>     "ISTJ"; "ISFJ"; "INFJ"; "INTJ"
>     "ISTP"; "ISFP"; "INFP"; "INTP"
>     "ESTP"; "ESFP"; "ENFP"; "ENTP"
>     "ESTJ"; "ESFJ"; "ENFJ"; "ENTJ"
> ]]
> 
> ── [ 1.22s - stdout ] ──────────────────────────────────────────────────────────
> │ type Mut0 = {mutable l0 : string}
> │ let rec method1 (v0 : bool) : bool =
> │     v0
> │ and method3 () : string =
> │     let v0 : string = ""
> │     v0
> │ and closure0 (v0 : Mut0, v1 : string) () : unit =
> │     let v2 : string = v0.l0
> │     let v4 : string = v2 + v1 
> │     v0.l0 <- v4
> │     ()
> │ and method2 (v0 : string, v1 : (string [])) : string =
> │     let v2 : string = method3()
> │     let v3 : Mut0 = {l0 = v2} : Mut0
> │     let v6 : string = "{ "
> │     let v7 : string = $"{v6}"
> │     let v15 : unit = ()
> │     let v16 : (unit -> unit) = closure0(v3, v7)
> │     let v17 : unit = (fun () -> v16 (); v15) ()
> │     let v25 : string = "name"
> │     let v26 : string = $"{v25}"
> │     let v34 : unit = ()
> │     let v35 : (unit -> unit) = closure0(v3, v26)
> │     let v36 : unit = (fun () -> v35 (); v34) ()
> │     let v44 : string = " = "
> │     let v45 : string = $"{v44}"
> │     let v53 : unit = ()
> │     let v54 : (unit -> unit) = closure0(v3, v45)
> │     let v55 : unit = (fun () -> v54 (); v53) ()
> │     let v62 : string = $"{v0}"
> │     let v70 : unit = ()
> │     let v71 : (unit -> unit) = closure0(v3, v62)
> │     let v72 : unit = (fun () -> v71 (); v70) ()
> │     let v80 : string = "; "
> │     let v81 : string = $"{v80}"
> │     let v89 : unit = ()
> │     let v90 : (unit -> unit) = closure0(v3, v81)
> │     let v91 : unit = (fun () -> v90 (); v89) ()
> │     let v99 : string = "expected"
> │     let v100 : string = $"{v99}"
> │     let v108 : unit = ()
> │     let v109 : (unit -> unit) = closure0(v3, v100)
> │     let v110 : unit = (fun () -> v109 (); v108) ()
> │     let v117 : string = $"{v44}"
> │     let v125 : unit = ()
> │     let v126 : (unit -> unit) = closure0(v3, v117)
> │     let v127 : unit = (fun () -> v126 (); v125) ()
> │     let v135 : string = $"%A{v1}"
> │     let v139 : string = $"{v135}"
> │     let v147 : unit = ()
> │     let v148 : (unit -> unit) = closure0(v3, v139)
> │     let v149 : unit = (fun () -> v148 (); v147) ()
> │     let v157 : string = " }"
> │     let v158 : string = $"{v157}"
> │     let v166 : unit = ()
> │     let v167 : (unit -> unit) = closure0(v3, v158)
> │     let v168 : unit = (fun () -> v167 (); v166) ()
> │     let v174 : string = v3.l0
> │     v174
> │ and closure1 (v0 : string) () : unit =
> │     let v1 : (string -> unit) = System.Console.WriteLine
> │     v1 v0
> │ and method0 () : unit =
> │     let v0 : string = "E"
> │     let v1 : string = "N"
> │     let v2 : string = "T"
> │     let v3 : string = "J"
> │     let v4 : string = $"{v0}{v1}{v2}{v3}"
> │     let v5 : string = "F"
> │     let v6 : string = $"{v0}{v1}{v5}{v3}"
> │     let v7 : string = "S"
> │     let v8 : string = $"{v0}{v7}{v5}{v3}"
> │     let v9 : string = $"{v0}{v7}{v2}{v3}"
> │     let v10 : string = "P"
> │     let v11 : string = $"{v0}{v1}{v2}{v10}"
> │     let v12 : string = $"{v0}{v1}{v5}{v10}"
> │     let v13 : string = $"{v0}{v7}{v5}{v10}"
> │     let v14 : string = $"{v0}{v7}{v2}{v10}"
> │     let v15 : string = "I"
> │     let v16 : string = $"{v15}{v1}{v2}{v10}"
> │     let v17 : string = $"{v15}{v1}{v5}{v10}"
> │     let v18 : string = $"{v15}{v7}{v5}{v10}"
> │     let v19 : string = $"{v15}{v7}{v2}{v10}"
> │     let v20 : string = $"{v15}{v1}{v2}{v3}"
> │     let v21 : string = $"{v15}{v1}{v5}{v3}"
> │     let v22 : string = $"{v15}{v7}{v5}{v3}"
> │     let v23 : string = $"{v15}{v7}{v2}{v3}"
> │     let v24 : string list = []
> │     let v26 : string list = v4 :: v24 
> │     let v30 : string list = v6 :: v26 
> │     let v34 : string list = v8 :: v30 
> │     let v38 : string list = v9 :: v34 
> │     let v42 : string list = v11 :: v38 
> │     let v46 : string list = v12 :: v42 
> │     let v50 : string list = v13 :: v46 
> │     let v54 : string list = v14 :: v50 
> │     let v58 : string list = v16 :: v54 
> │     let v62 : string list = v17 :: v58 
> │     let v66 : string list = v18 :: v62 
> │     let v70 : string list = v19 :: v66 
> │     let v74 : string list = v20 :: v70 
> │     let v78 : string list = v21 :: v74 
> │     let v82 : string list = v22 :: v78 
> │     let v86 : string list = v23 :: v82 
> │     let v93 : (string list -> (string [])) = List.toArray
> │     let v94 : (string []) = v93 v86
> │     let v97 : string = "ISTJ"
> │     let v98 : string = "ISFJ"
> │     let v99 : string = "INFJ"
> │     let v100 : string = "INTJ"
> │     let v101 : string = "ISTP"
> │     let v102 : string = "ISFP"
> │     let v103 : string = "INFP"
> │     let v104 : string = "INTP"
> │     let v105 : string = "ESTP"
> │     let v106 : string = "ESFP"
> │     let v107 : string = "ENFP"
> │     let v108 : string = "ENTP"
> │     let v109 : string = "ESTJ"
> │     let v110 : string = "ESFJ"
> │     let v111 : string = "ENFJ"
> │     let v112 : string = "ENTJ"
> │     let v113 : (string []) = [|v97; v98; v99; v100; v101; 
> v102; v103; v104; v105; v106; v107; v108; v109; v110; v111; v112|]
> │     let v115 : bool = v94 = v113 
> │     let v119 : bool =
> │         if v115 then
> │             true
> │         else
> │             method1(v115)
> │     let v120 : string = "__assert_eq'"
> │     let v121 : string = method2(v120, v113)
> │     let v123 : unit = ()
> │     let v124 : (unit -> unit) = closure1(v121)
> │     let v125 : unit = (fun () -> v124 (); v123) ()
> │     let v127 : bool = v119 = false
> │     if v127 then
> │         failwith<unit> v121
> │ method0()
> │ 
> │ { name = __assert_eq'; expected = [|"ISTJ"; "ISFJ"; "INFJ"; 
> "INTJ"; "ISTP"; "ISFP"; "INFP"; "INTP"; "ESTP"; "ESFP";
> │   "ENFP"; "ENTP"; "ESTJ"; "ESFJ"; "ENFJ"; "ENTJ"|] }
> │ 
> 
> ── spiral ──────────────────────────────────────────────────────────────────────
> //// test
> //// print_code
> 
> inl i_e =
>     listm'.replicate 8i32 "I" ++ listm'.replicate 8i32 "E"
> inl s_n =
>     [[ "S"; "S"; "N"; "N" ]]
>     |> listm'.replicate 4i32
>     |> listm'.collect id
> inl t_f =
>     [[ "T"; "F"; "F"; "T" ]]
>     |> listm'.replicate 4i32
>     |> listm'.collect id
> inl j_p =
>     [[ "J"; "J"; "J"; "J" ]]
>     ++ [[ "P"; "P"; "P"; "P" ]]
>     ++ [[ "P"; "P"; "P"; "P" ]]
>     ++ [[ "J"; "J"; "J"; "J" ]]
> inl mbti =
>     listm'.map4 (fun a b c d => $'$"{!a}{!b}{!c}{!d}"') i_e s_n t_f j_p
> 
> mbti
> |> listm'.box
> |> listm'.to_array'
> |> _assert_eq' ;[[
>     "ISTJ"; "ISFJ"; "INFJ"; "INTJ"
>     "ISTP"; "ISFP"; "INFP"; "INTP"
>     "ESTP"; "ESFP"; "ENFP"; "ENTP"
>     "ESTJ"; "ESFJ"; "ENFJ"; "ENTJ"
> ]]
> 
> ── [ 336.82ms - stdout ] ───────────────────────────────────────────────────────
> │ type Mut0 = {mutable l0 : string}
> │ let rec method1 (v0 : bool) : bool =
> │     v0
> │ and method3 () : string =
> │     let v0 : string = ""
> │     v0
> │ and closure0 (v0 : Mut0, v1 : string) () : unit =
> │     let v2 : string = v0.l0
> │     let v4 : string = v2 + v1 
> │     v0.l0 <- v4
> │     ()
> │ and method2 (v0 : string, v1 : (string [])) : string =
> │     let v2 : string = method3()
> │     let v3 : Mut0 = {l0 = v2} : Mut0
> │     let v6 : string = "{ "
> │     let v7 : string = $"{v6}"
> │     let v15 : unit = ()
> │     let v16 : (unit -> unit) = closure0(v3, v7)
> │     let v17 : unit = (fun () -> v16 (); v15) ()
> │     let v25 : string = "name"
> │     let v26 : string = $"{v25}"
> │     let v34 : unit = ()
> │     let v35 : (unit -> unit) = closure0(v3, v26)
> │     let v36 : unit = (fun () -> v35 (); v34) ()
> │     let v44 : string = " = "
> │     let v45 : string = $"{v44}"
> │     let v53 : unit = ()
> │     let v54 : (unit -> unit) = closure0(v3, v45)
> │     let v55 : unit = (fun () -> v54 (); v53) ()
> │     let v62 : string = $"{v0}"
> │     let v70 : unit = ()
> │     let v71 : (unit -> unit) = closure0(v3, v62)
> │     let v72 : unit = (fun () -> v71 (); v70) ()
> │     let v80 : string = "; "
> │     let v81 : string = $"{v80}"
> │     let v89 : unit = ()
> │     let v90 : (unit -> unit) = closure0(v3, v81)
> │     let v91 : unit = (fun () -> v90 (); v89) ()
> │     let v99 : string = "expected"
> │     let v100 : string = $"{v99}"
> │     let v108 : unit = ()
> │     let v109 : (unit -> unit) = closure0(v3, v100)
> │     let v110 : unit = (fun () -> v109 (); v108) ()
> │     let v117 : string = $"{v44}"
> │     let v125 : unit = ()
> │     let v126 : (unit -> unit) = closure0(v3, v117)
> │     let v127 : unit = (fun () -> v126 (); v125) ()
> │     let v135 : string = $"%A{v1}"
> │     let v139 : string = $"{v135}"
> │     let v147 : unit = ()
> │     let v148 : (unit -> unit) = closure0(v3, v139)
> │     let v149 : unit = (fun () -> v148 (); v147) ()
> │     let v157 : string = " }"
> │     let v158 : string = $"{v157}"
> │     let v166 : unit = ()
> │     let v167 : (unit -> unit) = closure0(v3, v158)
> │     let v168 : unit = (fun () -> v167 (); v166) ()
> │     let v174 : string = v3.l0
> │     v174
> │ and closure1 (v0 : string) () : unit =
> │     let v1 : (string -> unit) = System.Console.WriteLine
> │     v1 v0
> │ and method0 () : unit =
> │     let v0 : string = "I"
> │     let v1 : string = "S"
> │     let v2 : string = "T"
> │     let v3 : string = "J"
> │     let v4 : string = $"{v0}{v1}{v2}{v3}"
> │     let v5 : string = "F"
> │     let v6 : string = $"{v0}{v1}{v5}{v3}"
> │     let v7 : string = "N"
> │     let v8 : string = $"{v0}{v7}{v5}{v3}"
> │     let v9 : string = $"{v0}{v7}{v2}{v3}"
> │     let v10 : string = "P"
> │     let v11 : string = $"{v0}{v1}{v2}{v10}"
> │     let v12 : string = $"{v0}{v1}{v5}{v10}"
> │     let v13 : string = $"{v0}{v7}{v5}{v10}"
> │     let v14 : string = $"{v0}{v7}{v2}{v10}"
> │     let v15 : string = "E"
> │     let v16 : string = $"{v15}{v1}{v2}{v10}"
> │     let v17 : string = $"{v15}{v1}{v5}{v10}"
> │     let v18 : string = $"{v15}{v7}{v5}{v10}"
> │     let v19 : string = $"{v15}{v7}{v2}{v10}"
> │     let v20 : string = $"{v15}{v1}{v2}{v3}"
> │     let v21 : string = $"{v15}{v1}{v5}{v3}"
> │     let v22 : string = $"{v15}{v7}{v5}{v3}"
> │     let v23 : string = $"{v15}{v7}{v2}{v3}"
> │     let v24 : string list = []
> │     let v26 : string list = v23 :: v24 
> │     let v30 : string list = v22 :: v26 
> │     let v34 : string list = v21 :: v30 
> │     let v38 : string list = v20 :: v34 
> │     let v42 : string list = v19 :: v38 
> │     let v46 : string list = v18 :: v42 
> │     let v50 : string list = v17 :: v46 
> │     let v54 : string list = v16 :: v50 
> │     let v58 : string list = v14 :: v54 
> │     let v62 : string list = v13 :: v58 
> │     let v66 : string list = v12 :: v62 
> │     let v70 : string list = v11 :: v66 
> │     let v74 : string list = v9 :: v70 
> │     let v78 : string list = v8 :: v74 
> │     let v82 : string list = v6 :: v78 
> │     let v86 : string list = v4 :: v82 
> │     let v93 : (string list -> (string [])) = List.toArray
> │     let v94 : (string []) = v93 v86
> │     let v97 : string = "ISTJ"
> │     let v98 : string = "ISFJ"
> │     let v99 : string = "INFJ"
> │     let v100 : string = "INTJ"
> │     let v101 : string = "ISTP"
> │     let v102 : string = "ISFP"
> │     let v103 : string = "INFP"
> │     let v104 : string = "INTP"
> │     let v105 : string = "ESTP"
> │     let v106 : string = "ESFP"
> │     let v107 : string = "ENFP"
> │     let v108 : string = "ENTP"
> │     let v109 : string = "ESTJ"
> │     let v110 : string = "ESFJ"
> │     let v111 : string = "ENFJ"
> │     let v112 : string = "ENTJ"
> │     let v113 : (string []) = [|v97; v98; v99; v100; v101; 
> v102; v103; v104; v105; v106; v107; v108; v109; v110; v111; v112|]
> │     let v115 : bool = v94 = v113 
> │     let v119 : bool =
> │         if v115 then
> │             true
> │         else
> │             method1(v115)
> │     let v120 : string = "__assert_eq'"
> │     let v121 : string = method2(v120, v113)
> │     let v123 : unit = ()
> │     let v124 : (unit -> unit) = closure1(v121)
> │     let v125 : unit = (fun () -> v124 (); v123) ()
> │     let v127 : bool = v119 = false
> │     if v127 then
> │         failwith<unit> v121
> │ method0()
> │ 
> │ { name = __assert_eq'; expected = [|"ISTJ"; "ISFJ"; "INFJ"; 
> "INTJ"; "ISTP"; "ISFP"; "INFP"; "INTP"; "ESTP"; "ESFP";
> │   "ENFP"; "ENTP"; "ESTJ"; "ESFJ"; "ENFJ"; "ENTJ"|] }
> │ 
> 
> ── spiral ──────────────────────────────────────────────────────────────────────
> //// test
> //// print_code
> 
> fun i =>
>     inl i_e =
>         if i < 8
>         then "I"
>         else "E"
>     inl s_n = 
>         inl group = (i / 2) % 2
>         if group = 0
>         then "S"
>         else "N"
>     inl t_f =
>         match i % 4 with
>         | 0 => "T"
>         | 1 => "F"
>         | 2 => "F"
>         | _ => "T"
>     inl j_p =
>         if i < 4
>         then "J"
>         elif i < 12
>         then "P"
>         else "J"
>     $'$"{!i_e}{!s_n}{!t_f}{!j_p}"'
> |> listm.init 16i32
> |> listm'.box
> |> listm'.to_array'
> |> _assert_eq' ;[[
>     "ISTJ"; "ISFJ"; "INFJ"; "INTJ"
>     "ISTP"; "ISFP"; "INFP"; "INTP"
>     "ESTP"; "ESFP"; "ENFP"; "ENTP"
>     "ESTJ"; "ESFJ"; "ENFJ"; "ENTJ"
> ]]
> 
> ── [ 285.81ms - stdout ] ───────────────────────────────────────────────────────
> │ type Mut0 = {mutable l0 : string}
> │ let rec method1 (v0 : bool) : bool =
> │     v0
> │ and method3 () : string =
> │     let v0 : string = ""
> │     v0
> │ and closure0 (v0 : Mut0, v1 : string) () : unit =
> │     let v2 : string = v0.l0
> │     let v4 : string = v2 + v1 
> │     v0.l0 <- v4
> │     ()
> │ and method2 (v0 : string, v1 : (string [])) : string =
> │     let v2 : string = method3()
> │     let v3 : Mut0 = {l0 = v2} : Mut0
> │     let v6 : string = "{ "
> │     let v7 : string = $"{v6}"
> │     let v15 : unit = ()
> │     let v16 : (unit -> unit) = closure0(v3, v7)
> │     let v17 : unit = (fun () -> v16 (); v15) ()
> │     let v25 : string = "name"
> │     let v26 : string = $"{v25}"
> │     let v34 : unit = ()
> │     let v35 : (unit -> unit) = closure0(v3, v26)
> │     let v36 : unit = (fun () -> v35 (); v34) ()
> │     let v44 : string = " = "
> │     let v45 : string = $"{v44}"
> │     let v53 : unit = ()
> │     let v54 : (unit -> unit) = closure0(v3, v45)
> │     let v55 : unit = (fun () -> v54 (); v53) ()
> │     let v62 : string = $"{v0}"
> │     let v70 : unit = ()
> │     let v71 : (unit -> unit) = closure0(v3, v62)
> │     let v72 : unit = (fun () -> v71 (); v70) ()
> │     let v80 : string = "; "
> │     let v81 : string = $"{v80}"
> │     let v89 : unit = ()
> │     let v90 : (unit -> unit) = closure0(v3, v81)
> │     let v91 : unit = (fun () -> v90 (); v89) ()
> │     let v99 : string = "expected"
> │     let v100 : string = $"{v99}"
> │     let v108 : unit = ()
> │     let v109 : (unit -> unit) = closure0(v3, v100)
> │     let v110 : unit = (fun () -> v109 (); v108) ()
> │     let v117 : string = $"{v44}"
> │     let v125 : unit = ()
> │     let v126 : (unit -> unit) = closure0(v3, v117)
> │     let v127 : unit = (fun () -> v126 (); v125) ()
> │     let v135 : string = $"%A{v1}"
> │     let v139 : string = $"{v135}"
> │     let v147 : unit = ()
> │     let v148 : (unit -> unit) = closure0(v3, v139)
> │     let v149 : unit = (fun () -> v148 (); v147) ()
> │     let v157 : string = " }"
> │     let v158 : string = $"{v157}"
> │     let v166 : unit = ()
> │     let v167 : (unit -> unit) = closure0(v3, v158)
> │     let v168 : unit = (fun () -> v167 (); v166) ()
> │     let v174 : string = v3.l0
> │     v174
> │ and closure1 (v0 : string) () : unit =
> │     let v1 : (string -> unit) = System.Console.WriteLine
> │     v1 v0
> │ and method0 () : unit =
> │     let v0 : string = "I"
> │     let v1 : string = "S"
> │     let v2 : string = "T"
> │     let v3 : string = "J"
> │     let v4 : string = $"{v0}{v1}{v2}{v3}"
> │     let v5 : string = "F"
> │     let v6 : string = $"{v0}{v1}{v5}{v3}"
> │     let v7 : string = "N"
> │     let v8 : string = $"{v0}{v7}{v5}{v3}"
> │     let v9 : string = $"{v0}{v7}{v2}{v3}"
> │     let v10 : string = "P"
> │     let v11 : string = $"{v0}{v1}{v2}{v10}"
> │     let v12 : string = $"{v0}{v1}{v5}{v10}"
> │     let v13 : string = $"{v0}{v7}{v5}{v10}"
> │     let v14 : string = $"{v0}{v7}{v2}{v10}"
> │     let v15 : string = "E"
> │     let v16 : string = $"{v15}{v1}{v2}{v10}"
> │     let v17 : string = $"{v15}{v1}{v5}{v10}"
> │     let v18 : string = $"{v15}{v7}{v5}{v10}"
> │     let v19 : string = $"{v15}{v7}{v2}{v10}"
> │     let v20 : string = $"{v15}{v1}{v2}{v3}"
> │     let v21 : string = $"{v15}{v1}{v5}{v3}"
> │     let v22 : string = $"{v15}{v7}{v5}{v3}"
> │     let v23 : string = $"{v15}{v7}{v2}{v3}"
> │     let v24 : string list = []
> │     let v26 : string list = v23 :: v24 
> │     let v30 : string list = v22 :: v26 
> │     let v34 : string list = v21 :: v30 
> │     let v38 : string list = v20 :: v34 
> │     let v42 : string list = v19 :: v38 
> │     let v46 : string list = v18 :: v42 
> │     let v50 : string list = v17 :: v46 
> │     let v54 : string list = v16 :: v50 
> │     let v58 : string list = v14 :: v54 
> │     let v62 : string list = v13 :: v58 
> │     let v66 : string list = v12 :: v62 
> │     let v70 : string list = v11 :: v66 
> │     let v74 : string list = v9 :: v70 
> │     let v78 : string list = v8 :: v74 
> │     let v82 : string list = v6 :: v78 
> │     let v86 : string list = v4 :: v82 
> │     let v93 : (string list -> (string [])) = List.toArray
> │     let v94 : (string []) = v93 v86
> │     let v97 : string = "ISTJ"
> │     let v98 : string = "ISFJ"
> │     let v99 : string = "INFJ"
> │     let v100 : string = "INTJ"
> │     let v101 : string = "ISTP"
> │     let v102 : string = "ISFP"
> │     let v103 : string = "INFP"
> │     let v104 : string = "INTP"
> │     let v105 : string = "ESTP"
> │     let v106 : string = "ESFP"
> │     let v107 : string = "ENFP"
> │     let v108 : string = "ENTP"
> │     let v109 : string = "ESTJ"
> │     let v110 : string = "ESFJ"
> │     let v111 : string = "ENFJ"
> │     let v112 : string = "ENTJ"
> │     let v113 : (string []) = [|v97; v98; v99; v100; v101; 
> v102; v103; v104; v105; v106; v107; v108; v109; v110; v111; v112|]
> │     let v115 : bool = v94 = v113 
> │     let v119 : bool =
> │         if v115 then
> │             true
> │         else
> │             method1(v115)
> │     let v120 : string = "__assert_eq'"
> │     let v121 : string = method2(v120, v113)
> │     let v123 : unit = ()
> │     let v124 : (unit -> unit) = closure1(v121)
> │     let v125 : unit = (fun () -> v124 (); v123) ()
> │     let v127 : bool = v119 = false
> │     if v127 then
> │         failwith<unit> v121
> │ method0()
> │ 
> │ { name = __assert_eq'; expected = [|"ISTJ"; "ISFJ"; "INFJ"; 
> "INTJ"; "ISTP"; "ISFP"; "INFP"; "INTP"; "ESTP"; "ESFP";
> │   "ENFP"; "ENTP"; "ESTJ"; "ESFJ"; "ENFJ"; "ENTJ"|] }
> │ 
> 
> ── fsharp ──────────────────────────────────────────────────────────────────────
> type PhonologicalFeature =
>     | VowelFeature of
>         height: Height
>         * backness: Backness
>         * roundedness: Roundedness
>         * tone: Option<Tone>
>         * stress: Option<Stress>
>         * length: Option<Length>
>     | ConsonantFeature of
>         place: PlaceOfArticulation
>         * manner: MannerOfArticulation
>         * voicing: Voicing
>         * length: Option<Length>
>     | VowelHarmonyFeature
>     | PitchAccentFeature
> 
> and Stress = Primary | Secondary
> and Length = Long | Short | HalfLong
> 
> and Height =
>     | High | NearHigh | HighMid
>     | Mid | LowMid | NearLow
>     | Low
> 
> and Backness = Front | Central | Back
> 
> and Roundedness = Rounded | Unrounded
> 
> and PlaceOfArticulation =
>     | Bilabial | Labiodental | Dental
>     | Alveolar | Postalveolar | Retroflex
>     | Palatal | Velar | Uvular
>     | Pharyngeal | Epiglottal | Glottal
> 
> and MannerOfArticulation =
>     | Plosive | Nasal | Trill
>     | TapOrFlap | Fricative | LateralFricative
>     | Approximant | LateralApproximant
> 
> and Voicing = Voiced | Voiceless
> 
> and SecondaryArticulation =
>     | Labialization | Palatalization | Velarization
>     | Pharyngealization | Aspiration
> 
> and Tone =
>     | LevelTone of int
>     | ContourTone of int list
> 
> and MorphologicalFeature =
>     | RootFeature of string
>     | AffixFeature of AffixType * string
>     | IncorporationFeature of string * MorphologicalFeature
>     | NonConcatenativePattern of string * string
>     | AgglutinativeAffixFeature of AgglutinativeAffixType * string
>     | HonorificFeature of HonorificType * string
> 
> and AgglutinativeAffixType = Suffix | Prefix
> 
> and HonorificType = VerbHonorific | NounHonorific
> 
> and AffixType =
>     | Prefix | Suffix | Infix
>     | Circumfix
> 
> type SyntacticFeature =
>     | WordFeature of MorphologicalFeature list * LexicalCategory
>     | PhraseFeature of PhraseType * SyntacticFeature list
>     | GrammaticalRelation of GrammaticalRelationType * SyntacticFeature list
>     | SOVOrderFeature
>     | TopicCommentFeature
> 
> and GrammaticalRelationType =
>     | Ergative | Absolutive | Nominative
>     | Accusative
> 
> and LexicalCategory =
>     | Noun | Verb | Adjective
>     | Adverb | Pronoun | Preposition
>     | Conjunction | Determiner | Interjection
> 
> and PhraseType =
>     | NP | VP | AP
>     | PP | CP
> 
> and SemanticFeature =
>     | Meaning of string
>     | SemanticRole of SemanticRoleType * SemanticFeature
> 
> and SemanticRoleType =
>     | Agent | Patient | Instrument
>     | Location | Time | Cause
> 
> and PragmaticFeature =
>     | UseContext of string
>     | PolitenessLevel of Politeness
>     | SpeechAct of SpeechActType
>     | SpeechLevel of SpeechLevelType
> 
> and Politeness = Formal | Informal | Neutral
> 
> and SpeechActType =
>     | Assertive | Directive | Commissive
>     | Expressive | Declarative
> 
> and SpeechLevelType =
>     | FormalHigh | FormalLow | InformalHigh
>     | InformalLow | Neutral
> 
> type LinguisticFeature =
>     | Phonological of PhonologicalFeature
>     | Morphological of MorphologicalFeature
>     | Syntactic of SyntacticFeature
>     | Semantic of SemanticFeature
>     | Pragmatic of PragmaticFeature
> 
> type LanguageConstruct =
>     | LanguageElement of LinguisticFeature
>     | LanguageStructure of LanguageConstruct list
>     | TranslationElement of TranslationFeature
> 
> and TranslationFeature =
>     | LinkedPhonological of PhonologicalFeature * PhonologicalFeature
>     | LinkedMorphological of MorphologicalFeature * MorphologicalFeature
>     | LinkedSyntactic of SyntacticFeature * SyntacticFeature
>     | LinkedSemantic of SemanticFeature * SemanticFeature
> 
> type Discourse = DiscourseUnit of LanguageConstruct list
> 
> type LanguageModel =
>     | Model of discourse: Discourse
> 
> ── fsharp ──────────────────────────────────────────────────────────────────────
> let testEnglish =
>     Model(
>         DiscourseUnit [[
>             LanguageElement (Phonological (ConsonantFeature (Alveolar, Nasal, 
> Voiced, Some(HalfLong))));
>             LanguageElement (Phonological (VowelFeature (High, Front, Unrounded,
> Some(LevelTone 1), Some(Primary), Some(Short))));
>             LanguageElement (Phonological (VowelFeature (Low, Front, Unrounded, 
> Some(LevelTone 2), Some(Secondary), Some(Long))));
>             LanguageElement (Phonological (ConsonantFeature (Velar, Plosive, 
> Voiceless, Some(HalfLong))));
>             LanguageElement (Morphological (RootFeature "I"));
>             LanguageElement (Morphological (RootFeature "see"));
>             LanguageElement (Morphological (RootFeature "a"));
>             LanguageElement (Morphological (RootFeature "cat"));
>             LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 
> ([[RootFeature "I"]], Pronoun)]])));
>             LanguageElement (Syntactic (PhraseFeature (VP, [[WordFeature 
> ([[RootFeature "see"]], Verb)]])));
>             LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 
> ([[RootFeature "a"; RootFeature "cat"]], Noun)]])));
>             LanguageElement (Semantic (Meaning "Perception act of a feline by 
> the speaker"));
>             LanguageElement (Pragmatic (UseContext "Statement of an action being
> observed"))
>         ]]
>     )
> 
> let testPortuguese =
>     Model(
>         DiscourseUnit [[
>             LanguageElement (Phonological (VowelFeature (High, Front, Unrounded,
> Some(LevelTone 1), Some(Primary), Some(Short))));
>             LanguageElement (Phonological (VowelFeature (Low, Front, Unrounded, 
> Some(LevelTone 2), Some(Secondary), Some(Long))));
>             LanguageElement (Phonological (VowelFeature (Mid, Back, Rounded, 
> Some(LevelTone 3), Some(Primary), Some(Short))));
>             LanguageElement (Phonological (ConsonantFeature (Velar, Plosive, 
> Voiceless, Some(HalfLong))));
>             LanguageElement (Morphological (RootFeature "Eu"));
>             LanguageElement (Morphological (RootFeature "ver" |> ignore; 
> AffixFeature (Suffix, "o")));
>             LanguageElement (Morphological (RootFeature "um"));
>             LanguageElement (Morphological (RootFeature "gato"));
>             LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 
> ([[RootFeature "Eu"]], Pronoun)]])));
>             LanguageElement (Syntactic (PhraseFeature (VP, [[WordFeature 
> ([[RootFeature "vejo"]], Verb)]])));
>             LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 
> ([[RootFeature "um"; RootFeature "gato"]], Noun)]])));
>             LanguageElement (Semantic (Meaning "Ação de percepção de um felino 
> pelo falante"));
>             LanguageElement (Pragmatic (UseContext "Declaração de uma ação sendo
> observada"))
>         ]]
>     )
> 
> let testKorean =
>     Model(
>         DiscourseUnit [[
>             LanguageElement (Phonological (ConsonantFeature (Alveolar, Nasal, 
> Voiced, Some(Short))));
>             LanguageElement (Phonological (VowelFeature (High, Back, Rounded, 
> None, None, Some(Short))));
>             LanguageElement (Phonological (VowelFeature (Mid, Front, Unrounded, 
> None, None, Some(Long))));
>             LanguageElement (Phonological (ConsonantFeature (Bilabial, Plosive, 
> Voiceless, Some(Short))));
>             LanguageElement (Morphological (RootFeature "나"));
>             LanguageElement (Morphological (RootFeature "보다"));
>             LanguageElement (Morphological (AffixFeature (Suffix, "아")));
>             LanguageElement (Morphological (RootFeature "고양이"));
>             LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 
> ([[RootFeature "나"]], Pronoun)]])));
>             LanguageElement (Syntactic (PhraseFeature (VP, [[WordFeature 
> ([[RootFeature "보다"; AffixFeature (Suffix, "아")]], Verb)]])));
>             LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 
> ([[RootFeature "고양이"]], Noun)]])));
>             LanguageElement (Semantic (Meaning "화자에 의한 고양이의 관찰 
> 행위"));
>             LanguageElement (Pragmatic (UseContext "관찰되고 있는 행동의 진술"))
>         ]]
>     )
> 
> ── markdown ────────────────────────────────────────────────────────────────────
> │ ## main
> 
> ── spiral ──────────────────────────────────────────────────────────────────────
> inl main (_args : array_base string) =
>     0i32
> 
> inl main () =
>     $'let main args = !main args' : ()
> 
> ── spiral ──────────────────────────────────────────────────────────────────────
> inl app () =
>     "test" |> console.write_line
>     0i32
> 
> inl main () =
>     print_static "<test>"
> 
>     app
>     |> dyn
>     |> ignore
> 
>     print_static "</test>"
00:00:11 v #3 runtime.execute_with_options / result / { file_name = dotnet; exit_code = 0; std_trace_length = 36684 }
00:00:11 d #4 runtime.execute_with_options / { file_name = jupyter; arguments = ["nbconvert", "/home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib.ipynb", "--to", "html", "--HTMLExporter.theme=dark"]; options = { command = jupyter nbconvert "/home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib.ipynb" --to html --HTMLExporter.theme=dark; cancellation_token = None; environment_variables = Array(MutCell([])); on_line = None; stdin = None; trace = true; working_directory = None; stderr = true } }
00:00:12 v #5 ! [NbConvertApp] Converting notebook /home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib.ipynb to html
00:00:12 v #6 ! /opt/hostedtoolcache/Python/3.12.10/x64/lib/python3.12/site-packages/nbformat/__init__.py:96: MissingIDFieldWarning: Cell is missing an id field, this will become a hard error in future nbformat versions. You may want to use `normalize()` on your notebooks before validations (available since nbformat 5.1.4). Previous versions of nbformat are fixing this issue transparently, and will stop doing so in the future.
00:00:12 v #7 !   validate(nb)
00:00:12 v #8 ! /opt/hostedtoolcache/Python/3.12.10/x64/lib/python3.12/site-packages/nbconvert/filters/highlight.py:71: UserWarning: IPython3 lexer unavailable, falling back on Python 3
00:00:12 v #9 !   return _pygments_highlight(
00:00:13 v #10 ! [NbConvertApp] Writing 338531 bytes to /home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib.html
00:00:13 v #11 runtime.execute_with_options / result / { file_name = jupyter; exit_code = 0; std_trace_length = 916 }
00:00:13 d #12 spiral.process_dib / dib / jupyter nbconvert / { exit_code = 0; jupyter_result_length = 916 }
00:00:13 d #13 runtime.execute_with_options / { file_name = pwsh; arguments = ["-c", "$counter = 1; $path = '/home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib.html'; (Get-Content $path -Raw) -replace '(id=\\\"cell-id=)[a-fA-F0-9]{8}', { $_.Groups[1].Value + $counter++ } | Set-Content $path"]; options = { command = pwsh -c "$counter = 1; $path = '/home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib.html'; (Get-Content $path -Raw) -replace '(id=\"cell-id=)[a-fA-F0-9]{8}', { $_.Groups[1].Value + $counter++ } | Set-Content $path"; cancellation_token = None; environment_variables = Array(MutCell([])); on_line = None; stdin = None; trace = true; working_directory = None; stderr = true } }
00:00:13 v #14 runtime.execute_with_options / result / { file_name = pwsh; exit_code = 0; std_trace_length = 0 }
00:00:13 d #15 spiral.run / dib / html cell ids / { exit_code = 0; pwsh_replace_html_result_length = 0 }
00:00:13 d #16 spiral.process_dib / dib / { exit_code = 0; result_length = 37659 }
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        72G   71G  1.3G  99% /
tmpfs           7.9G   84K  7.9G   1% /dev/shm
tmpfs           3.2G  2.9M  3.2G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda16      881M   60M  760M   8% /boot
/dev/sda15      105M  6.2M   99M   6% /boot/efi
/dev/sdb1        74G  4.1G   66G   6% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001

parse the .dib file into .spi format with dibparser¶

In [ ]:
{ . ../../../../apps/parser/dist/DibParser$(_exe) test.dib spi } | Invoke-Block
00:00:00 d #1 writeDibCode / output: Spi / path: test.dib
00:00:00 d #2 parseDibCode / output: Spi / file: test.dib
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        72G   71G  1.3G  99% /
tmpfs           7.9G   84K  7.9G   1% /dev/shm
tmpfs           3.2G  2.9M  3.2G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda16      881M   60M  760M   8% /boot
/dev/sda15      105M  6.2M   99M   6% /boot/efi
/dev/sdb1        74G  4.1G   66G   6% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001

build .fsx file from .spi using supervisor¶

In [ ]:
{ . ../../../../apps/spiral/dist/Supervisor$(_exe) --build-file test.spi test.fsx } | Invoke-Block
<test>
</test>
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        72G   71G  1.3G  99% /
tmpfs           7.9G   84K  7.9G   1% /dev/shm
tmpfs           3.2G  2.9M  3.2G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda16      881M   60M  760M   8% /boot
/dev/sda15      105M  6.2M   99M   6% /boot/efi
/dev/sdb1        74G  4.1G   66G   6% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001

compile and format the project¶

compile project with fable targeting optimized rust¶

In [ ]:
dotnet fable --optimize --lang rs --extension .rs
Fable 5.0.0-alpha.9: F# to Rust compiler (status: alpha)

Thanks to the contributor! @chadunit
Stand with Ukraine! https://standwithukraine.com.ua/

Parsing test.fsproj...
Project and references (1 source files) parsed in 2418ms

Started Fable compilation...

Fable compilation finished in 1125ms

./test.fsx(11,0): (11,2) warning FABLE: For Rust, support for F# static and module do bindings is disabled by default. It can be enabled with the 'static_do_bindings' feature. Use at your own risk!

fix formatting issues in the .rs file using regex and set-content¶

In [ ]:
(Get-Content test.rs) `
    -replace [regex]::Escape("),);"), "));" `
    | FixRust `
| Set-Content test.rs

format the rust code using cargo fmt¶

In [ ]:
cargo fmt --

build and test the project¶

build the project in release mode using nightly rust compiler¶

In [ ]:
cargo build --release
warning: /home/runner/work/polyglot/polyglot/apps/spiral/temp/extension/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/apps/spiral/temp/test/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/examples/rust/exercism/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/apps/plot/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/apps/chat/contract/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/lib/math/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/apps/spiral/temp/cube/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/apps/chat/contract/tests/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
   Compiling getrandom v0.3.4
   Compiling num-traits v0.2.19
   Compiling once_cell v1.21.3
   Compiling syn v2.0.108
   Compiling ppv-lite86 v0.2.21
   Compiling wait-timeout v0.2.1
   Compiling rand_core v0.9.3
   Compiling tempfile v3.23.0
   Compiling bit-vec v0.8.0
   Compiling quick-error v1.2.3
   Compiling rand v0.9.2
   Compiling bit-set v0.8.0
   Compiling rusty-fork v0.3.1
   Compiling rand_xorshift v0.4.0
   Compiling rand_chacha v0.9.0
   Compiling memchr v2.7.6
   Compiling unarray v0.1.4
   Compiling fable_library_rust v0.1.0 (/home/runner/work/polyglot/polyglot/lib/rust/fable/fable_modules/fable-library-rust)
   Compiling proptest v1.8.0
   Compiling nom v7.1.3
   Compiling thiserror-impl v1.0.65
   Compiling thiserror v1.0.65
   Compiling spiral_temp_test v0.0.1 (/home/runner/work/polyglot/polyglot/apps/spiral/temp/test)
    Finished `release` profile [optimized] target(s) in 8.19s

run release tests with output enabled¶

In [ ]:
{ cargo test --release -- --show-output } | Invoke-Block
warning: /home/runner/work/polyglot/polyglot/apps/spiral/temp/extension/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/apps/spiral/temp/test/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/apps/chat/contract/tests/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/apps/plot/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/apps/spiral/temp/cube/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/lib/math/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/apps/chat/contract/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /home/runner/work/polyglot/polyglot/examples/rust/exercism/Cargo.toml: the cargo feature `edition2024` has been stabilized in the 1.85 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
   Compiling getrandom v0.3.4
   Compiling bitflags v2.10.0
   Compiling linux-raw-sys v0.11.0
   Compiling fastrand v2.3.0
   Compiling rand_core v0.9.3
   Compiling once_cell v1.21.3
   Compiling ppv-lite86 v0.2.21
   Compiling wait-timeout v0.2.1
   Compiling quick-error v1.2.3
   Compiling fnv v1.0.7
   Compiling rustix v1.1.2
   Compiling bit-vec v0.8.0
   Compiling rand_chacha v0.9.0
   Compiling num-traits v0.2.19
   Compiling bit-set v0.8.0
   Compiling rand v0.9.2
   Compiling rand_xorshift v0.4.0
   Compiling lazy_static v1.5.0
   Compiling unarray v0.1.4
   Compiling memchr v2.7.6
   Compiling minimal-lexical v0.2.1
   Compiling fable_library_rust v0.1.0 (/home/runner/work/polyglot/polyglot/lib/rust/fable/fable_modules/fable-library-rust)
   Compiling nom v7.1.3
   Compiling thiserror v1.0.65
   Compiling tempfile v3.23.0
   Compiling rusty-fork v0.3.1
   Compiling proptest v1.8.0
   Compiling spiral_temp_test v0.0.1 (/home/runner/work/polyglot/polyglot/apps/spiral/temp/test)
    Finished `release` profile [optimized] target(s) in 14.30s
     Running unittests main.rs (/home/runner/work/polyglot/polyglot/workspace/target/release/deps/spiral_temp_test-c0ed6e30c45c40aa)

running 3 tests
test test_parse_number ... ok
test prop_parse_format_idempotent ... ok
test adding_and_then_removing_an_item_from_the_cart_leaves_the_cart_unchanged ... ok

successes:

---- prop_parse_format_idempotent stdout ----
input=Comment(", D=u./3=$3P.\"/]yd9_I.(i':'D*")
input=Operator(")")
input=Identifier("gdvBK1V")
input=Identifier("Y")
input=StringLiteral("wfT/:OO>_6$;4zAvj^")
input=Operator("-")
input=Comment("H**<wx`NA\"&.\\\\'t<2yL%:Jkl<=vq$")
input=Integer(3254716682343130)
input=Identifier("cH")
input=Comment("K?53Op/E@")
input=Identifier("Rhuc9lXsjyABK6S756DCUC9i3")
input=Integer(5970387550348161001)
input=Identifier("u0Bp1")
input=Identifier("vpV4xrj2")
input=Integer(-1973650233373712694)
input=Integer(-9202058650063165880)
input=StringLiteral("g")
input=Operator("*")
input=Integer(3790587360296263250)
input=Operator("=")
input=StringLiteral("-@{?rkV[k=`3. JW`99}2U,t")
input=Comment("[UK.g#0\"60qx:.l.o\\?Y@muBi:oqs`")
input=StringLiteral("<uI=S'9}M?")
input=Comment("L?&eB`~=++;MF'dq;C'>ws")
input=StringLiteral("`'*vw'*s_?=/lT`K/:P*P&Xqk")
input=StringLiteral("W:U%}$ qv&Ho'*X;W.ac.4'>_.{v")
input=StringLiteral("i>A%*:SVlc$*.K` Z[:+2$TZln6=6T")
input=StringLiteral(":=%#")
input=StringLiteral("$.$ivj'ab:^X?0cZ}xM=")
input=StringLiteral("x")
input=Comment("hV:Td&S&H$!u]1\\C")
input=Integer(2486773627882850157)
input=Operator("+")
input=Integer(-2840562025131793445)
input=Integer(3511149337203902176)
input=Comment("Ky)_\"_:<9:G\\ D$")
input=Integer(-7351185395124156346)
input=Operator("*")
input=Operator("(")
input=Comment("_}seb:`+U")
input=StringLiteral("VY`.hS.cx:&I%`@J$Cq&p$5")
input=Comment("XXR(a<:yXR1}-B\"^0%f?H.?5e<\\%")
input=Integer(2689891956725378611)
input=Comment("4\".}AYB?/")
input=Integer(-835461067742374846)
input=Identifier("P78hbnuz6vn0Lpc6HC3VV")
input=Operator("*")
input=Comment("?rVu(&FQsv`CD*!0$/KWB\\gY3")
input=Identifier("XxjZFdLhW9WmgPX2y1Aq2Tsr")
input=Integer(2051765712981064259)
input=Comment("55")
input=Comment("uq><c~mn\\*v<{k&")
input=Operator("+")
input=Identifier("TyuDGa6sNWgowQ7IqtHoW")
input=Integer(2764428062760105963)
input=Integer(3436532765995509972)
input=StringLiteral("h;Gvz</gxQe=:F%$>OrMT(%_*{c=t")
input=Comment("j<={+[")
input=Integer(3798584063936527472)
input=Identifier("lN78X05pok3eQ2c2KmX0a9UKd8e")
input=Comment("^y<?/+b")
input=StringLiteral("7*c`:er1nUj~")
input=StringLiteral("*Vsa`s>&'p7oD'RlxB")
input=Identifier("VPjT3jkC9rZTM7qvsaxP0XYB5mXq")
input=Operator(")")
input=Integer(-1364172603114105189)
input=Integer(-1644939504737212817)
input=Comment("=/d(O/b?sD/^\"~e?r.")
input=Identifier("Yy01mjDM7cd79JEMz77XvC247GddC")
input=Comment("tl%<I*oz{t,.&B\",U")
input=Integer(781262307945941307)
input=StringLiteral("O^8&@%")
input=Integer(-8479847129279516922)
input=Operator("-")
input=Comment(",nb\\*1=<?")
input=Operator("(")
input=Integer(8709699706890558379)
input=Identifier("jTNGAlNS0f3WSkCXgXovuSU9")
input=StringLiteral("")
input=StringLiteral("-9$}ZG[C{")
input=StringLiteral("=)Kk")
input=Operator("(")
input=Comment("/b(Yo2")
input=Comment("?~*-7K^Tjr?Km")
input=StringLiteral("0/s$.:o($Cv")
input=Identifier("y0fZ1TlrHHbR3ZCCAF3EP7JNK3075")
input=Operator("=")
input=StringLiteral("1<>Ge?&DP<ROw")
input=Integer(-7904260137926300606)
input=Integer(-596606463631887870)
input=Comment("*`:cf$L/")
input=Integer(-8868779921184230990)
input=StringLiteral("s&X$3pR")
input=Comment("ei%/Kpl9L?w")
input=Identifier("oAge")
input=Comment(".ST%7b}cJhu&)<u%?#f<{e$")
input=Integer(144424718090310814)
input=Operator("+")
input=StringLiteral("@<:Xm.KW.^`D.$<H/pK$:x")
input=Identifier("aw2SVo")
input=StringLiteral("!q6")
input=Comment(";k^\"{b_;1v")
input=StringLiteral("=")
input=Operator("-")
input=StringLiteral("m<%!:*:/")
input=Identifier("e1x6FFS2fA4DutO")
input=StringLiteral("<:6]p@GDm:%sY$|i^gP~")
input=Operator("*")
input=Comment("H@/)%ld\\)3n?|H'#;?5<6$=t")
input=Comment("mH-Q1eP.?P#&")
input=Operator("*")
input=Integer(-7223444436744214881)
input=Integer(-5445650598251318373)
input=Comment("/ZD]tYYO%:@0<=tqGTDR<")
input=Comment("n\\'")
input=Identifier("b37eCaZ2dLzzLEz")
input=StringLiteral("O&QwHAARLP`fj*%")
input=Operator("=")
input=Operator(")")
input=StringLiteral("D8..*=uYo@qk")
input=Integer(2903307071158933731)
input=Identifier("xShxT7gw8RgKvkF4yfl0dwrNDJbyp")
input=Integer(-7576477206470030630)
input=StringLiteral(",po=x*tE`VKBBW&NP?au")
input=Operator("/")
input=StringLiteral("")
input=Integer(-3484983273585528442)
input=StringLiteral("pSL/*^%*O/jJ..p;D./!)g$@")
input=Integer(6900252039083050848)
input=StringLiteral(",<.&{`V.29Gm$&")
input=Comment("'p?<\"*$&0*o")
input=Identifier("caDwyHOx21LjgzmTQ3M2n99D")
input=StringLiteral("")
input=Identifier("aTenM6tJvDrv8qxrME6hhc")
input=Operator("/")
input=Integer(-2811320112172631932)
input=StringLiteral("Z?<`&-%%<i0{t$n?4.>&>z?92")
input=Comment("9:)%:d\"=[c~/)`*:.^`jka){(j")
input=Operator("*")
input=StringLiteral("e%UD`:")
input=Identifier("iTQMvyONqm")
input=Identifier("ZKI63MUASNzVy11")
input=Identifier("y9DJ7o7QVDGVdu5J6sFj3p33R57H")
input=Comment("fD")
input=Comment("-dn?ej,{<F/x1C")
input=Operator(")")
input=Integer(8246532509439499726)
input=Comment("2|y&1<-$c?y.`?/Z$E=I")
input=StringLiteral("N'$:=.pM2LZ=Q!2?,$%Ld")
input=Operator("+")
input=Integer(1196031089773540396)
input=Comment("`0.\"~s]=+d9%!L\\&*")
input=Identifier("lB6I230TSd7PQWCS6y")
input=Operator("=")
input=Comment("N")
input=Operator("*")
input=StringLiteral("K>z:")
input=Integer(-8370899196142775138)
input=Identifier("IVGz0dbNV71xA6VBwUbZY6lm")
input=Identifier("GE3swWOgPg4i4yAc5x9cuZw1v")
input=StringLiteral(" X$( FDWyG:a0&")
input=Operator("/")
input=Identifier("TB7fbhA1JiT4tq6a")
input=Operator("+")
input=Identifier("C")
input=Comment("=l$#\\'")
input=Comment("&C/Tb{g")
input=Identifier("uhiBnITBKE2mL4BwwRJ3F17cid")
input=Comment("zeU_ Wld*,G\\k*;]\\G:;y06/R*`")
input=Comment(")\"``7Q?&`~s<b:=U,y|?n")
input=Operator("*")
input=StringLiteral("K.z'f$}%ef$$=")
input=Comment("T/{ !}`.\\`h;^UiC0\">")
input=Operator("*")
input=Integer(5851089903806853477)
input=Comment("7QR")
input=Operator("/")
input=StringLiteral("TeQ%/;P+h@*")
input=Operator("=")
input=Operator("(")
input=Identifier("YzwETPlk59w8rtNrZQB1vJZFZFo")
input=Identifier("eTYdwUeDHue8MdOOgSx8i")
input=Comment("xx")
input=Comment("$cx?Y}~\"F.")
input=Integer(316713245040742411)
input=Integer(-8551496228526523328)
input=Identifier("mm72Yyb5MCKoiIsmmIjEKsrw")
input=Identifier("bWcA4n")
input=Identifier("v6p5")
input=Integer(71261305680429842)
input=Identifier("YikOqJgGIE")
input=Operator(")")
input=StringLiteral("!*")
input=Comment("i\"8X")
input=Integer(8968176081369748031)
input=Integer(8268638882523298901)
input=StringLiteral("$CVY+o$x0")
input=Operator(")")
input=Identifier("jhrsIJ6W0leypT2igdmxaVjtB9WY7n6rd")
input=Comment("(1z2?E^I|e={&K<`]m`')&")
input=Comment("Nv<k-@%l?QK")
input=Identifier("H1H25fU5WR39W1vbU2e2fJr")
input=Operator("-")
input=StringLiteral("&H,?b9h([a(%r=<0jU{[l/")
input=Integer(-73470528393457091)
input=Integer(-2918962040521662859)
input=Operator("-")
input=StringLiteral("`_CRy{NM%]'.{AIv4U8?49")
input=Operator("(")
input=Integer(-2952898845258679551)
input=Identifier("OAMbngo5ILXjzef8FKHgWR6diW4e")
input=Comment("E+")
input=Comment("`e.xls{I{**j+h3B&6$`>:\\A")
input=StringLiteral("&Bct%>1Z.?-B")
input=Integer(944022752045630443)
input=Comment("*4Ah&<DIrv*Q.=;l%04{lfK#&Rp.kt[")
input=Integer(8020346526937923684)
input=Integer(-8583873124768584454)
input=StringLiteral("p:`(")
input=Comment("ndFVeH3^*{}*bI..~")
input=Operator("=")
input=Comment("5)H~<&:")
input=Operator("-")
input=Integer(-2709118705480835864)
input=StringLiteral("bc.(:*|1!O<$7Md<&'I:Vs:%")
input=Comment("%\\'PF.Bn,$v")
input=Integer(6081200865319377753)
input=StringLiteral("5/li~%)%#x")
input=StringLiteral("{m|?v`?#J26?%`p!f!")
input=Operator("(")
input=StringLiteral("+/$6t!/`*9vr&}/v")
input=StringLiteral("P+EX}1w:*bV*/")
input=Comment("?|!\\k&1`%")
input=StringLiteral("{Yu")
input=Operator("(")
input=Identifier("zZn4y1uu40OZ4WjV93YiAZ2FhQk5")
input=StringLiteral("X`=y{")
input=Identifier("CsFlo310xgJ3z3KZCAjqwbksvW3lTWU")
input=Comment("\\5Z{a&U%a&W=$OE[:cEl*q@Y\\xQ1?/g,")
input=StringLiteral("-/$:|/S*tjA#'V")
input=Operator(")")
input=Integer(2229327399005467764)
input=Operator("/")
input=Integer(2763697990425188075)
input=Comment("*t!>uFd3A%\\&+{&Z{{tr.")
input=Integer(5841721542297209795)
input=Integer(-2865086587034613803)
input=Comment("tX,X.r/@\\7")
input=Identifier("eM1jnPe4vyW4j5MjStooO5eeC")
input=StringLiteral("L4yb8_&ophPl4^=CW@")
input=StringLiteral("t'?r&V%zU~U*w%<&|YKb:%j/51%]q`x?")
input=StringLiteral("BC)W6}?gW=A)=`")
input=Identifier("s")
input=Operator("=")
input=Integer(4293736778719715982)
input=Comment("L`we*")


successes:
    adding_and_then_removing_an_item_from_the_cart_leaves_the_cart_unchanged
    prop_parse_format_idempotent
    test_parse_number

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s

Filesystem      Size  Used Avail Use% Mounted on
/dev/root        72G   71G  1.2G  99% /
tmpfs           7.9G   84K  7.9G   1% /dev/shm
tmpfs           3.2G  2.9M  3.2G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda16      881M   60M  760M   8% /boot
/dev/sda15      105M  6.2M   99M   6% /boot/efi
/dev/sdb1        74G  4.1G   66G   6% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001

execute the binary in release mode¶

In [ ]:
{ . $ScriptDir/../../../../workspace/target/release/spiral_temp_test$(_exe) } | Invoke-Block
app=test
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        72G   71G  1.2G  99% /
tmpfs           7.9G   84K  7.9G   1% /dev/shm
tmpfs           3.2G  2.9M  3.2G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda16      881M   60M  760M   8% /boot
/dev/sda15      105M  6.2M   99M   6% /boot/efi
/dev/sdb1        74G  4.1G   66G   6% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001