test¶
include scripts¶
include notebook core¶
In [ ]:
. ../../../../scripts/nbs_header.ps1
Include core functions script¶
In [ ]:
. ../../../../scripts/core.ps1
Include spiral library¶
In [ ]:
. ../../../../lib/spiral/lib.ps1
execute project commands¶
run notebook with retries using spiral supervisor¶
In [ ]:
{ . ../../../../apps/spiral/dist/Supervisor$(_exe) --execute-command "../../../../workspace/target/release/spiral_builder$(_exe) dib --path test.dib --retries 3" } | Invoke-Block
00:00:00 v #1 networking.test_port_open / { port = 13806; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:00 d #1 runtime.execute_with_options_async / { file_name = ../../../../workspace/target/release/spiral_builder; arguments = US5_0 "dib --path test.dib --retries 3"; options = { command = ../../../../workspace/target/release/spiral_builder dib --path test.dib --retries 3; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = None; stdin = None; trace = true; working_directory = None } } 00:00:00 v #2 > 00:00:00 d #1 spiral_builder.main / { args = Array(MutCell(["dib", "--path", "test.dib", "--retries", "3"])) } 00:00:00 v #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 } } 00:00:01 v #4 > > 00:00:01 v #5 > > ── markdown ──────────────────────────────────────────────────────────────────── 00:00:01 v #6 > > ╭──────────────────────────────────────────────────────────────────────────────╮ 00:00:01 v #7 > > │ # test (Polyglot) │ 00:00:01 v #8 > > ╰──────────────────────────────────────────────────────────────────────────────╯ 00:00:04 v #9 > > 00:00:04 v #10 > > ── spiral ────────────────────────────────────────────────────────────────────── 00:00:04 v #11 > > //// test 00:00:04 v #12 > > 00:00:04 v #13 > > open testing 00:00:08 v #14 > > 00:00:08 v #15 > > ── spiral ────────────────────────────────────────────────────────────────────── 00:00:08 v #16 > > nominal i = () 00:00:08 v #17 > > nominal e = () 00:00:08 v #18 > > nominal s = () 00:00:08 v #19 > > nominal n = () 00:00:08 v #20 > > nominal t = () 00:00:08 v #21 > > nominal f = () 00:00:08 v #22 > > nominal j = () 00:00:08 v #23 > > nominal p = () 00:00:08 v #24 > > 00:00:08 v #25 > > union sensing = 00:00:08 v #26 > > | Si : s * i 00:00:08 v #27 > > | Se : s * e 00:00:08 v #28 > > 00:00:08 v #29 > > union intuition = 00:00:08 v #30 > > | Ni : n * i 00:00:08 v #31 > > | Ne : n * e 00:00:08 v #32 > > 00:00:08 v #33 > > union thinking = 00:00:08 v #34 > > | Ti : t * i 00:00:08 v #35 > > | Te : t * e 00:00:08 v #36 > > 00:00:08 v #37 > > union feeling = 00:00:08 v #38 > > | Fi : f * i 00:00:08 v #39 > > | Fe : f * e 00:00:08 v #40 > > 00:00:08 v #41 > > union function_stack = 00:00:08 v #42 > > | FS : sensing * intuition * thinking * feeling 00:00:08 v #43 > > 00:00:08 v #44 > > union personality_type = 00:00:08 v #45 > > | ISTJ : i * s * t * j * function_stack 00:00:08 v #46 > > | ISFJ : i * s * f * j * function_stack 00:00:08 v #47 > > | INFJ : i * n * f * j * function_stack 00:00:08 v #48 > > | INTJ : i * n * t * j * function_stack 00:00:08 v #49 > > | ISTP : i * s * t * p * function_stack 00:00:08 v #50 > > | ISFP : i * s * f * p * function_stack 00:00:08 v #51 > > | INFP : i * n * f * p * function_stack 00:00:08 v #52 > > | INTP : i * n * t * p * function_stack 00:00:08 v #53 > > | ESTP : e * s * t * p * function_stack 00:00:08 v #54 > > | ESFP : e * s * f * p * function_stack 00:00:08 v #55 > > | ENFP : e * n * f * p * function_stack 00:00:08 v #56 > > | ENTP : e * n * t * p * function_stack 00:00:08 v #57 > > | ESTJ : e * s * t * j * function_stack 00:00:08 v #58 > > | ESFJ : e * s * f * j * function_stack 00:00:08 v #59 > > | ENFJ : e * n * f * j * function_stack 00:00:08 v #60 > > | ENTJ : e * n * t * j * function_stack 00:00:08 v #61 > > 00:00:08 v #62 > > 00:00:08 v #63 > > inl main () = 00:00:08 v #64 > > inl istj_stack = FS ((Si (s, i)), Ne (n, e), (Te (t, e)), (Fi (f, i))) 00:00:08 v #65 > > inl istj_personality = ISTJ (i, s, t, j, istj_stack) 00:00:08 v #66 > > // inl isfj_stack = FS ((Si (s, i)), Ne (n, e), (Fe (f, e)), (Ti (t, i))) 00:00:08 v #67 > > // inl isfj_personality = ISFJ (i, s, f, j, isfj_stack) 00:00:08 v #68 > > 00:00:08 v #69 > > ;[[ 00:00:08 v #70 > > istj_personality 00:00:08 v #71 > > ]] 00:00:08 v #72 > > |> fun x => $'$"%A{!x}"' : string 00:00:08 v #73 > > |> console.write_line 00:00:08 v #74 > > 00:00:08 v #75 > > inl main () = 00:00:08 v #76 > > $'!main ()' : () 00:00:09 v #77 > > 00:00:09 v #78 > > ╭─[ 1.31s - stdout ]───────────────────────────────────────────────────────────╮ 00:00:09 v #79 > > │ [|US5_0 (US4_0 (US0_0, US1_1, US2_1, US3_0))|] │ 00:00:09 v #80 > > │ │ 00:00:09 v #81 > > ╰──────────────────────────────────────────────────────────────────────────────╯ 00:00:10 v #82 > > 00:00:10 v #83 > > ── fsharp ────────────────────────────────────────────────────────────────────── 00:00:10 v #84 > > type PhonologicalFeature = 00:00:10 v #85 > > | VowelFeature of 00:00:10 v #86 > > height: Height 00:00:10 v #87 > > * backness: Backness 00:00:10 v #88 > > * roundedness: Roundedness 00:00:10 v #89 > > * tone: Option<Tone> 00:00:10 v #90 > > * stress: Option<Stress> 00:00:10 v #91 > > * length: Option<Length> 00:00:10 v #92 > > | ConsonantFeature of 00:00:10 v #93 > > place: PlaceOfArticulation 00:00:10 v #94 > > * manner: MannerOfArticulation 00:00:10 v #95 > > * voicing: Voicing 00:00:10 v #96 > > * length: Option<Length> 00:00:10 v #97 > > | VowelHarmonyFeature 00:00:10 v #98 > > | PitchAccentFeature 00:00:10 v #99 > > 00:00:10 v #100 > > and Stress = Primary | Secondary 00:00:10 v #101 > > and Length = Long | Short | HalfLong 00:00:10 v #102 > > 00:00:10 v #103 > > and Height = 00:00:10 v #104 > > | High | NearHigh | HighMid 00:00:10 v #105 > > | Mid | LowMid | NearLow 00:00:10 v #106 > > | Low 00:00:10 v #107 > > 00:00:10 v #108 > > and Backness = Front | Central | Back 00:00:10 v #109 > > 00:00:10 v #110 > > and Roundedness = Rounded | Unrounded 00:00:10 v #111 > > 00:00:10 v #112 > > and PlaceOfArticulation = 00:00:10 v #113 > > | Bilabial | Labiodental | Dental 00:00:10 v #114 > > | Alveolar | Postalveolar | Retroflex 00:00:10 v #115 > > | Palatal | Velar | Uvular 00:00:10 v #116 > > | Pharyngeal | Epiglottal | Glottal 00:00:10 v #117 > > 00:00:10 v #118 > > and MannerOfArticulation = 00:00:10 v #119 > > | Plosive | Nasal | Trill 00:00:10 v #120 > > | TapOrFlap | Fricative | LateralFricative 00:00:10 v #121 > > | Approximant | LateralApproximant 00:00:10 v #122 > > 00:00:10 v #123 > > and Voicing = Voiced | Voiceless 00:00:10 v #124 > > 00:00:10 v #125 > > and SecondaryArticulation = 00:00:10 v #126 > > | Labialization | Palatalization | Velarization 00:00:10 v #127 > > | Pharyngealization | Aspiration 00:00:10 v #128 > > 00:00:10 v #129 > > and Tone = 00:00:10 v #130 > > | LevelTone of int 00:00:10 v #131 > > | ContourTone of int list 00:00:10 v #132 > > 00:00:10 v #133 > > and MorphologicalFeature = 00:00:10 v #134 > > | RootFeature of string 00:00:10 v #135 > > | AffixFeature of AffixType * string 00:00:10 v #136 > > | IncorporationFeature of string * MorphologicalFeature 00:00:10 v #137 > > | NonConcatenativePattern of string * string 00:00:10 v #138 > > | AgglutinativeAffixFeature of AgglutinativeAffixType * string 00:00:10 v #139 > > | HonorificFeature of HonorificType * string 00:00:10 v #140 > > 00:00:10 v #141 > > and AgglutinativeAffixType = Suffix | Prefix 00:00:10 v #142 > > 00:00:10 v #143 > > and HonorificType = VerbHonorific | NounHonorific 00:00:10 v #144 > > 00:00:10 v #145 > > and AffixType = 00:00:10 v #146 > > | Prefix | Suffix | Infix 00:00:10 v #147 > > | Circumfix 00:00:10 v #148 > > 00:00:10 v #149 > > type SyntacticFeature = 00:00:10 v #150 > > | WordFeature of MorphologicalFeature list * LexicalCategory 00:00:10 v #151 > > | PhraseFeature of PhraseType * SyntacticFeature list 00:00:10 v #152 > > | GrammaticalRelation of GrammaticalRelationType * SyntacticFeature list 00:00:10 v #153 > > | SOVOrderFeature 00:00:10 v #154 > > | TopicCommentFeature 00:00:10 v #155 > > 00:00:10 v #156 > > and GrammaticalRelationType = 00:00:10 v #157 > > | Ergative | Absolutive | Nominative 00:00:10 v #158 > > | Accusative 00:00:10 v #159 > > 00:00:10 v #160 > > and LexicalCategory = 00:00:10 v #161 > > | Noun | Verb | Adjective 00:00:10 v #162 > > | Adverb | Pronoun | Preposition 00:00:10 v #163 > > | Conjunction | Determiner | Interjection 00:00:10 v #164 > > 00:00:10 v #165 > > and PhraseType = 00:00:10 v #166 > > | NP | VP | AP 00:00:10 v #167 > > | PP | CP 00:00:10 v #168 > > 00:00:10 v #169 > > and SemanticFeature = 00:00:10 v #170 > > | Meaning of string 00:00:10 v #171 > > | SemanticRole of SemanticRoleType * SemanticFeature 00:00:10 v #172 > > 00:00:10 v #173 > > and SemanticRoleType = 00:00:10 v #174 > > | Agent | Patient | Instrument 00:00:10 v #175 > > | Location | Time | Cause 00:00:10 v #176 > > 00:00:10 v #177 > > and PragmaticFeature = 00:00:10 v #178 > > | UseContext of string 00:00:10 v #179 > > | PolitenessLevel of Politeness 00:00:10 v #180 > > | SpeechAct of SpeechActType 00:00:10 v #181 > > | SpeechLevel of SpeechLevelType 00:00:10 v #182 > > 00:00:10 v #183 > > and Politeness = Formal | Informal | Neutral 00:00:10 v #184 > > 00:00:10 v #185 > > and SpeechActType = 00:00:10 v #186 > > | Assertive | Directive | Commissive 00:00:10 v #187 > > | Expressive | Declarative 00:00:10 v #188 > > 00:00:10 v #189 > > and SpeechLevelType = 00:00:10 v #190 > > | FormalHigh | FormalLow | InformalHigh 00:00:10 v #191 > > | InformalLow | Neutral 00:00:10 v #192 > > 00:00:10 v #193 > > type LinguisticFeature = 00:00:10 v #194 > > | Phonological of PhonologicalFeature 00:00:10 v #195 > > | Morphological of MorphologicalFeature 00:00:10 v #196 > > | Syntactic of SyntacticFeature 00:00:10 v #197 > > | Semantic of SemanticFeature 00:00:10 v #198 > > | Pragmatic of PragmaticFeature 00:00:10 v #199 > > 00:00:10 v #200 > > type LanguageConstruct = 00:00:10 v #201 > > | LanguageElement of LinguisticFeature 00:00:10 v #202 > > | LanguageStructure of LanguageConstruct list 00:00:10 v #203 > > | TranslationElement of TranslationFeature 00:00:10 v #204 > > 00:00:10 v #205 > > and TranslationFeature = 00:00:10 v #206 > > | LinkedPhonological of PhonologicalFeature * PhonologicalFeature 00:00:10 v #207 > > | LinkedMorphological of MorphologicalFeature * MorphologicalFeature 00:00:10 v #208 > > | LinkedSyntactic of SyntacticFeature * SyntacticFeature 00:00:10 v #209 > > | LinkedSemantic of SemanticFeature * SemanticFeature 00:00:10 v #210 > > 00:00:10 v #211 > > type Discourse = DiscourseUnit of LanguageConstruct list 00:00:10 v #212 > > 00:00:10 v #213 > > type LanguageModel = 00:00:10 v #214 > > | Model of discourse: Discourse 00:00:10 v #215 > > 00:00:10 v #216 > > ── fsharp ────────────────────────────────────────────────────────────────────── 00:00:10 v #217 > > let testEnglish = 00:00:10 v #218 > > Model( 00:00:10 v #219 > > DiscourseUnit [[ 00:00:10 v #220 > > LanguageElement (Phonological (ConsonantFeature (Alveolar, Nasal, 00:00:10 v #221 > > Voiced, Some(HalfLong)))); 00:00:10 v #222 > > LanguageElement (Phonological (VowelFeature (High, Front, Unrounded, 00:00:10 v #223 > > Some(LevelTone 1), Some(Primary), Some(Short)))); 00:00:10 v #224 > > LanguageElement (Phonological (VowelFeature (Low, Front, Unrounded, 00:00:10 v #225 > > Some(LevelTone 2), Some(Secondary), Some(Long)))); 00:00:10 v #226 > > LanguageElement (Phonological (ConsonantFeature (Velar, Plosive, 00:00:10 v #227 > > Voiceless, Some(HalfLong)))); 00:00:10 v #228 > > LanguageElement (Morphological (RootFeature "I")); 00:00:10 v #229 > > LanguageElement (Morphological (RootFeature "see")); 00:00:10 v #230 > > LanguageElement (Morphological (RootFeature "a")); 00:00:10 v #231 > > LanguageElement (Morphological (RootFeature "cat")); 00:00:10 v #232 > > LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 00:00:10 v #233 > > ([[RootFeature "I"]], Pronoun)]]))); 00:00:10 v #234 > > LanguageElement (Syntactic (PhraseFeature (VP, [[WordFeature 00:00:10 v #235 > > ([[RootFeature "see"]], Verb)]]))); 00:00:10 v #236 > > LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 00:00:10 v #237 > > ([[RootFeature "a"; RootFeature "cat"]], Noun)]]))); 00:00:10 v #238 > > LanguageElement (Semantic (Meaning "Perception act of a feline by 00:00:10 v #239 > > the speaker")); 00:00:10 v #240 > > LanguageElement (Pragmatic (UseContext "Statement of an action being 00:00:10 v #241 > > observed")) 00:00:10 v #242 > > ]] 00:00:10 v #243 > > ) 00:00:10 v #244 > > 00:00:10 v #245 > > let testPortuguese = 00:00:10 v #246 > > Model( 00:00:10 v #247 > > DiscourseUnit [[ 00:00:10 v #248 > > LanguageElement (Phonological (VowelFeature (High, Front, Unrounded, 00:00:10 v #249 > > Some(LevelTone 1), Some(Primary), Some(Short)))); 00:00:10 v #250 > > LanguageElement (Phonological (VowelFeature (Low, Front, Unrounded, 00:00:10 v #251 > > Some(LevelTone 2), Some(Secondary), Some(Long)))); 00:00:10 v #252 > > LanguageElement (Phonological (VowelFeature (Mid, Back, Rounded, 00:00:10 v #253 > > Some(LevelTone 3), Some(Primary), Some(Short)))); 00:00:10 v #254 > > LanguageElement (Phonological (ConsonantFeature (Velar, Plosive, 00:00:10 v #255 > > Voiceless, Some(HalfLong)))); 00:00:10 v #256 > > LanguageElement (Morphological (RootFeature "Eu")); 00:00:10 v #257 > > LanguageElement (Morphological (RootFeature "ver" |> ignore; 00:00:10 v #258 > > AffixFeature (Suffix, "o"))); 00:00:10 v #259 > > LanguageElement (Morphological (RootFeature "um")); 00:00:10 v #260 > > LanguageElement (Morphological (RootFeature "gato")); 00:00:10 v #261 > > LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 00:00:10 v #262 > > ([[RootFeature "Eu"]], Pronoun)]]))); 00:00:10 v #263 > > LanguageElement (Syntactic (PhraseFeature (VP, [[WordFeature 00:00:10 v #264 > > ([[RootFeature "vejo"]], Verb)]]))); 00:00:10 v #265 > > LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 00:00:10 v #266 > > ([[RootFeature "um"; RootFeature "gato"]], Noun)]]))); 00:00:10 v #267 > > LanguageElement (Semantic (Meaning "Ação de percepção de um felino 00:00:10 v #268 > > pelo falante")); 00:00:10 v #269 > > LanguageElement (Pragmatic (UseContext "Declaração de uma ação sendo 00:00:10 v #270 > > observada")) 00:00:10 v #271 > > ]] 00:00:10 v #272 > > ) 00:00:10 v #273 > > 00:00:10 v #274 > > let testKorean = 00:00:10 v #275 > > Model( 00:00:10 v #276 > > DiscourseUnit [[ 00:00:10 v #277 > > LanguageElement (Phonological (ConsonantFeature (Alveolar, Nasal, 00:00:10 v #278 > > Voiced, Some(Short)))); 00:00:10 v #279 > > LanguageElement (Phonological (VowelFeature (High, Back, Rounded, 00:00:10 v #280 > > None, None, Some(Short)))); 00:00:10 v #281 > > LanguageElement (Phonological (VowelFeature (Mid, Front, Unrounded, 00:00:10 v #282 > > None, None, Some(Long)))); 00:00:10 v #283 > > LanguageElement (Phonological (ConsonantFeature (Bilabial, Plosive, 00:00:10 v #284 > > Voiceless, Some(Short)))); 00:00:10 v #285 > > LanguageElement (Morphological (RootFeature "나")); 00:00:10 v #286 > > LanguageElement (Morphological (RootFeature "보다")); 00:00:10 v #287 > > LanguageElement (Morphological (AffixFeature (Suffix, "아"))); 00:00:10 v #288 > > LanguageElement (Morphological (RootFeature "고양이")); 00:00:10 v #289 > > LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 00:00:10 v #290 > > ([[RootFeature "나"]], Pronoun)]]))); 00:00:10 v #291 > > LanguageElement (Syntactic (PhraseFeature (VP, [[WordFeature 00:00:10 v #292 > > ([[RootFeature "보다"; AffixFeature (Suffix, "아")]], Verb)]]))); 00:00:10 v #293 > > LanguageElement (Syntactic (PhraseFeature (NP, [[WordFeature 00:00:10 v #294 > > ([[RootFeature "고양이"]], Noun)]]))); 00:00:10 v #295 > > LanguageElement (Semantic (Meaning "화자에 의한 고양이의 관찰 00:00:10 v #296 > > 행위")); 00:00:10 v #297 > > LanguageElement (Pragmatic (UseContext "관찰되고 있는 행동의 진술")) 00:00:10 v #298 > > ]] 00:00:10 v #299 > > ) 00:00:10 v #300 > > 00:00:10 v #301 > > ── markdown ──────────────────────────────────────────────────────────────────── 00:00:10 v #302 > > ╭──────────────────────────────────────────────────────────────────────────────╮ 00:00:10 v #303 > > │ ## main │ 00:00:10 v #304 > > ╰──────────────────────────────────────────────────────────────────────────────╯ 00:00:10 v #305 > > 00:00:10 v #306 > > ── spiral ────────────────────────────────────────────────────────────────────── 00:00:10 v #307 > > inl main (_args : array_base string) = 00:00:10 v #308 > > 0i32 00:00:10 v #309 > > 00:00:10 v #310 > > inl main () = 00:00:10 v #311 > > $'let main args = !main args' : () 00:00:11 v #312 > > 00:00:11 v #313 > > ── spiral ────────────────────────────────────────────────────────────────────── 00:00:11 v #314 > > inl app () = 00:00:11 v #315 > > "test" |> console.write_line 00:00:11 v #316 > > 0i32 00:00:11 v #317 > > 00:00:11 v #318 > > inl main () = 00:00:11 v #319 > > print_static "<test>" 00:00:11 v #320 > > 00:00:11 v #321 > > app 00:00:11 v #322 > > |> dyn 00:00:11 v #323 > > |> ignore 00:00:11 v #324 > > 00:00:11 v #325 > > print_static "</test>" 00:00:11 v #326 > 00:00:10 v #3 runtime.execute_with_options / result / { exit_code = 0; std_trace_length = 11263 } 00:00:11 v #327 > 00:00:10 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 } } 00:00:12 v #328 > 00:00:11 v #5 ! [NbConvertApp] Converting notebook /home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib.ipynb to html 00:00:12 v #329 > 00:00:11 v #6 ! /opt/hostedtoolcache/Python/3.12.8/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 #330 > 00:00:11 v #7 ! validate(nb) 00:00:12 v #331 > 00:00:11 v #8 ! /opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/nbconvert/filters/highlight.py:71: UserWarning: IPython3 lexer unavailable, falling back on Python 3 00:00:12 v #332 > 00:00:11 v #9 ! return _pygments_highlight( 00:00:12 v #333 > 00:00:12 v #10 ! [NbConvertApp] Writing 318991 bytes to /home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.dib.html 00:00:12 v #334 > 00:00:12 v #11 runtime.execute_with_options / result / { exit_code = 0; std_trace_length = 914 } 00:00:12 v #335 > 00:00:12 d #12 spiral_builder.run / dib / jupyter nbconvert / { exit_code = 0; jupyter_result_length = 914 } 00:00:12 v #336 > 00:00:12 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 } } 00:00:13 v #337 > 00:00:12 v #14 runtime.execute_with_options / result / { exit_code = 0; std_trace_length = 0 } 00:00:13 v #338 > 00:00:12 d #15 spiral_builder.run / dib / html cell ids / { exit_code = 0; pwsh_replace_html_result_length = 0 } 00:00:13 v #339 > 00:00:12 d #16 spiral_builder.run / dib / { exit_code = 0; result_length = 12236 } 00:00:13 d #340 runtime.execute_with_options_async / { exit_code = 0; output_length = 15637 } 00:00:13 d #1 main / executeCommand / exitCode: 0 / command: ../../../../workspace/target/release/spiral_builder dib --path test.dib --retries 3
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
build .fsx file from .spi using supervisor¶
In [ ]:
{ . ../../../../apps/spiral/dist/Supervisor$(_exe) --build-file test.spi test.fsx } | Invoke-Block
00:00:00 v #1 networking.test_port_open / { port = 13806; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:00 v #2 networking.test_port_open / { port = 13806; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:00 d #1 Supervisor.buildFile / takeWhileInclusive / path: test.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:00 d #2 Supervisor.buildFile / AsyncSeq.scan / path: test.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:00 d #3 Supervisor.buildFile / takeWhileInclusive / path: test.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:00 v #4 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"/// # test (Polyglot)\nnominal i = ()\nnominal e = ()\nnominal s = ()\nnomin...t\u003E\u0022\n","uri":"file:///home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.spi"}} / result: 00:00:00 v #5 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/apps/spiral/temp/test/test.spi"}} / result: 00:00:00 d #6 Supervisor.buildFile / AsyncSeq.scan / path: test.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: let rec closure1 () () : unit = let v0 : (string -> unit) = System.Console.WriteLine let v1 : string = "test" v0 v1 and closure0 () () : int32 = let v0 : unit = () let v1 : (unit -> unit) = closure1() let v2 : unit = (fun () -> v1 (); v0) () 0 let v0 : (unit -> int32) = closure0() () 00:00:00 d #7 Supervisor.buildFile / takeWhileInclusive / path: test.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: let rec closure1 () () : unit = let v0 : (string -> unit) = System.Console.WriteLine let v1 : string = "test" v0 v1 and closure0 () () : int32 = let v0 : unit = () let v1 : (unit -> unit) = closure1() let v2 : unit = (fun () -> v1 (); v0) () 0 let v0 : (unit -> int32) = closure0() () 00:00:00 d #8 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
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.2: F# to Rust compiler (status: alpha) Thanks to the contributor! @dgchurchill Stand with Ukraine! https://standwithukraine.com.ua/ Parsing test.fsproj... Project and references (1 source files) parsed in 2506ms Started Fable compilation... Fable compilation finished in 1094ms ./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
Compiling syn v2.0.90 Compiling linux-raw-sys v0.4.14 Compiling getrandom v0.2.15 Compiling num-traits v0.2.19 Compiling rand_core v0.6.4 Compiling once_cell v1.20.2 Compiling libm v0.2.11 Compiling rustix v0.38.42 Compiling wait-timeout v0.2.0 Compiling bit-vec v0.6.3 Compiling quick-error v1.2.3 Compiling bit-set v0.5.3 Compiling rand_xorshift v0.3.0 Compiling memchr v2.7.4 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 tempfile v3.14.0 Compiling zerocopy-derive v0.7.35 Compiling thiserror-impl v1.0.69 Compiling rusty-fork v0.3.0 Compiling nom v7.1.3 Compiling zerocopy v0.7.35 Compiling thiserror v1.0.69 Compiling ppv-lite86 v0.2.20 Compiling rand_chacha v0.3.1 Compiling rand v0.8.5 Compiling proptest v1.5.0 Compiling spiral_temp_test v0.0.1 (/home/runner/work/polyglot/polyglot/apps/spiral/temp/test) Finished `release` profile [optimized] target(s) in 10.81s
run release tests with output enabled¶
In [ ]:
{ cargo test --release -- --show-output } | Invoke-Block
Compiling linux-raw-sys v0.4.14 Compiling bitflags v2.6.0 Compiling zerocopy v0.7.35 Compiling fastrand v2.3.0 Compiling once_cell v1.20.2 Compiling wait-timeout v0.2.0 Compiling fnv v1.0.7 Compiling bit-vec v0.6.3 Compiling rustix v0.38.42 Compiling quick-error v1.2.3 Compiling num-traits v0.2.19 Compiling ppv-lite86 v0.2.20 Compiling bit-set v0.5.3 Compiling rand_xorshift v0.3.0 Compiling memchr v2.7.4 Compiling rand_chacha v0.3.1 Compiling rand v0.8.5 Compiling unarray v0.1.4 Compiling lazy_static v1.5.0 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.69 Compiling tempfile v3.14.0 Compiling rusty-fork v0.3.0 Compiling proptest v1.5.0 Compiling spiral_temp_test v0.0.1 (/home/runner/work/polyglot/polyglot/apps/spiral/temp/test) Finished `release` profile [optimized] target(s) in 15.09s Running unittests main.rs (/home/runner/work/polyglot/polyglot/workspace/target/release/deps/spiral_temp_test-87f487a4cc8a01e4) 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=StringLiteral("{cL|&D#ZG[q8.WW^") input=StringLiteral("5V/S5 ::`q'*~") input=Comment("p~.m9hB&i'sF=q;&#u/^PE(0e8G#4YAy") input=Integer(6863888672817773476) input=Comment("`*`yh*&W|dg)),") input=Comment("z\\{**.*&\\\"Vh{=L{&R_k-?I.,!YEq") input=StringLiteral("[To_M'ez`<zR}z$|%9") input=StringLiteral("gONIg:X>95o&?'X*Idrp$#{,t6") input=Integer(-6402043182426907513) input=Operator("+") input=Integer(7813778630973325987) input=Integer(8185880717798167956) input=Identifier("a0D33HvQcHUj1A7e7i3NOUEVz") input=Integer(-6884902152677261417) input=Identifier("ze2") input=Operator("-") input=StringLiteral("{O}*0`") input=Comment("$<q&6g`={!]/\"_+H{`*0Hb'E<B.\")") input=Comment("m=h'&sd+/t:QO?r!'K68x)$S") input=Identifier("Qm6gzSeaM8uOhxOd3E3A") input=Integer(3037092922452092996) input=StringLiteral("Y]%ba*)@8)m.tE") input=StringLiteral("5.+(45ZID") input=StringLiteral(".m&`:b{$U'`@ Ap::<?vXco+{") input=Identifier("N6lH5") input=StringLiteral("B$ UE(R7o?:&2C~S='ZzKJ;,S$'") input=Integer(6955106106396106104) input=Operator("-") input=Operator("(") input=StringLiteral("=2/z?EbO0<`A{7?,,!.IkU<&'Hb") input=Identifier("EuBr5YjEVJw") input=Operator("*") input=Operator("/") input=Integer(-5305363680673496312) input=Identifier("NyqHHXfn92LVLz23CVy3V7a4Q2X") input=StringLiteral("/BWxm//$!2Q8=n") input=Comment("\\") input=Integer(-5219720030664601541) input=Operator("-") input=Comment("`k\"{Z{q&>\"&?6+q`3<.\\fs") input=Comment("`\\L=\"P") input=Comment("?<Si*AlNG2L\"u=$~=") input=StringLiteral("z28=%$3=gg=`knT {s*s'=u`") input=Operator("(") input=Comment("?3\"rv<^)(:\"}@J'<h`<\"2[Z2") input=Integer(669351998204019972) input=Integer(9221184925297747674) input=Operator("+") input=StringLiteral("N../`>;AU$,h< a'`'M:<V=1v)qlz=") input=Integer(409395357115027303) input=Operator("=") input=Operator(")") input=Comment("\\'&/\\J") input=StringLiteral("9='-=D.`l@6:H(=<K&.v%K") input=Identifier("unS14GXoIM9dY639toRUCL") input=Integer(1444071264778416405) input=Integer(7746509505645796618) input=Identifier("TMPCU") input=Operator(")") input=Integer(-7754793209828667308) input=Identifier("UzPhKDUN") input=Integer(2436472927934603053) input=StringLiteral("'<='S/?N-N,/O^+Tt/'hG=l7b@u") input=Integer(-3718019141465902369) input=Comment("M<N=jH.") input=Operator("+") input=Integer(5232730089904896019) input=Comment("j>Qn3Y4\\1=}&3oW&D;r?c") input=Operator("*") input=Operator("-") input=Comment("a}J") input=Integer(7911736616292657106) input=Comment("\\|FJ$.`") input=StringLiteral("j&S1=.{^~1*y%kD") input=Operator("=") input=Integer(-5839137219695533225) input=Integer(-7224521667562353848) input=Integer(5690635986971255932) input=Operator("=") input=StringLiteral("i''1^%[3Ua./N-*/0#)%o:Y:%{=?&") input=Operator("=") input=Identifier("MeiW89MP66rvhAp1sx9tSd6") input=Comment("{`pjA^'*R'M:;,=zHH6\\/$S~%e{") input=Integer(1563239385320702541) input=Operator("+") input=StringLiteral("") input=Integer(-8112302154465722104) input=Identifier("dCRe1Pkd8o5M8") input=Identifier("Z7960j1sFdsycH73") input=Operator("(") input=Comment("=E:a.1S*7\":|3^\"Y&',:xNm.o.M)Y|G") input=Operator("*") input=Comment(".") input=Comment("}DR!={Pj'n D@kr=>X\"") input=StringLiteral("8KGyu*?") input=Operator("-") input=Comment("pA.W&`[|?=P\"*T") input=Identifier("Kp0vTvvfq65") input=StringLiteral("%Wl") input=Identifier("B8c6b7nkMjLIOvln7q") input=Comment("'`,-B*'vj\"\"\".'m9`") input=StringLiteral("& ") input=Comment("*]\\R`=2Wc`w%x|SV(C/'6{&&io=&") input=Integer(-9197273982495018256) input=StringLiteral("Zx`+3}N]o~!9f=uHZ,@{*:?Xw") input=StringLiteral("'g}&zVo7yvL'7$iC=j-Pi<") input=StringLiteral("C#..59O~/`$Ue&)v./~:F{ <L") input=StringLiteral("~*Hy-Rp<)W9^$w|e//[I/?C,A") input=Identifier("p0Cp2f") input=Integer(3406459481220585544) input=Operator("=") input=Integer(2248596427955240107) input=Comment("4;_qrS|i].S.&Z]") input=Comment("\\+\"z*:\".ie/\"e<.`zk~Q~*V>>") input=Integer(4485622784276323260) input=StringLiteral("Galbp._``H*/&!3`=!l.3") input=Identifier("v86F9sUXGzKBuLOu") input=StringLiteral(".x`i4?=4*'?o.P.Y<'.b|:hK") input=StringLiteral("`?Yf=UM") input=StringLiteral("*z7<") input=StringLiteral(">Zvwn<N|qvVP]=F38") input=StringLiteral("3p*A'Q{`[5%e2:)*;|:,q") input=Identifier("v3wSTwERD7sT6GA6hA") input=Comment("!{s_9}g.") input=Integer(6727137367202072457) input=Operator("*") input=Comment("/0yf{OVTQ=w5&*i\"=4iY|q]L\"K -1c7M") input=Comment("\\") input=Identifier("T5ke48y3S0w3Gua2f3aP") input=Comment("'.f^J`/IOqOo~&]#0J_?Okdx") input=Comment("-_u\"'[5w/=`=.8J.(m*V1") input=StringLiteral("") input=Integer(5910971007861626839) input=Comment("J^NzgG*KdL7y6?fJ?,P`w=P.l`8:2@#K") input=Comment("") input=Comment("Z[&3$z&E") input=Operator("(") input=Operator("*") input=Identifier("xD5LOba6N20fpzfDpqUW") input=Identifier("cK24t") input=Integer(-5153574455339771009) input=Identifier("e4cBsVXhGIVTSS") input=Integer(8551081310231435551) input=Integer(-7750265509817789162) input=Comment("co\"N$/![($J@=7K\\O%FdULW1{]Mw!") input=Integer(4366069913443274858) input=Identifier("Lo17vKM") input=Operator(")") input=Operator("-") input=Operator("=") input=Identifier("s") input=StringLiteral("/b;D") input=Integer(-4123912386440914998) input=Identifier("XubIrsg486KwZF8xWTN9pe") input=Identifier("eMYrEMr93K4uv7Kt0") input=Identifier("kddAWRpvlr6j0fmIQIPY0z6XXu95geE") input=StringLiteral("q") input=StringLiteral("?3?B~Vl~he?C.{imPHm/G5P") input=Operator(")") input=Identifier("baHAjfRVlih1umx48bNy0E90YsS") input=Identifier("uWpJywSvs8wKCdhhRVBtT") input=Identifier("iY7SpyvEOlW0ims3") input=Integer(6117151208189200267) input=StringLiteral(":5") input=Operator("+") input=Operator("=") input=StringLiteral("D0$zL=%&$>Pay3") input=Integer(-1832405677925623849) input=StringLiteral("1LKkt`<A.:bO|<*m-7#]<a$yd<k4<$") input=Operator("*") input=Identifier("i7SmxCTgTR59WYo50qkG68Jqccuy") input=Operator("/") input=Comment("KRx\"K``&6~!&F^H<A{,") input=Identifier("LS") input=Comment("'y)G{pjadK$b!e|w") input=Comment("\"m<=&?\\.3On?v\"'&{NjcC8$|AR&kn=\\") input=Operator("*") input=Comment("IQcrO,H?g") input=Operator("/") input=Operator("-") input=Operator(")") input=StringLiteral("y?<x.'`") input=Operator("-") input=Identifier("aRU74") input=Operator("(") input=StringLiteral("]v|@'J,ekX>Z6=K')A.Z{Gf") input=Identifier("xoxMQQ") input=Operator("+") input=Operator("+") input=Integer(132428688920756290) input=Identifier("Nb58izXEnEVAOuDPk5lx65Z") input=Comment("8\\<=_H=\\{:<4") input=Operator(")") input=Operator("*") input=Comment("H#II3m\\") input=Operator("=") input=StringLiteral("Rq-Ie|!m") input=StringLiteral(".uB4YP%Ma'`BC:s8B.gR5<I") input=Operator("=") input=Identifier("z8yUecthyOi9T") input=Comment("|F2n:\"9$$6%nsd0R'coA_N1\"%=.\"i$7") input=Comment("*/Bx(\\:.``%LRh\"\\\\y\"x%%Ph4") input=Identifier("JVwy8KV4ahP8n27xL") input=Operator(")") input=Identifier("rxuATgHq7iI865KG0eR7Ru") input=Operator(")") input=Comment("/\">yhdA\"?4d$47}C}B&69@%o_MJVaIc") input=Comment("@*=lB{c3=n`") input=Operator("/") input=Integer(-5428317430862887071) input=Identifier("cdqG0sWV") input=Comment("7~") input=Identifier("nX1Jf90xZmjawoC2EY") input=Identifier("Ogpo4M6bT9bfdFEJ6jsIwyJd43ScVfG") input=Comment("b{^rHFLr<T.:]{${bc_H:*=pLI$") input=Integer(-5853553201011688688) input=StringLiteral("5$P") input=Integer(2354236087326986879) input=Comment("%R,tf~vs,yx\\_j$;0.xd<GJ%&R$CA") input=Comment("&\"'s{='w<r#wDGYX`v''u.O:/") input=Identifier("G1yqqcdWlwHN3tZz745OcTtR6Le3") input=Identifier("BRsVBXvpYe6RE6eyRa") input=Integer(-1676751130513282594) input=Identifier("p7b170RZ73eT0L64j") input=Comment("T\"m${$VsnDeDJ[KB*C>?rk#H.='=D%oZ") input=Integer(2256602692191122904) input=StringLiteral("h7''`s+/O/U`y<g8_L8") input=StringLiteral("bovGb%[{`,?#^/<t=S%Y &?dhN<A>w") input=Operator("(") input=Operator("*") input=Identifier("qE0tSU3POktrhiEdWx4lSCR9") input=Identifier("uLw6THkaU2V6lB766jjjWaH4Y5e4gA") input=Identifier("Q") input=Identifier("nxU5XbP9pOQAGfNsPhM4") input=Identifier("QAojDC80m") input=StringLiteral("orR}Vd{up'7C") input=Comment(",r?*&::u| w)M'{+R") input=Operator(")") input=Identifier("gUTRizHE0q2T794OXQ392y7CBO5orMs") input=Operator("(") input=Integer(-5749768968511538540) input=Integer(-7041357094461533638) input=StringLiteral("*?qtasBiWcJd**`P%") input=Identifier("EleO0E9GsT5BP7fXOhSARNWHu96mY69J") input=Operator("/") input=Comment("i\"JF!\\%\\96?[G_F$[\\") input=Integer(-5626458154578279213) input=Identifier("LM0IREltnFD") input=Operator("-") input=Operator("/") input=Comment("O#") input=Operator("(") input=Operator("+") input=Comment("e'dAq$)X\\pk.\\q7TI!*") input=StringLiteral("./C@CK]+'H:,:L") input=Integer(2477830687989065728) 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
execute the binary in release mode¶
In [ ]:
{ . $ScriptDir/../../../../workspace/target/release/spiral_temp_test$(_exe) } | Invoke-Block
app=test