diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 5f9a06ae..324b18da 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -35,6 +35,14 @@ jobs: with: python-version: '3.12' + - uses: Jimver/cuda-toolkit@v0.2.15 + + - uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + - run: pwsh scripts/init.ps1 - run: pwsh scripts/build.ps1 diff --git a/apps/builder/Builder.dib b/apps/builder/Builder.dib index 72ef0b05..211d1a5e 100644 --- a/apps/builder/Builder.dib +++ b/apps/builder/Builder.dib @@ -169,7 +169,7 @@ let inline persistCodeProject packages modules name hash code = async { let inline buildCode runtime packages modules outputDir name code = async { let! fsprojPath = code |> persistCodeProject packages modules name None let! exitCode = fsprojPath |> buildProject runtime outputDir - if exitCode > 0 then + if exitCode <> 0 then let! fsprojText = fsprojPath |> SpiralFileSystem.read_all_text_async trace Critical (fun () -> "buildCode") diff --git a/apps/builder/Builder.dib.html b/apps/builder/Builder.dib.html index ef9455ab..198c0666 100644 --- a/apps/builder/Builder.dib.html +++ b/apps/builder/Builder.dib.html @@ -7705,7 +7705,7 @@
let inline buildCode runtime packages modules outputDir name code = async {
let! fsprojPath = code |> persistCodeProject packages modules name None
let! exitCode = fsprojPath |> buildProject runtime outputDir
- if exitCode > 0 then
+ if exitCode <> 0 then
let! fsprojText = fsprojPath |> SpiralFileSystem.read_all_text_async
trace Critical
(fun () -> "buildCode")
@@ -7834,38 +7834,27 @@ buildCode¶
00:00:03 debug #1 persistCodeProject / packages: [] / modules: [] / name: test1 / hash: / code.Length: 15
-00:00:03 debug #2 buildProject / fullPath: C:\home\git\polyglot\target\polyglot\builder\test1\test1.fsproj
-00:00:06 debug #1 execute_with_options_async / options: struct (None,
- "dotnet publish "C:\home\git\polyglot\target/polyglot/builder\test1\test1.fsproj" --configuration Release --output "dist" --runtime linux-x64",
- [||], None, None, true,
- Some "C:\home\git\polyglot\target\polyglot\builder\test1")
+00:00:03 debug #2 buildProject / fullPath: C:\home\git\polyglot\target\Builder\test1\test1.fsproj
+00:00:06 debug #1 runtime.execute_with_options_async / options: struct (None,
+ "dotnet publish "C:\home\git\polyglot\target/Builder\test1\test1.fsproj" --configuration Release --output "dist" --runtime linux-x64",
+ [||], None, None, true, Some "C:\home\git\polyglot\target\Builder\test1")
00:00:07 verbose #2 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
-00:00:08 verbose #3 > Determining projects to restore...
-00:00:09 verbose #4 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2
-00:00:09 verbose #5 > The last full restore is still up to date. Nothing left to do.
-00:00:09 verbose #6 > Total time taken: 0 milliseconds
-00:00:10 verbose #7 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2
-00:00:10 verbose #8 > Restoring C:\home\git\polyglot\target\polyglot\builder\test1\test1.fsproj
-00:00:10 verbose #9 > Starting restore process.
-00:00:11 verbose #10 > Total time taken: 0 milliseconds
-00:00:12 verbose #11 > Restored C:\home\git\polyglot\target\polyglot\builder\test1\test1.fsproj (in 616 ms).
-00:00:12 verbose #12 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\polyglot\builder\test1\test1.fsproj]
-00:00:15 verbose #13 > C:\home\git\polyglot\target\polyglot\builder\test1\test1.fs(1,16): warning FS0988: Main module of program is empty: nothing will happen when it is run [C:\home\git\polyglot\target\polyglot\builder\test1\test1.fsproj]
-00:00:16 verbose #14 > test1 -> C:\home\git\polyglot\target\polyglot\builder\test1\bin\Release\net9.0\linux-x64\test1.dll
-00:00:18 verbose #15 > test1 -> C:\home\git\polyglot\target\polyglot\builder\test1\dist\
-00:00:18 debug #16 execute_with_options_async / exit_code: 0 / output.Length: 1293
-00:00:18 debug #17 execute_with_options_async / options: struct (None,
- "dotnet publish "C:\home\git\polyglot\target/polyglot/builder\test1\test1.fsproj" --configuration Release --output "dist" --runtime win-x64",
- [||], None, None, true,
- Some "C:\home\git\polyglot\target\polyglot\builder\test1")
-00:00:18 verbose #18 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
-00:00:19 verbose #19 > Determining projects to restore...
-00:00:20 verbose #20 > Restored C:\home\git\polyglot\target\polyglot\builder\test1\test1.fsproj (in 503 ms).
-00:00:20 verbose #21 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\polyglot\builder\test1\test1.fsproj]
-00:00:23 verbose #22 > C:\home\git\polyglot\target\polyglot\builder\test1\test1.fs(1,16): warning FS0988: Main module of program is empty: nothing will happen when it is run [C:\home\git\polyglot\target\polyglot\builder\test1\test1.fsproj]
-00:00:25 verbose #23 > test1 -> C:\home\git\polyglot\target\polyglot\builder\test1\bin\Release\net9.0\win-x64\test1.dll
-00:00:29 verbose #24 > test1 -> C:\home\git\polyglot\target\polyglot\builder\test1\dist\
-00:00:29 debug #25 execute_with_options_async / exit_code: 0 / output.Length: 908
+00:00:07 verbose #3 > Determining projects to restore...
+00:00:08 verbose #4 > Restored C:\home\git\polyglot\target\Builder\test1\test1.fsproj (in 488 ms).
+00:00:08 verbose #5 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\Builder\test1\test1.fsproj]
+00:00:10 verbose #6 > test1 -> C:\home\git\polyglot\target\Builder\test1\bin\Release\net9.0\linux-x64\test1.dll
+00:00:12 verbose #7 > test1 -> C:\home\git\polyglot\target\Builder\test1\dist\
+00:00:12 debug #8 runtime.execute_with_options_async / exit_code: 0 / output.Length: 657
+00:00:12 debug #9 runtime.execute_with_options_async / options: struct (None,
+ "dotnet publish "C:\home\git\polyglot\target/Builder\test1\test1.fsproj" --configuration Release --output "dist" --runtime win-x64",
+ [||], None, None, true, Some "C:\home\git\polyglot\target\Builder\test1")
+00:00:12 verbose #10 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
+00:00:12 verbose #11 > Determining projects to restore...
+00:00:13 verbose #12 > Restored C:\home\git\polyglot\target\Builder\test1\test1.fsproj (in 386 ms).
+00:00:13 verbose #13 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\Builder\test1\test1.fsproj]
+00:00:14 verbose #14 > test1 -> C:\home\git\polyglot\target\Builder\test1\bin\Release\net9.0\win-x64\test1.dll
+00:00:18 verbose #15 > test1 -> C:\home\git\polyglot\target\Builder\test1\dist\
+00:00:18 debug #16 runtime.execute_with_options_async / exit_code: 0 / output.Length: 655
Some 0
@@ -7899,36 +7888,27 @@ buildCode¶
-00:00:26 debug #3 persistCodeProject / packages: [] / modules: [] / name: test2 / hash: / code.Length: 15
-00:00:26 debug #4 buildProject / fullPath: C:\home\git\polyglot\target\polyglot\builder\test2\test2.fsproj
-00:00:29 debug #26 execute_with_options_async / options: struct (None,
- "dotnet publish "C:\home\git\polyglot\target/polyglot/builder\test2\test2.fsproj" --configuration Release --output "dist" --runtime linux-x64",
- [||], None, None, true,
- Some "C:\home\git\polyglot\target\polyglot\builder\test2")
-00:00:30 verbose #27 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
-00:00:31 verbose #28 > Determining projects to restore...
-00:00:31 verbose #29 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2
-00:00:31 verbose #30 > The last full restore is still up to date. Nothing left to do.
-00:00:32 verbose #31 > Total time taken: 0 milliseconds
-00:00:32 verbose #32 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2
-00:00:33 verbose #33 > Restoring C:\home\git\polyglot\target\polyglot\builder\test2\test2.fsproj
-00:00:33 verbose #34 > Starting restore process.
-00:00:33 verbose #35 > Total time taken: 0 milliseconds
-00:00:34 verbose #36 > Restored C:\home\git\polyglot\target\polyglot\builder\test2\test2.fsproj (in 491 ms).
-00:00:34 verbose #37 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\polyglot\builder\test2\test2.fsproj]
-00:00:36 verbose #38 > C:\home\git\polyglot\target\polyglot\builder\test2\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [C:\home\git\polyglot\target\polyglot\builder\test2\test2.fsproj]
-00:00:37 debug #39 execute_with_options_async / exit_code: 1 / output.Length: 1098
-00:00:37 debug #40 execute_with_options_async / options: struct (None,
- "dotnet publish "C:\home\git\polyglot\target/polyglot/builder\test2\test2.fsproj" --configuration Release --output "dist" --runtime win-x64",
- [||], None, None, true,
- Some "C:\home\git\polyglot\target\polyglot\builder\test2")
-00:00:37 verbose #41 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
-00:00:38 verbose #42 > Determining projects to restore...
-00:00:38 verbose #43 > Restored C:\home\git\polyglot\target\polyglot\builder\test2\test2.fsproj (in 377 ms).
-00:00:39 verbose #44 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\polyglot\builder\test2\test2.fsproj]
-00:00:41 verbose #45 > C:\home\git\polyglot\target\polyglot\builder\test2\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [C:\home\git\polyglot\target\polyglot\builder\test2\test2.fsproj]
-00:00:41 debug #46 execute_with_options_async / exit_code: 1 / output.Length: 715
-00:00:37 critical #5 buildCode / code: 1 + a |> ignore / fsprojText: <Project Sdk="Microsoft.NET.Sdk">
+00:00:15 debug #3 persistCodeProject / packages: [] / modules: [] / name: test2 / hash: / code.Length: 15
+00:00:15 debug #4 buildProject / fullPath: C:\home\git\polyglot\target\Builder\test2\test2.fsproj
+00:00:18 debug #17 runtime.execute_with_options_async / options: struct (None,
+ "dotnet publish "C:\home\git\polyglot\target/Builder\test2\test2.fsproj" --configuration Release --output "dist" --runtime linux-x64",
+ [||], None, None, true, Some "C:\home\git\polyglot\target\Builder\test2")
+00:00:18 verbose #18 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
+00:00:19 verbose #19 > Determining projects to restore...
+00:00:20 verbose #20 > Restored C:\home\git\polyglot\target\Builder\test2\test2.fsproj (in 399 ms).
+00:00:20 verbose #21 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\Builder\test2\test2.fsproj]
+00:00:22 verbose #22 > C:\home\git\polyglot\target\Builder\test2\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [C:\home\git\polyglot\target\Builder\test2\test2.fsproj]
+00:00:22 debug #23 runtime.execute_with_options_async / exit_code: 1 / output.Length: 679
+00:00:22 debug #24 runtime.execute_with_options_async / options: struct (None,
+ "dotnet publish "C:\home\git\polyglot\target/Builder\test2\test2.fsproj" --configuration Release --output "dist" --runtime win-x64",
+ [||], None, None, true, Some "C:\home\git\polyglot\target\Builder\test2")
+00:00:22 verbose #25 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
+00:00:23 verbose #26 > Determining projects to restore...
+00:00:24 verbose #27 > Restored C:\home\git\polyglot\target\Builder\test2\test2.fsproj (in 384 ms).
+00:00:24 verbose #28 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\Builder\test2\test2.fsproj]
+00:00:26 verbose #29 > C:\home\git\polyglot\target\Builder\test2\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [C:\home\git\polyglot\target\Builder\test2\test2.fsproj]
+00:00:26 debug #30 runtime.execute_with_options_async / exit_code: 1 / output.Length: 679
+00:00:22 critical #5 buildCode / code: 1 + a |> ignore / fsprojText: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>preview</LangVersion>
@@ -7960,7 +7940,7 @@ buildCode¶
<ItemGroup>
- <Compile Include="C:\home\git\polyglot\target\polyglot\builder\test2\test2.fs" />
+ <Compile Include="C:\home\git\polyglot\target\Builder\test2\test2.fs" />
</ItemGroup>
<Import Project="C:\home\git\polyglot/.paket/Paket.Restore.targets" />
@@ -8285,37 +8265,30 @@ main¶
-00:00:38 debug #6 persistCodeProject / packages: [Argu; FSharp.Control.AsyncSeq; System.Reactive.Linq] / modules: [lib/spiral/common.fsx; lib/spiral/sm.fsx; lib/spiral/crypto.fsx; ... ] / name: Builder / hash: / code.Length: 8215
-00:00:38 debug #7 buildProject / fullPath: C:\home\git\polyglot\target\polyglot\builder\Builder\Builder.fsproj
-00:00:42 debug #47 execute_with_options_async / options: struct (None,
- "dotnet publish "C:\home\git\polyglot\target/polyglot/builder\Builder\Builder.fsproj" --configuration Release --output "C:\home\git\polyglot\apps\builder\dist" --runtime linux-x64",
+00:00:23 debug #6 persistCodeProject / packages: [Argu; FSharp.Control.AsyncSeq; System.Reactive.Linq] / modules: [lib/spiral/common.fsx; lib/spiral/sm.fsx; lib/spiral/crypto.fsx; ... ] / name: Builder / hash: / code.Length: 8207
+00:00:24 debug #7 buildProject / fullPath: C:\home\git\polyglot\target\Builder\Builder\Builder.fsproj
+00:00:27 debug #31 runtime.execute_with_options_async / options: struct (None,
+ "dotnet publish "C:\home\git\polyglot\target/Builder\Builder\Builder.fsproj" --configuration Release --output "C:\home\git\polyglot\apps\builder\dist" --runtime linux-x64",
[||], None, None, true,
- Some "C:\home\git\polyglot\target\polyglot\builder\Builder")
-00:00:42 verbose #48 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
-00:00:43 verbose #49 > Determining projects to restore...
-00:00:44 verbose #50 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2
-00:00:44 verbose #51 > The last full restore is still up to date. Nothing left to do.
-00:00:44 verbose #52 > Total time taken: 0 milliseconds
-00:00:45 verbose #53 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2
-00:00:45 verbose #54 > Restoring C:\home\git\polyglot\target\polyglot\builder\Builder\Builder.fsproj
-00:00:45 verbose #55 > Starting restore process.
-00:00:45 verbose #56 > Total time taken: 0 milliseconds
-00:00:46 verbose #57 > Restored C:\home\git\polyglot\target\polyglot\builder\Builder\Builder.fsproj (in 494 ms).
-00:00:46 verbose #58 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\polyglot\builder\Builder\Builder.fsproj]
-00:01:00 verbose #59 > Builder -> C:\home\git\polyglot\target\polyglot\builder\Builder\bin\Release\net9.0\linux-x64\Builder.dll
-00:01:01 verbose #60 > Builder -> C:\home\git\polyglot\apps\builder\dist\
-00:01:01 debug #61 execute_with_options_async / exit_code: 0 / output.Length: 1079
-00:01:01 debug #62 execute_with_options_async / options: struct (None,
- "dotnet publish "C:\home\git\polyglot\target/polyglot/builder\Builder\Builder.fsproj" --configuration Release --output "C:\home\git\polyglot\apps\builder\dist" --runtime win-x64",
+ Some "C:\home\git\polyglot\target\Builder\Builder")
+00:00:27 verbose #32 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
+00:00:28 verbose #33 > Determining projects to restore...
+00:00:29 verbose #34 > Restored C:\home\git\polyglot\target\Builder\Builder\Builder.fsproj (in 469 ms).
+00:00:29 verbose #35 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\Builder\Builder\Builder.fsproj]
+00:00:41 verbose #36 > Builder -> C:\home\git\polyglot\target\Builder\Builder\bin\Release\net9.0\linux-x64\Builder.dll
+00:00:43 verbose #37 > Builder -> C:\home\git\polyglot\apps\builder\dist\
+00:00:43 debug #38 runtime.execute_with_options_async / exit_code: 0 / output.Length: 665
+00:00:43 debug #39 runtime.execute_with_options_async / options: struct (None,
+ "dotnet publish "C:\home\git\polyglot\target/Builder\Builder\Builder.fsproj" --configuration Release --output "C:\home\git\polyglot\apps\builder\dist" --runtime win-x64",
[||], None, None, true,
- Some "C:\home\git\polyglot\target\polyglot\builder\Builder")
-00:01:02 verbose #63 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
-00:01:02 verbose #64 > Determining projects to restore...
-00:01:03 verbose #65 > Restored C:\home\git\polyglot\target\polyglot\builder\Builder\Builder.fsproj (in 475 ms).
-00:01:03 verbose #66 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\polyglot\builder\Builder\Builder.fsproj]
-00:01:16 verbose #67 > Builder -> C:\home\git\polyglot\target\polyglot\builder\Builder\bin\Release\net9.0\win-x64\Builder.dll
-00:01:20 verbose #68 > Builder -> C:\home\git\polyglot\apps\builder\dist\
-00:01:20 debug #69 execute_with_options_async / exit_code: 0 / output.Length: 690
+ Some "C:\home\git\polyglot\target\Builder\Builder")
+00:00:43 verbose #40 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
+00:00:44 verbose #41 > Determining projects to restore...
+00:00:44 verbose #42 > Restored C:\home\git\polyglot\target\Builder\Builder\Builder.fsproj (in 385 ms).
+00:00:45 verbose #43 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\home\git\polyglot\target\Builder\Builder\Builder.fsproj]
+00:00:56 verbose #44 > Builder -> C:\home\git\polyglot\target\Builder\Builder\bin\Release\net9.0\win-x64\Builder.dll
+00:01:00 verbose #45 > Builder -> C:\home\git\polyglot\apps\builder\dist\
+00:01:00 debug #46 runtime.execute_with_options_async / exit_code: 0 / output.Length: 663
diff --git a/apps/builder/Builder.dib.ipynb b/apps/builder/Builder.dib.ipynb
index 1a39cc74..b13de21b 100644
--- a/apps/builder/Builder.dib.ipynb
+++ b/apps/builder/Builder.dib.ipynb
@@ -186,7 +186,7 @@
" let workspaceRoot = SpiralFileSystem.get_workspace_root ()\n",
"\n",
" let targetDir =\n",
- " let targetDir = workspaceRoot > \"target/polyglot/builder\" > name\n",
+ " let targetDir = workspaceRoot > \"target/Builder\" > name\n",
" match hash with\n",
" | Some hash -> targetDir > \"packages\" > hash\n",
" | None -> targetDir\n",
@@ -274,7 +274,7 @@
"let inline buildCode runtime packages modules outputDir name code = async {\n",
" let! fsprojPath = code |> persistCodeProject packages modules name None\n",
" let! exitCode = fsprojPath |> buildProject runtime outputDir\n",
- " if exitCode > 0 then\n",
+ " if exitCode <> 0 then\n",
" let! fsprojText = fsprojPath |> SpiralFileSystem.read_all_text_async\n",
" trace Critical\n",
" (fun () -> \"buildCode\")\n",
@@ -300,38 +300,27 @@
"output_type": "stream",
"text": [
"00:00:03 debug #1 persistCodeProject / packages: [] / modules: [] / name: test1 / hash: / code.Length: 15\n",
- "00:00:03 debug #2 buildProject / fullPath: C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\test1.fsproj\n",
- "00:00:06 debug #1 execute_with_options_async / options: struct (None,\n",
- " \"dotnet publish \"C:\\home\\git\\polyglot\\target/polyglot/builder\\test1\\test1.fsproj\" --configuration Release --output \"dist\" --runtime linux-x64\",\n",
- " [||], None, None, true,\n",
- " Some \"C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\")\n",
+ "00:00:03 debug #2 buildProject / fullPath: C:\\home\\git\\polyglot\\target\\Builder\\test1\\test1.fsproj\n",
+ "00:00:06 debug #1 runtime.execute_with_options_async / options: struct (None,\n",
+ " \"dotnet publish \"C:\\home\\git\\polyglot\\target/Builder\\test1\\test1.fsproj\" --configuration Release --output \"dist\" --runtime linux-x64\",\n",
+ " [||], None, None, true, Some \"C:\\home\\git\\polyglot\\target\\Builder\\test1\")\n",
"00:00:07 verbose #2 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
- "00:00:08 verbose #3 > Determining projects to restore...\n",
- "00:00:09 verbose #4 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2\n",
- "00:00:09 verbose #5 > The last full restore is still up to date. Nothing left to do.\n",
- "00:00:09 verbose #6 > Total time taken: 0 milliseconds\n",
- "00:00:10 verbose #7 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2\n",
- "00:00:10 verbose #8 > Restoring C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\test1.fsproj\n",
- "00:00:10 verbose #9 > Starting restore process.\n",
- "00:00:11 verbose #10 > Total time taken: 0 milliseconds\n",
- "00:00:12 verbose #11 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\test1.fsproj (in 616 ms).\n",
- "00:00:12 verbose #12 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\test1.fsproj]\n",
- "00:00:15 verbose #13 > C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\test1.fs(1,16): warning FS0988: Main module of program is empty: nothing will happen when it is run [C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\test1.fsproj]\n",
- "00:00:16 verbose #14 > test1 -> C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\bin\\Release\\net9.0\\linux-x64\\test1.dll\n",
- "00:00:18 verbose #15 > test1 -> C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\dist\\\n",
- "00:00:18 debug #16 execute_with_options_async / exit_code: 0 / output.Length: 1293\n",
- "00:00:18 debug #17 execute_with_options_async / options: struct (None,\n",
- " \"dotnet publish \"C:\\home\\git\\polyglot\\target/polyglot/builder\\test1\\test1.fsproj\" --configuration Release --output \"dist\" --runtime win-x64\",\n",
- " [||], None, None, true,\n",
- " Some \"C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\")\n",
- "00:00:18 verbose #18 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
- "00:00:19 verbose #19 > Determining projects to restore...\n",
- "00:00:20 verbose #20 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\test1.fsproj (in 503 ms).\n",
- "00:00:20 verbose #21 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\test1.fsproj]\n",
- "00:00:23 verbose #22 > C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\test1.fs(1,16): warning FS0988: Main module of program is empty: nothing will happen when it is run [C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\test1.fsproj]\n",
- "00:00:25 verbose #23 > test1 -> C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\bin\\Release\\net9.0\\win-x64\\test1.dll\n",
- "00:00:29 verbose #24 > test1 -> C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test1\\dist\\\n",
- "00:00:29 debug #25 execute_with_options_async / exit_code: 0 / output.Length: 908\n",
+ "00:00:07 verbose #3 > Determining projects to restore...\n",
+ "00:00:08 verbose #4 > Restored C:\\home\\git\\polyglot\\target\\Builder\\test1\\test1.fsproj (in 488 ms).\n",
+ "00:00:08 verbose #5 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\Builder\\test1\\test1.fsproj]\n",
+ "00:00:10 verbose #6 > test1 -> C:\\home\\git\\polyglot\\target\\Builder\\test1\\bin\\Release\\net9.0\\linux-x64\\test1.dll\n",
+ "00:00:12 verbose #7 > test1 -> C:\\home\\git\\polyglot\\target\\Builder\\test1\\dist\\\n",
+ "00:00:12 debug #8 runtime.execute_with_options_async / exit_code: 0 / output.Length: 657\n",
+ "00:00:12 debug #9 runtime.execute_with_options_async / options: struct (None,\n",
+ " \"dotnet publish \"C:\\home\\git\\polyglot\\target/Builder\\test1\\test1.fsproj\" --configuration Release --output \"dist\" --runtime win-x64\",\n",
+ " [||], None, None, true, Some \"C:\\home\\git\\polyglot\\target\\Builder\\test1\")\n",
+ "00:00:12 verbose #10 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
+ "00:00:12 verbose #11 > Determining projects to restore...\n",
+ "00:00:13 verbose #12 > Restored C:\\home\\git\\polyglot\\target\\Builder\\test1\\test1.fsproj (in 386 ms).\n",
+ "00:00:13 verbose #13 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\Builder\\test1\\test1.fsproj]\n",
+ "00:00:14 verbose #14 > test1 -> C:\\home\\git\\polyglot\\target\\Builder\\test1\\bin\\Release\\net9.0\\win-x64\\test1.dll\n",
+ "00:00:18 verbose #15 > test1 -> C:\\home\\git\\polyglot\\target\\Builder\\test1\\dist\\\n",
+ "00:00:18 debug #16 runtime.execute_with_options_async / exit_code: 0 / output.Length: 655\n",
"Some 0\n",
"\n"
]
@@ -362,36 +351,27 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:00:26 debug #3 persistCodeProject / packages: [] / modules: [] / name: test2 / hash: / code.Length: 15\n",
- "00:00:26 debug #4 buildProject / fullPath: C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\\test2.fsproj\n",
- "00:00:29 debug #26 execute_with_options_async / options: struct (None,\n",
- " \"dotnet publish \"C:\\home\\git\\polyglot\\target/polyglot/builder\\test2\\test2.fsproj\" --configuration Release --output \"dist\" --runtime linux-x64\",\n",
- " [||], None, None, true,\n",
- " Some \"C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\")\n",
- "00:00:30 verbose #27 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
- "00:00:31 verbose #28 > Determining projects to restore...\n",
- "00:00:31 verbose #29 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2\n",
- "00:00:31 verbose #30 > The last full restore is still up to date. Nothing left to do.\n",
- "00:00:32 verbose #31 > Total time taken: 0 milliseconds\n",
- "00:00:32 verbose #32 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2\n",
- "00:00:33 verbose #33 > Restoring C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\\test2.fsproj\n",
- "00:00:33 verbose #34 > Starting restore process.\n",
- "00:00:33 verbose #35 > Total time taken: 0 milliseconds\n",
- "00:00:34 verbose #36 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\\test2.fsproj (in 491 ms).\n",
- "00:00:34 verbose #37 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\\test2.fsproj]\n",
- "00:00:36 verbose #38 > C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\\test2.fsproj]\n",
- "00:00:37 debug #39 execute_with_options_async / exit_code: 1 / output.Length: 1098\n",
- "00:00:37 debug #40 execute_with_options_async / options: struct (None,\n",
- " \"dotnet publish \"C:\\home\\git\\polyglot\\target/polyglot/builder\\test2\\test2.fsproj\" --configuration Release --output \"dist\" --runtime win-x64\",\n",
- " [||], None, None, true,\n",
- " Some \"C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\")\n",
- "00:00:37 verbose #41 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
- "00:00:38 verbose #42 > Determining projects to restore...\n",
- "00:00:38 verbose #43 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\\test2.fsproj (in 377 ms).\n",
- "00:00:39 verbose #44 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\\test2.fsproj]\n",
- "00:00:41 verbose #45 > C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [C:\\home\\git\\polyglot\\target\\polyglot\\builder\\test2\\test2.fsproj]\n",
- "00:00:41 debug #46 execute_with_options_async / exit_code: 1 / output.Length: 715\n",
- "00:00:37 critical #5 buildCode / code: 1 + a |> ignore / fsprojText: \n",
+ "00:00:15 debug #3 persistCodeProject / packages: [] / modules: [] / name: test2 / hash: / code.Length: 15\n",
+ "00:00:15 debug #4 buildProject / fullPath: C:\\home\\git\\polyglot\\target\\Builder\\test2\\test2.fsproj\n",
+ "00:00:18 debug #17 runtime.execute_with_options_async / options: struct (None,\n",
+ " \"dotnet publish \"C:\\home\\git\\polyglot\\target/Builder\\test2\\test2.fsproj\" --configuration Release --output \"dist\" --runtime linux-x64\",\n",
+ " [||], None, None, true, Some \"C:\\home\\git\\polyglot\\target\\Builder\\test2\")\n",
+ "00:00:18 verbose #18 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
+ "00:00:19 verbose #19 > Determining projects to restore...\n",
+ "00:00:20 verbose #20 > Restored C:\\home\\git\\polyglot\\target\\Builder\\test2\\test2.fsproj (in 399 ms).\n",
+ "00:00:20 verbose #21 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\Builder\\test2\\test2.fsproj]\n",
+ "00:00:22 verbose #22 > C:\\home\\git\\polyglot\\target\\Builder\\test2\\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [C:\\home\\git\\polyglot\\target\\Builder\\test2\\test2.fsproj]\n",
+ "00:00:22 debug #23 runtime.execute_with_options_async / exit_code: 1 / output.Length: 679\n",
+ "00:00:22 debug #24 runtime.execute_with_options_async / options: struct (None,\n",
+ " \"dotnet publish \"C:\\home\\git\\polyglot\\target/Builder\\test2\\test2.fsproj\" --configuration Release --output \"dist\" --runtime win-x64\",\n",
+ " [||], None, None, true, Some \"C:\\home\\git\\polyglot\\target\\Builder\\test2\")\n",
+ "00:00:22 verbose #25 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
+ "00:00:23 verbose #26 > Determining projects to restore...\n",
+ "00:00:24 verbose #27 > Restored C:\\home\\git\\polyglot\\target\\Builder\\test2\\test2.fsproj (in 384 ms).\n",
+ "00:00:24 verbose #28 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\Builder\\test2\\test2.fsproj]\n",
+ "00:00:26 verbose #29 > C:\\home\\git\\polyglot\\target\\Builder\\test2\\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [C:\\home\\git\\polyglot\\target\\Builder\\test2\\test2.fsproj]\n",
+ "00:00:26 debug #30 runtime.execute_with_options_async / exit_code: 1 / output.Length: 679\n",
+ "00:00:22 critical #5 buildCode / code: 1 + a |> ignore / fsprojText: \n",
" \n",
" net9.0 \n",
" preview \n",
@@ -423,7 +403,7 @@
"\n",
" \n",
" \n",
- " \n",
+ " \n",
" \n",
"\n",
" \n",
@@ -732,37 +712,30 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:00:38 debug #6 persistCodeProject / packages: [Argu; FSharp.Control.AsyncSeq; System.Reactive.Linq] / modules: [lib/spiral/common.fsx; lib/spiral/sm.fsx; lib/spiral/crypto.fsx; ... ] / name: Builder / hash: / code.Length: 8215\n",
- "00:00:38 debug #7 buildProject / fullPath: C:\\home\\git\\polyglot\\target\\polyglot\\builder\\Builder\\Builder.fsproj\n",
- "00:00:42 debug #47 execute_with_options_async / options: struct (None,\n",
- " \"dotnet publish \"C:\\home\\git\\polyglot\\target/polyglot/builder\\Builder\\Builder.fsproj\" --configuration Release --output \"C:\\home\\git\\polyglot\\apps\\builder\\dist\" --runtime linux-x64\",\n",
+ "00:00:23 debug #6 persistCodeProject / packages: [Argu; FSharp.Control.AsyncSeq; System.Reactive.Linq] / modules: [lib/spiral/common.fsx; lib/spiral/sm.fsx; lib/spiral/crypto.fsx; ... ] / name: Builder / hash: / code.Length: 8207\n",
+ "00:00:24 debug #7 buildProject / fullPath: C:\\home\\git\\polyglot\\target\\Builder\\Builder\\Builder.fsproj\n",
+ "00:00:27 debug #31 runtime.execute_with_options_async / options: struct (None,\n",
+ " \"dotnet publish \"C:\\home\\git\\polyglot\\target/Builder\\Builder\\Builder.fsproj\" --configuration Release --output \"C:\\home\\git\\polyglot\\apps\\builder\\dist\" --runtime linux-x64\",\n",
" [||], None, None, true,\n",
- " Some \"C:\\home\\git\\polyglot\\target\\polyglot\\builder\\Builder\")\n",
- "00:00:42 verbose #48 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
- "00:00:43 verbose #49 > Determining projects to restore...\n",
- "00:00:44 verbose #50 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2\n",
- "00:00:44 verbose #51 > The last full restore is still up to date. Nothing left to do.\n",
- "00:00:44 verbose #52 > Total time taken: 0 milliseconds\n",
- "00:00:45 verbose #53 > Paket version 8.1.0-alpha002+df391903d7590864c0bba48fdc34b50ddcc94cc2\n",
- "00:00:45 verbose #54 > Restoring C:\\home\\git\\polyglot\\target\\polyglot\\builder\\Builder\\Builder.fsproj\n",
- "00:00:45 verbose #55 > Starting restore process.\n",
- "00:00:45 verbose #56 > Total time taken: 0 milliseconds\n",
- "00:00:46 verbose #57 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\builder\\Builder\\Builder.fsproj (in 494 ms).\n",
- "00:00:46 verbose #58 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\polyglot\\builder\\Builder\\Builder.fsproj]\n",
- "00:01:00 verbose #59 > Builder -> C:\\home\\git\\polyglot\\target\\polyglot\\builder\\Builder\\bin\\Release\\net9.0\\linux-x64\\Builder.dll\n",
- "00:01:01 verbose #60 > Builder -> C:\\home\\git\\polyglot\\apps\\builder\\dist\\\n",
- "00:01:01 debug #61 execute_with_options_async / exit_code: 0 / output.Length: 1079\n",
- "00:01:01 debug #62 execute_with_options_async / options: struct (None,\n",
- " \"dotnet publish \"C:\\home\\git\\polyglot\\target/polyglot/builder\\Builder\\Builder.fsproj\" --configuration Release --output \"C:\\home\\git\\polyglot\\apps\\builder\\dist\" --runtime win-x64\",\n",
+ " Some \"C:\\home\\git\\polyglot\\target\\Builder\\Builder\")\n",
+ "00:00:27 verbose #32 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
+ "00:00:28 verbose #33 > Determining projects to restore...\n",
+ "00:00:29 verbose #34 > Restored C:\\home\\git\\polyglot\\target\\Builder\\Builder\\Builder.fsproj (in 469 ms).\n",
+ "00:00:29 verbose #35 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\Builder\\Builder\\Builder.fsproj]\n",
+ "00:00:41 verbose #36 > Builder -> C:\\home\\git\\polyglot\\target\\Builder\\Builder\\bin\\Release\\net9.0\\linux-x64\\Builder.dll\n",
+ "00:00:43 verbose #37 > Builder -> C:\\home\\git\\polyglot\\apps\\builder\\dist\\\n",
+ "00:00:43 debug #38 runtime.execute_with_options_async / exit_code: 0 / output.Length: 665\n",
+ "00:00:43 debug #39 runtime.execute_with_options_async / options: struct (None,\n",
+ " \"dotnet publish \"C:\\home\\git\\polyglot\\target/Builder\\Builder\\Builder.fsproj\" --configuration Release --output \"C:\\home\\git\\polyglot\\apps\\builder\\dist\" --runtime win-x64\",\n",
" [||], None, None, true,\n",
- " Some \"C:\\home\\git\\polyglot\\target\\polyglot\\builder\\Builder\")\n",
- "00:01:02 verbose #63 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
- "00:01:02 verbose #64 > Determining projects to restore...\n",
- "00:01:03 verbose #65 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\builder\\Builder\\Builder.fsproj (in 475 ms).\n",
- "00:01:03 verbose #66 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\polyglot\\builder\\Builder\\Builder.fsproj]\n",
- "00:01:16 verbose #67 > Builder -> C:\\home\\git\\polyglot\\target\\polyglot\\builder\\Builder\\bin\\Release\\net9.0\\win-x64\\Builder.dll\n",
- "00:01:20 verbose #68 > Builder -> C:\\home\\git\\polyglot\\apps\\builder\\dist\\\n",
- "00:01:20 debug #69 execute_with_options_async / exit_code: 0 / output.Length: 690\n"
+ " Some \"C:\\home\\git\\polyglot\\target\\Builder\\Builder\")\n",
+ "00:00:43 verbose #40 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
+ "00:00:44 verbose #41 > Determining projects to restore...\n",
+ "00:00:44 verbose #42 > Restored C:\\home\\git\\polyglot\\target\\Builder\\Builder\\Builder.fsproj (in 385 ms).\n",
+ "00:00:45 verbose #43 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\home\\git\\polyglot\\target\\Builder\\Builder\\Builder.fsproj]\n",
+ "00:00:56 verbose #44 > Builder -> C:\\home\\git\\polyglot\\target\\Builder\\Builder\\bin\\Release\\net9.0\\win-x64\\Builder.dll\n",
+ "00:01:00 verbose #45 > Builder -> C:\\home\\git\\polyglot\\apps\\builder\\dist\\\n",
+ "00:01:00 debug #46 runtime.execute_with_options_async / exit_code: 0 / output.Length: 663\n"
]
}
],
diff --git a/apps/builder/Builder.fs b/apps/builder/Builder.fs
index 265e78b4..01529edc 100644
--- a/apps/builder/Builder.fs
+++ b/apps/builder/Builder.fs
@@ -59,7 +59,7 @@ module Builder =
let workspaceRoot = SpiralFileSystem.get_workspace_root ()
let targetDir =
- let targetDir = workspaceRoot > "target/polyglot/builder" > name
+ let targetDir = workspaceRoot > "target/Builder" > name
match hash with
| Some hash -> targetDir > "packages" > hash
| None -> targetDir
@@ -127,7 +127,7 @@ module Builder =
let inline buildCode runtime packages modules outputDir name code = async {
let! fsprojPath = code |> persistCodeProject packages modules name None
let! exitCode = fsprojPath |> buildProject runtime outputDir
- if exitCode > 0 then
+ if exitCode <> 0 then
let! fsprojText = fsprojPath |> SpiralFileSystem.read_all_text_async
trace Critical
(fun () -> "buildCode")
diff --git a/apps/scheduler/Tasks.dib b/apps/scheduler/Tasks.dib
index adb1a126..5b940477 100644
--- a/apps/scheduler/Tasks.dib
+++ b/apps/scheduler/Tasks.dib
@@ -230,18 +230,25 @@ inl get_tasks () : list task_template =
#!spiral
//// test
+///! fsharp
+///! cuda
///! rust
+///! typescript
+///! python
types ()
get_tasks ()
-|> sm'.format_pretty'
-|> sm'.from_std_string
+|> sm'.format_debug
|> _assert_string_contains "01"
#!spiral
//// test
+///! fsharp
+///! cuda
///! rust
+///! typescript
+///! python
get_tasks ()
|> listm'.try_item 0i32
diff --git a/apps/scheduler/Tasks.dib.html b/apps/scheduler/Tasks.dib.html
index 070bb155..1cfe27d3 100644
--- a/apps/scheduler/Tasks.dib.html
+++ b/apps/scheduler/Tasks.dib.html
@@ -8064,12 +8064,15 @@ get_tasks (test)
//// test
+///! fsharp
+///! cuda
///! rust
+///! typescript
+///! python
types ()
get_tasks ()
-|> sm'.format_pretty'
-|> sm'.from_std_string
+|> sm'.format_debug
|> _assert_string_contains "01"
@@ -8083,28 +8086,27 @@ get_tasks (test)
-assert_string_contains / actual: "01" / expected: "UH2_1(
- UH0_0,
- "01",
- US4_0(
- US3_0,
- ),
- UH2_1(
- UH0_0,
- "02",
- US4_0(
- US3_0,
- ),
- UH2_1(
- UH0_0,
- "03",
- US4_0(
- US3_0,
- ),
- UH2_0,
- ),
- ),
-)"
+.py output (Cuda):
+assert_string_contains / actual: 01 / expected: UH2_1(v0=UH0_0(), v1='01', v2=US4_0(v0=US3_0()), v3=UH2_1(v0=UH0_0(), v1='02', v2=US4_0(v0=US3_0()), v3=UH2_1(v0=UH0_0(), v1='03', v2=US4_0(v0=US3_0()), v3=UH2_0())))
+
+.rs output:
+assert_string_contains / actual: "01" / expected: "UH2_1(UH0_0, "01", US4_0(US3_0), UH2_1(UH0_0, "02", US4_0(US3_0), UH2_1(UH0_0, "03", US4_0(US3_0), UH2_0)))"
+
+.ts output:
+assert_string_contains / actual: 01 / expected: UH2_1 (UH0_0, 01, US4_0 US3_0, UH2_1 (UH0_0, 02, US4_0 US3_0, UH2_1 (UH0_0, 03, US4_0 US3_0, UH2_0)))
+
+.py output:
+assert_string_contains / actual: 01 / expected: UH2_1 (UH0_0, 01, US4_0 US3_0, UH2_1 (UH0_0, 02, US4_0 US3_0, UH2_1 (UH0_0, 03, US4_0 US3_0, UH2_0)))
+
+
+
+
+
+
+.fsx output:
+assert_string_contains / actual: "01" / expected: "UH2_1
+ (UH0_0, "01", US4_0 US3_0,
+ UH2_1 (UH0_0, "02", US4_0 US3_0, UH2_1 (UH0_0, "03", US4_0 US3_0, UH2_0)))"
@@ -8119,7 +8121,11 @@ get_tasks (test)
//// test
+///! fsharp
+///! cuda
///! rust
+///! typescript
+///! python
get_tasks ()
|> listm'.try_item 0i32
@@ -8137,7 +8143,25 @@ get_tasks (test)
-assert_eq / actual: "01" / expected: "01"
+.py output (Cuda):
+assert_eq / actual: 01 / expected: 01
+
+.rs output:
+assert_eq / actual: "01" / expected: "01"
+
+.ts output:
+assert_eq / actual: 01 / expected: 01
+
+.py output:
+assert_eq / actual: 01 / expected: 01
+
+
+
+
+
+
+.fsx output:
+assert_eq / actual: "01" / expected: "01"
diff --git a/apps/scheduler/Tasks.dib.ipynb b/apps/scheduler/Tasks.dib.ipynb
index d560e443..78a4121d 100644
--- a/apps/scheduler/Tasks.dib.ipynb
+++ b/apps/scheduler/Tasks.dib.ipynb
@@ -510,42 +510,44 @@
{
"data": {
"text/plain": [
- "assert_string_contains / actual: \"01\" / expected: \"UH2_1(\n",
- " UH0_0,\n",
- " \"01\",\n",
- " US4_0(\n",
- " US3_0,\n",
- " ),\n",
- " UH2_1(\n",
- " UH0_0,\n",
- " \"02\",\n",
- " US4_0(\n",
- " US3_0,\n",
- " ),\n",
- " UH2_1(\n",
- " UH0_0,\n",
- " \"03\",\n",
- " US4_0(\n",
- " US3_0,\n",
- " ),\n",
- " UH2_0,\n",
- " ),\n",
- " ),\n",
- ")\"\n"
+ ".py output (Cuda):\n",
+ "assert_string_contains / actual: 01 / expected: UH2_1(v0=UH0_0(), v1='01', v2=US4_0(v0=US3_0()), v3=UH2_1(v0=UH0_0(), v1='02', v2=US4_0(v0=US3_0()), v3=UH2_1(v0=UH0_0(), v1='03', v2=US4_0(v0=US3_0()), v3=UH2_0())))\n",
+ "\n",
+ ".rs output:\n",
+ "assert_string_contains / actual: \"01\" / expected: \"UH2_1(UH0_0, \"01\", US4_0(US3_0), UH2_1(UH0_0, \"02\", US4_0(US3_0), UH2_1(UH0_0, \"03\", US4_0(US3_0), UH2_0)))\"\n",
+ "\n",
+ ".ts output:\n",
+ "assert_string_contains / actual: 01 / expected: UH2_1 (UH0_0, 01, US4_0 US3_0, UH2_1 (UH0_0, 02, US4_0 US3_0, UH2_1 (UH0_0, 03, US4_0 US3_0, UH2_0)))\n",
+ "\n",
+ ".py output:\n",
+ "assert_string_contains / actual: 01 / expected: UH2_1 (UH0_0, 01, US4_0 US3_0, UH2_1 (UH0_0, 02, US4_0 US3_0, UH2_1 (UH0_0, 03, US4_0 US3_0, UH2_0)))\n"
]
},
"metadata": {},
"output_type": "display_data"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ ".fsx output:\n",
+ "assert_string_contains / actual: \"01\" / expected: \"UH2_1\n",
+ " (UH0_0, \"01\", US4_0 US3_0,\n",
+ " UH2_1 (UH0_0, \"02\", US4_0 US3_0, UH2_1 (UH0_0, \"03\", US4_0 US3_0, UH2_0)))\"\n"
+ ]
}
],
"source": [
"//// test\n",
+ "///! fsharp\n",
+ "///! cuda\n",
"///! rust\n",
+ "///! typescript\n",
+ "///! python\n",
"\n",
"types ()\n",
"get_tasks ()\n",
- "|> sm'.format_pretty'\n",
- "|> sm'.from_std_string\n",
+ "|> sm'.format_debug\n",
"|> _assert_string_contains \"01\""
]
},
@@ -564,16 +566,38 @@
{
"data": {
"text/plain": [
- "assert_eq / actual: \"01\" / expected: \"01\"\n"
+ ".py output (Cuda):\n",
+ "assert_eq / actual: 01 / expected: 01\n",
+ "\n",
+ ".rs output:\n",
+ "assert_eq / actual: \"01\" / expected: \"01\"\n",
+ "\n",
+ ".ts output:\n",
+ "assert_eq / actual: 01 / expected: 01\n",
+ "\n",
+ ".py output:\n",
+ "assert_eq / actual: 01 / expected: 01\n"
]
},
"metadata": {},
"output_type": "display_data"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ ".fsx output:\n",
+ "assert_eq / actual: \"01\" / expected: \"01\"\n"
+ ]
}
],
"source": [
"//// test\n",
+ "///! fsharp\n",
+ "///! cuda\n",
"///! rust\n",
+ "///! typescript\n",
+ "///! python\n",
"\n",
"get_tasks ()\n",
"|> listm'.try_item 0i32\n",
diff --git a/apps/spiral/Eval.dib b/apps/spiral/Eval.dib
index 4e945290..e1783d7d 100644
--- a/apps/spiral/Eval.dib
+++ b/apps/spiral/Eval.dib
@@ -313,6 +313,313 @@ let startCommandsWatcher (uriServer : string) =
#!markdown
+## prepareSpi
+
+#!fsharp
+
+let prepareSpi rawCellCode lines =
+ let lastBlock =
+ lines
+ |> Array.tryFindBack (fun line ->
+ line |> String.length > 0
+ && line.[0] <> ' '
+ )
+
+ let hasMain =
+ lastBlock
+ |> Option.exists (fun line ->
+ line |> SpiralSm.starts_with "inl main "
+ || line |> SpiralSm.starts_with "let main "
+ )
+
+ if hasMain
+ then rawCellCode, None
+ else
+ let lastTopLevelIndex, _ =
+ (lines |> Array.indexed, (None, false))
+ ||> Array.foldBack (fun (i, line) (lastTopLevelIndex, finished) ->
+ trace Verbose (fun () -> $"Eval.prepareSpi / i: {i} / line: '{line}' / lastTopLevelIndex: {lastTopLevelIndex} / finished: {finished}") _locals
+ match line with
+ | _ when finished -> lastTopLevelIndex, true
+ | "" -> lastTopLevelIndex, false
+ | line when
+ line |> SpiralSm.starts_with " "
+ || line |> SpiralSm.starts_with "// " -> lastTopLevelIndex, false
+ | line when
+ line |> SpiralSm.starts_with "open "
+ || line |> SpiralSm.starts_with "prototype "
+ || line |> SpiralSm.starts_with "instance "
+ || line |> SpiralSm.starts_with "type "
+ || line |> SpiralSm.starts_with "union "
+ || line |> SpiralSm.starts_with "nominal " -> lastTopLevelIndex, true
+ | line when
+ line |> SpiralSm.starts_with "inl "
+ || line |> SpiralSm.starts_with "let " ->
+ let m =
+ System.Text.RegularExpressions.Regex.Match (
+ line,
+ @"^(inl|let) +([~\(\w][\w\d']*(?:| *[~\w][\w\d']*\)|, *[~\w][\w\d']*)) +[:=](?! +function)"
+ )
+ trace Verbose (fun () -> $"Eval.prepareSpi / m: '{m}' / m.Groups.Count: {m.Groups.Count}") _locals
+ if m.Groups.Count = 3
+ then Some i, false
+ else lastTopLevelIndex, true
+ | _ -> Some i, false
+ )
+ let code =
+ match lastTopLevelIndex with
+ | Some lastTopLevelIndex ->
+ lines
+ |> Array.mapi (fun i line ->
+ match i with
+ | i when i < lastTopLevelIndex -> line
+ | i when i = lastTopLevelIndex -> $"\nlet main () =\n {line}"
+ | _ when line |> SpiralSm.trim = "" -> ""
+ | _ -> $" {line}"
+ )
+ |> SpiralSm.concat "\n"
+ | None -> $"{rawCellCode}\n\ninl main () = ()\n"
+ code, lastTopLevelIndex
+
+#!markdown
+
+## processSpiralOutput
+
+#!fsharp
+
+let processSpiralOutput
+ (props : {|
+ printCode: bool
+ traceLevel: TraceLevel
+ builderCommands: string array
+ lastTopLevelIndex: int option
+ backend: Supervisor.Backend
+ cancellationToken: _
+ spiralErrors: _
+ code: string
+ outputPath: string
+ |})
+ = async {
+ let inline _trace (fn : unit -> string) =
+ if props.traceLevel = Verbose
+ then trace Info (fun () -> $"Eval.processSpiralOutput / props: {props |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / {fn ()}") _locals
+ else fn () |> System.Console.WriteLine
+
+ if props.printCode then
+ let ext = props.outputPath |> System.IO.Path.GetExtension
+ _trace (fun () -> if props.builderCommands.Length > 0 then $"{ext}:\n{props.code}\n" else props.code)
+
+ let workspaceRootExternal =
+ let currentDir =
+ System.IO.Directory.GetCurrentDirectory ()
+ |> SpiralSm.to_lower
+ let workspaceRoot = workspaceRoot |> SpiralSm.to_lower
+ if currentDir |> SpiralSm.starts_with workspaceRoot
+ then None
+ else Some workspaceRoot
+
+ let! spiralBuilderResults =
+ match props.builderCommands, props.lastTopLevelIndex with
+ | [||], _ | _, None -> [||] |> Async.init
+ | builderCommands, _ ->
+ builderCommands
+ |> Array.map (fun builderCommand ->
+ let path =
+ workspaceRoot > $@"workspace/target/release/spiral_builder{SpiralRuntime.get_executable_suffix ()}"
+ |> System.IO.Path.GetFullPath
+ let commands =
+ if props.backend = Supervisor.Fsharp
+ && (
+ builderCommand |> SpiralSm.starts_with "rust"
+ || builderCommand |> SpiralSm.starts_with "typescript"
+ || builderCommand |> SpiralSm.starts_with "python"
+ )
+ then [| $"{path} fable --fs-path \"{props.outputPath}\" --command \"{builderCommand}\"" |]
+ elif props.backend = Supervisor.Cuda
+ && builderCommand |> SpiralSm.starts_with "cuda"
+ then [| $"{path} {builderCommand} --py-path \"{props.outputPath}\"" |]
+ else [||]
+ builderCommand, commands
+ )
+ |> Array.filter (fun (_, commands) -> commands.Length > 0)
+ |> Array.map (fun (builderCommand, commands) ->
+ commands
+ |> Array.map (fun command -> async {
+ let! exitCode, result =
+ SpiralRuntime.execution_options (fun x ->
+ { x with
+ l0 = props.cancellationToken
+ l1 = command
+ l2 = [|
+ "AUTOMATION", assemblyName = "dotnet-repl" |> string
+ "TRACE_LEVEL", $"%A{Info}"
+ |]
+ l6 = workspaceRootExternal
+ }
+ )
+ |> SpiralRuntime.execute_with_options_async
+ trace Debug
+ (fun () -> $"Eval.processSpiralOutput / spiral_builder")
+ (fun () -> $"exitCode: {exitCode} / result: {result |> SpiralSm.ellipsis_end 400} / {_locals ()}")
+ return
+ if exitCode = 0
+ then (result, false) |> Ok
+ else result |> Error
+ })
+ )
+ |> Array.collect id
+ |> Async.Parallel
+
+ let hasEval =
+ props.backend = Supervisor.Fsharp
+ && props.builderCommands |> Array.exists (fun x -> x |> SpiralSm.starts_with "fsharp")
+
+ let outputResult =
+ if props.builderCommands.Length > 0 && not hasEval
+ then None
+ else
+ let code =
+ if props.printCode || props.builderCommands.Length > 1
+ then
+ let header = "System.Console.WriteLine \".fsx output:\"\n"
+ $"{header}{props.code}"
+ else props.code
+ Some (Ok [ code, true ])
+
+ match outputResult, spiralBuilderResults with
+ | Some outputResult, [||] ->
+ return outputResult, [||]
+ | None, [||] ->
+ return Ok [ "()", true ], [||]
+ | _, spiralBuilderResults ->
+ try
+ let spiralResults =
+ match outputResult with
+ | Some (Ok code) ->
+ spiralBuilderResults
+ |> Array.append (code |> List.map Ok |> List.toArray)
+ | _ -> spiralBuilderResults
+ let codes =
+ spiralResults
+ |> Array.map (fun spiralBuilderResult' ->
+ let spiralBuilderResult'', errors =
+ match spiralBuilderResult' with
+ | Ok (x, false) ->
+ let x = x |> FSharp.Json.Json.deserialize
+
+
+
+
+
+
+
+processSpiralOutput¶
+
+
+
+
+
+
+
+
+In [ ]:
+
+
+let processSpiralOutput
+ (props : {|
+ printCode: bool
+ traceLevel: TraceLevel
+ builderCommands: string array
+ lastTopLevelIndex: int option
+ backend: Supervisor.Backend
+ cancellationToken: _
+ spiralErrors: _
+ code: string
+ outputPath: string
+ |})
+ = async {
+ let inline _trace (fn : unit -> string) =
+ if props.traceLevel = Verbose
+ then trace Info (fun () -> $"Eval.processSpiralOutput / props: {props |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / {fn ()}") _locals
+ else fn () |> System.Console.WriteLine
+
+ if props.printCode then
+ let ext = props.outputPath |> System.IO.Path.GetExtension
+ _trace (fun () -> if props.builderCommands.Length > 0 then $"{ext}:\n{props.code}\n" else props.code)
+
+ let workspaceRootExternal =
+ let currentDir =
+ System.IO.Directory.GetCurrentDirectory ()
+ |> SpiralSm.to_lower
+ let workspaceRoot = workspaceRoot |> SpiralSm.to_lower
+ if currentDir |> SpiralSm.starts_with workspaceRoot
+ then None
+ else Some workspaceRoot
+
+ let! spiralBuilderResults =
+ match props.builderCommands, props.lastTopLevelIndex with
+ | [||], _ | _, None -> [||] |> Async.init
+ | builderCommands, _ ->
+ builderCommands
+ |> Array.map (fun builderCommand ->
+ let path =
+ workspaceRoot </> $@"workspace/target/release/spiral_builder{SpiralRuntime.get_executable_suffix ()}"
+ |> System.IO.Path.GetFullPath
+ let commands =
+ if props.backend = Supervisor.Fsharp
+ && (
+ builderCommand |> SpiralSm.starts_with "rust"
+ || builderCommand |> SpiralSm.starts_with "typescript"
+ || builderCommand |> SpiralSm.starts_with "python"
+ )
+ then [| $"{path} fable --fs-path \"{props.outputPath}\" --command \"{builderCommand}\"" |]
+ elif props.backend = Supervisor.Cuda
+ && builderCommand |> SpiralSm.starts_with "cuda"
+ then [| $"{path} {builderCommand} --py-path \"{props.outputPath}\"" |]
+ else [||]
+ builderCommand, commands
+ )
+ |> Array.filter (fun (_, commands) -> commands.Length > 0)
+ |> Array.map (fun (builderCommand, commands) ->
+ commands
+ |> Array.map (fun command -> async {
+ let! exitCode, result =
+ SpiralRuntime.execution_options (fun x ->
+ { x with
+ l0 = props.cancellationToken
+ l1 = command
+ l2 = [|
+ "AUTOMATION", assemblyName = "dotnet-repl" |> string
+ "TRACE_LEVEL", $"%A{Info}"
+ |]
+ l6 = workspaceRootExternal
+ }
+ )
+ |> SpiralRuntime.execute_with_options_async
+ trace Debug
+ (fun () -> $"Eval.processSpiralOutput / spiral_builder")
+ (fun () -> $"exitCode: {exitCode} / result: {result |> SpiralSm.ellipsis_end 400} / {_locals ()}")
+ return
+ if exitCode = 0
+ then (result, false) |> Ok
+ else result |> Error
+ })
+ )
+ |> Array.collect id
+ |> Async.Parallel
+
+ let hasEval =
+ props.backend = Supervisor.Fsharp
+ && props.builderCommands |> Array.exists (fun x -> x |> SpiralSm.starts_with "fsharp")
+
+ let outputResult =
+ if props.builderCommands.Length > 0 && not hasEval
+ then None
+ else
+ let code =
+ if props.printCode || props.builderCommands.Length > 1
+ then
+ let header = "System.Console.WriteLine \".fsx output:\"\n"
+ $"{header}{props.code}"
+ else props.code
+ Some (Ok [ code, true ])
+
+ match outputResult, spiralBuilderResults with
+ | Some outputResult, [||] ->
+ return outputResult, [||]
+ | None, [||] ->
+ return Ok [ "()", true ], [||]
+ | _, spiralBuilderResults ->
+ try
+ let spiralResults =
+ match outputResult with
+ | Some (Ok code) ->
+ spiralBuilderResults
+ |> Array.append (code |> List.map Ok |> List.toArray)
+ | _ -> spiralBuilderResults
+ let codes =
+ spiralResults
+ |> Array.map (fun spiralBuilderResult' ->
+ let spiralBuilderResult'', errors =
+ match spiralBuilderResult' with
+ | Ok (x, false) ->
+ let x = x |> FSharp.Json.Json.deserialize<Map<string,string>>
+ x, [||]
+ | Ok (x, true) ->
+ let result =
+ [
+ "command_result",
+ [
+ "extension", "fsx"
+ "code", x
+ "output", ""
+ ]
+ |> Map.ofList
+ |> FSharp.Json.Json.serialize
+ ]
+ |> Map.ofList
+ result, [||]
+
+ | Error error ->
+ ([] |> Map),
+ [|
+ (
+ TraceLevel.Critical, $"Eval.processSpiralOutput / evalResult error / errors[0] / outputPath: {props.outputPath} / builderCommands: %A{props.builderCommands} / spiralBuilderResult': %A{spiralBuilderResult'} / error: %A{error}", 0, ("", (0, 0), (0, 0))
+ )
+ |]
+
+ if errors |> Array.isEmpty |> not
+ || spiralBuilderResult'' |> Map.containsKey "command_result" |> not
+ then Error (Exception $"Eval.processSpiralOutput / evalResult errors / Exception / spiralBuilderResult'': %A{spiralBuilderResult''}"), errors
+ else
+ let commandResult = spiralBuilderResult''.["command_result"] |> FSharp.Json.Json.deserialize<Map<string,string>>
+
+ let extension = commandResult.["extension"]
+ let code = commandResult.["code"]
+ let output = commandResult.["output"]
+
+ if props.printCode
+ then _trace (fun () -> $""".{extension}:{'\n'}{code}""")
+
+ let eval = output = "" && extension = "fsx"
+
+ trace Debug
+ (fun () -> $"Eval.processSpiralOutput / result")
+ (fun () -> $"commandResult: {commandResult |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400}/ {_locals ()}")
+
+ let code =
+ if props.printCode
+ || spiralResults.Length > 1
+ || props.builderCommands.Length > 1
+ then
+ if eval then
+ code
+ else
+ let header =
+ if props.backend = Supervisor.Fsharp
+ then $".{extension} output:\n"
+ else $".{extension} output ({props.backend}):\n"
+ $"{header}{output}"
+ elif eval
+ then code
+ else output
+ Ok (code, eval), [||]
+ )
+ trace Debug
+ (fun () -> $"Eval.processSpiralOutput / codes")
+ (fun () ->
+ let props = {| props with cancellationToken = None |}
+ $"codes: {codes |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / spiralResults: {spiralResults |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / spiralBuilderResults: {spiralBuilderResults |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / props: {props |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / {_locals ()}")
+ return
+ (((Ok []), [||]), codes)
+ ||> Array.fold (fun (acc_code, acc_errors) (code, errors) ->
+ match code, acc_code with
+ | Ok code, Ok acc_code ->
+ let errors =
+ acc_errors
+ |> Array.append errors
+ |> Array.append props.spiralErrors
+ let errors =
+ if errors |> Array.isEmpty
+ then errors
+ else
+ errors
+ |> Array.append [|
+ TraceLevel.Critical, $"Eval.processSpiralOutput / errors / errors[-1] / outputPath: {props.outputPath} / builderCommands: %A{props.builderCommands} / code: {code |> fst |> SpiralSm.ellipsis_end 400}", 0, ("", (0, 0), (0, 0))
+ |]
+ Ok (code :: acc_code), errors
+ | Error error, _
+ | _, Error error ->
+ Error error,
+ acc_errors |> Array.append errors
+ )
+ with ex ->
+ trace Critical (fun () -> $"Eval.processSpiralOutput / try 2 ex / spiralBuilderResults: %A{spiralBuilderResults} / ex: {ex |> SpiralSm.format_exception}") _locals
+ return Error (Exception $"Eval.processSpiralOutput / try 2 ex / Exception / spiralBuilderResults: %A{spiralBuilderResults} / ex: {ex |> SpiralSm.format_exception}"),
+ [|
+ (
+ TraceLevel.Critical, $"Eval.processSpiralOutput / try 2 ex / errors[0] / spiralBuilderResults: %A{spiralBuilderResults} / ex: {ex |> SpiralSm.format_exception}", 0, ("", (0, 0), (0, 0))
+ )
+ |]
+}
+
+
+
+
+
+
+
+
+
+
+
+
+tryGetPropertyValue¶
+
+
+
+
+
+
+
+
+In [ ]:
+
+
+let tryGetPropertyValue (propertyName: string) (obj: obj) =
+ let objType = obj.GetType ()
+ let propertyInfo = propertyName |> objType.GetProperty
+ if propertyInfo <> null
+ then propertyInfo.GetValue (obj, null) |> Some
+ else None
+
+
+
+
+
+
+
+
+
+
+
+
+eval¶
+
+
+
+
+
+
+
+
+In [ ]:
+
+
let inline eval
(fsi_eval:
string
@@ -8005,7 +8363,9 @@ eval¶
(cancellationToken: Option<System.Threading.CancellationToken>)
(code: string)
=
- trace Verbose (fun () -> $"Eval.eval / code: %A{code}") _locals
+ trace Verbose
+ (fun () -> $"Eval.eval")
+ (fun () -> $"code: {code |> SpiralSm.ellipsis_end 400} / {_locals ()}")
let rawCellCode =
code |> SpiralSm.replace "\r\n" "\n"
@@ -8015,12 +8375,12 @@ eval¶
if lines |> Array.exists (fun line -> line |> SpiralSm.starts_with "#r " && line |> SpiralSm.ends_with "\"") then
let cancellationToken = defaultArg cancellationToken System.Threading.CancellationToken.None
let ch, errors = fsi_eval code cancellationToken
- trace Verbose (fun () -> $"Eval.eval / fsi_eval / ch: %A{ch} / errors: {errors}") _locals
+ trace Verbose (fun () -> $"Eval.eval / fsi_eval 1 / ch: %A{ch} / errors: {errors}") _locals
match ch with
| Choice1Of2 v -> Ok(v), errors
| Choice2Of2 ex -> Error(ex), errors
else
- let builderCommand =
+ let builderCommands =
lines
|> Array.choose (fun line ->
if line |> SpiralSm.starts_with "///! "
@@ -8078,233 +8438,99 @@ eval¶
async {
try
- let lastBlock =
- lines
- |> Array.tryFindBack (fun line ->
- line |> String.length > 0
- && line.[0] <> ' '
- )
+ let cellCode, lastTopLevelIndex = prepareSpi rawCellCode lines
- let hasMain =
- lastBlock
- |> Option.exists (fun line ->
- line |> SpiralSm.starts_with "inl main "
- || line |> SpiralSm.starts_with "let main "
- )
+ let newAllCode = $"{allCode}\n\n{cellCode}"
- let cellCode, lastTopLevelIndex =
- if hasMain
- then rawCellCode, None
+ let buildBackends =
+ if builderCommands.Length = 0
+ then [| Supervisor.Fsharp |]
else
- let lastTopLevelIndex, _ =
- (lines |> Array.indexed, (None, false))
- ||> Array.foldBack (fun (i, line) (lastTopLevelIndex, finished) ->
- trace Debug (fun () -> $"i: {i} / line: '{line}' / lastTopLevelIndex: {lastTopLevelIndex} / finished: {finished}") _locals
- match line with
- | _ when finished -> lastTopLevelIndex, true
- | "" -> lastTopLevelIndex, false
- | line when
- line |> SpiralSm.starts_with " "
- || line |> SpiralSm.starts_with "// " -> lastTopLevelIndex, false
- | line when
- line |> SpiralSm.starts_with "open "
- || line |> SpiralSm.starts_with "prototype "
- || line |> SpiralSm.starts_with "instance "
- || line |> SpiralSm.starts_with "type "
- || line |> SpiralSm.starts_with "union "
- || line |> SpiralSm.starts_with "nominal " -> lastTopLevelIndex, true
- | line when
- line |> SpiralSm.starts_with "inl "
- || line |> SpiralSm.starts_with "let " ->
- let m =
- System.Text.RegularExpressions.Regex.Match (
- line,
- @"^(inl|let) +([~\(\w][\w\d']*(?:| *[~\w][\w\d']*\)|, *[~\w][\w\d']*)) +[:=](?! +function)"
- )
- trace Debug (fun () -> $"m: '{m}' / m.Groups.Count: {m.Groups.Count}") _locals
- if m.Groups.Count = 3
- then Some i, false
- else lastTopLevelIndex, true
- | _ -> Some i, false
- )
- let code =
- match lastTopLevelIndex with
- | Some lastTopLevelIndex ->
- lines
- |> Array.mapi (fun i line ->
- match i with
- | i when i < lastTopLevelIndex -> line
- | i when i = lastTopLevelIndex -> $"\nlet main () =\n {line}"
- | _ when line |> SpiralSm.trim = "" -> ""
- | _ -> $" {line}"
- )
- |> SpiralSm.concat "\n"
- | None -> $"{rawCellCode}\n\ninl main () = ()\n"
- code, lastTopLevelIndex
-
- let newAllCode = $"{allCode}\n\n{cellCode}"
+ builderCommands
+ |> Array.map (fun x ->
+ if x |> SpiralSm.starts_with "cuda"
+ then Supervisor.Cuda
+ else Supervisor.Fsharp
+ )
+ |> Array.distinct
- let! buildCodeResult =
- newAllCode
- |> Supervisor.buildCode isCache timeout cancellationToken
+ trace Verbose
+ (fun () -> $"Eval.eval")
+ (fun () -> $"cellCode: {cellCode |> SpiralSm.ellipsis_end 400} / lastTopLevelIndex: {lastTopLevelIndex} / builderCommands: %A{builderCommands} / buildBackends: %A{buildBackends} / {_locals ()}")
+
+ let! buildCodeResults =
+ buildBackends
+ |> Array.map (fun backend -> async {
+ let! result =
+ newAllCode
+ |> Supervisor.buildCode backend isCache timeout cancellationToken
+ return backend, result
+ })
+ |> Async.Parallel
|> Async.catch
|> Async.runWithTimeoutAsync timeout
- match buildCodeResult with
- | Some (Ok (_mainPath, (fsxPath, Some code), spiralErrors)) ->
- let spiralErrors =
- mapErrors (Warning, spiralErrors, lastTopLevelIndex) allCode
- let inline _trace (fn : unit -> string) =
- if isTrace
- then trace Info (fun () -> $"Eval.eval / {fn ()}") _locals
- else fn () |> System.Console.WriteLine
-
- if printCode
- then _trace (fun () -> if builderCommand.Length > 0 then $".fsx:\n{code}\n" else code)
-
- let! spiralBuilderResult =
- match builderCommand, lastTopLevelIndex with
- | [||], _ | _, None -> [||] |> Async.init
- | builderCommand, _ -> async {
- let workspaceRootExternal =
- let currentDir =
- System.IO.Directory.GetCurrentDirectory ()
- |> SpiralSm.to_lower
- let workspaceRoot = workspaceRoot |> SpiralSm.to_lower
- if currentDir |> SpiralSm.starts_with workspaceRoot
- then None
- else Some workspaceRoot
- return!
- builderCommand
- |> Array.map (fun builderCommand -> async {
- let! exitCode, result =
- SpiralRuntime.execution_options (fun x ->
- { x with
- l0 = cancellationToken
- l1 =
- let path =
- workspaceRoot </> $@"workspace/target/release/spiral_builder{SpiralRuntime.get_executable_suffix ()}"
- |> System.IO.Path.GetFullPath
- $"{path} fsharp --fs-path \"{fsxPath}\" --command \"{builderCommand}\""
- l2 = [|
- "AUTOMATION", assemblyName = "dotnet-repl" |> string
- "TRACE_LEVEL", $"%A{traceLevel}"
- |]
- l6 = workspaceRootExternal
- }
- )
- |> SpiralRuntime.execute_with_options_async
- trace Debug (fun () -> $"Eval.eval / spiral_builder / exitCode: {exitCode} / result: {result |> SpiralSm.ellipsis_end 400}") _locals
- return
- if exitCode = 0
- then result |> Ok
- else result |> Error
- })
- |> Async.Parallel
- }
-
+ match buildCodeResults with
+ | Some (Ok buildCodeResults) ->
+ let! result, errors =
+ ((Ok [], [||]), buildCodeResults)
+ ||> Async.fold (fun acc buildCodeResult -> async {
+ match buildCodeResult with
+ | (backend, (spiPath, (outputPath, Some code), spiralErrors)) ->
+ let spiralErrors =
+ mapErrors (Warning, spiralErrors, lastTopLevelIndex) allCode
+ let! result =
+ processSpiralOutput
+ {|
+ printCode = printCode
+ traceLevel = traceLevel
+ builderCommands = builderCommands
+ lastTopLevelIndex = lastTopLevelIndex
+ backend = backend
+ cancellationToken = cancellationToken
+ spiralErrors = spiralErrors
+ code = code
+ outputPath = outputPath
+ |}
+ match result, acc with
+ | (Ok code, errors), (Ok acc_code, acc_errors) ->
+ return Ok (acc_code @ code), acc_errors |> Array.append errors
+ | (Error ex, errors), _ | _, (Error ex, errors) ->
+ return Error ex, errors |> Array.append errors
+ | _ -> return acc
+ })
let cancellationToken = defaultArg cancellationToken System.Threading.CancellationToken.None
-
- let fsxResult =
- if builderCommand.Length > 0
- then None
- else
- try
- let ch, errors = fsi_eval code cancellationToken
+ match result, errors with
+ | Ok code, [||] ->
+ let code, eval =
+ code
+ |> List.map (fun (code, eval) ->
+ if eval
+ then None, Some code
+ else Some code, None
+ )
+ |> List.unzip
+ let code = code |> List.choose id
+ let eval = eval |> List.choose id
+
+ trace Debug
+ (fun () -> $"Eval.eval")
+ (fun () -> $"eval: {eval |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / code: {code |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / {_locals ()}")
+
+ let ch, errors =
+ match eval, code with
+ | [], [] ->
+ Choice2Of2 (Exception $"Eval.eval / errors / buildCodeResults: %A{buildCodeResults} / code: %A{code}"), errors
+ | [ eval ], [] ->
+ let ch, errors2 = fsi_eval eval cancellationToken
let errors =
- errors
+ errors2
|> Array.map (fun (e1, e2, e3, _) ->
(e1, e2, e3, ("", (0, 0), (0, 0)))
)
- let errors =
- if errors |> Array.isEmpty
- then errors
- else
- errors
- |> Array.append [|
- TraceLevel.Critical, $"Eval.eval / fsi_eval errors / errors[-1] / fsxPath: {fsxPath} / builderCommand: %A{builderCommand} / code: {code |> SpiralSm.ellipsis_end 400}", 0, ("", (0, 0), (0, 0))
- |]
- Some (ch, errors)
- with ex ->
- trace Critical (fun () -> $"Eval.eval / fsi_eval try ex / code : {code |> SpiralSm.ellipsis_end 400} / ex: {ex |> SpiralSm.format_exception}") _locals
- None
-
- match fsxResult, spiralBuilderResult with
- | Some (ch, errors), [||] ->
- let errors = errors |> Array.append spiralErrors
- match ch with
- | Choice1Of2 v ->
- allCode <- newAllCode
- return Ok(v), errors
- | Choice2Of2 ex -> return Error ex, errors
- | _, [||] ->
- let ch, errors = fsi_eval "()" cancellationToken
- match ch with
- | Choice1Of2 v ->
- allCode <- newAllCode
- return Ok(v), errors
- | Choice2Of2 ex ->
- return Error ex, errors
- | _, spiralBuilderResult ->
- try
- let codes =
- spiralBuilderResult
- |> Array.map (fun spiralBuilderResult' ->
- let spiralBuilderResult'', errors =
- match spiralBuilderResult' with
- | Ok x ->
- let x = x |> FSharp.Json.Json.deserialize<Map<string,string>>
- x, [||]
- | Error error ->
- ([] |> Map),
- [|
- (
- TraceLevel.Critical, $"Eval.eval / evalResult error / errors[0] / fsxPath: {fsxPath} / builderCommand: %A{builderCommand} / spiralBuilderResult': %A{spiralBuilderResult'} / error: %A{error}", 0, ("", (0, 0), (0, 0))
- )
- |]
-
- if errors |> Array.isEmpty |> not || spiralBuilderResult'' |> Map.containsKey "command_result" |> not
- then Error (Exception $"Eval.eval / evalResult errors / Exception / spiralBuilderResult'': %A{spiralBuilderResult''}"), errors
- else
- let commandResult = spiralBuilderResult''.["command_result"] |> FSharp.Json.Json.deserialize<Map<string,string>>
-
- let extension = commandResult.["extension"]
- if printCode
- then _trace (fun () -> $""".{extension}:{'\n'}{commandResult.["code"]}""")
- let code =
- let header =
- if printCode || spiralBuilderResult.Length > 1
- then $".{extension} output:\n" else
- ""
- let output = commandResult.["output"]
- $"{header}{output}"
- Ok code, [||]
- )
- let result, errors =
- (((Ok []), [||]), codes)
- ||> Array.fold (fun (acc_code, acc_errors) (code, errors) ->
- match code, acc_code with
- | Ok code, Ok acc_code ->
- let errors =
- acc_errors
- |> Array.append errors
- |> Array.append spiralErrors
- let errors =
- if errors |> Array.isEmpty
- then errors
- else
- errors
- |> Array.append [|
- TraceLevel.Critical, $"Eval.eval / fsi_eval2 errors / errors[-1] / fsxPath: {fsxPath} / builderCommand: %A{builderCommand} / code: {code |> SpiralSm.ellipsis_end 400}", 0, ("", (0, 0), (0, 0))
- |]
- Ok (code :: acc_code), errors
- | Error error, _
- | _, Error error ->
- Error error,
- acc_errors |> Array.append errors
- )
- match result with
- | Ok code ->
+ |> Array.append errors
+ ch, errors
+ | [], _ ->
let code = code |> List.rev |> String.concat "\n\n"
let code =
if printCode
@@ -8312,40 +8538,80 @@ eval¶
else $"\"\"\"{code}\n\"\"\""
let ch, errors2 = fsi_eval code cancellationToken
let errors =
- errors
- |> Array.append errors2
- match ch with
- | Choice1Of2 v ->
- allCode <- newAllCode
- return Ok(v), errors
- | Choice2Of2 ex ->
- return Error ex, errors
- | Error error ->
- return Error error, errors
- with ex ->
- trace Critical (fun () -> $"Eval.eval / try 2 ex / spiralBuilderResult: %A{spiralBuilderResult} / ex: {ex |> SpiralSm.format_exception}") _locals
- return Error (Exception $"Eval.eval / try 2 ex / Exception / spiralBuilderResult: %A{spiralBuilderResult} / ex: {ex |> SpiralSm.format_exception}"),
- [|
- (
- TraceLevel.Critical, $"Eval.eval / try 2 ex / errors[0] / spiralBuilderResult: %A{spiralBuilderResult} / ex: {ex |> SpiralSm.format_exception}", 0, ("", (0, 0), (0, 0))
- )
- |]
- | Some (Ok (_, _, errors)) when errors |> List.isEmpty |> not ->
- return errors.[0] |> fst |> Exception |> Error,
- mapErrors (TraceLevel.Critical, errors, lastTopLevelIndex) allCode
+ errors2
+ |> Array.map (fun (e1, e2, e3, _) ->
+ (e1, e2, e3, ("", (0, 0), (0, 0)))
+ )
+ |> Array.append errors
+ ch, errors
+ | _ ->
+ let code, errors =
+ ((Ok (code |> List.rev), [||]), eval)
+ ||> List.fold (fun (acc, acc_errors) eval ->
+ match acc with
+ | Error x -> Error x, acc_errors
+ | Ok acc ->
+ let ch, errors = fsi_eval eval cancellationToken
+ let errors =
+ errors
+ |> Array.map (fun (e1, e2, e3, _) ->
+ (e1, e2, e3, ("", (0, 0), (0, 0)))
+ )
+ |> Array.append acc_errors
+ match ch with
+ | Choice1Of2 v ->
+ let v =
+ v
+ |> tryGetPropertyValue "ReflectionValue"
+ |> Option.map (fun x -> $"%A{x}")
+ |> Option.defaultValue ""
+ Ok (v :: acc), errors
+ | Choice2Of2 ex ->
+ trace Critical (fun () -> $"Eval.eval / fsi_eval fold Choice error / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}") _locals
+ Error ch, errors
+ )
+ match code with
+ | Error ch -> ch, errors
+ | Ok code ->
+ let code =
+ code
+ |> List.filter ((<>) "")
+ |> String.concat "\n\n"
+ let code =
+ if printCode
+ then $"\"\"\"{code}\n\n\n\"\"\""
+ else $"\"\"\"{code}\n\"\"\""
+ let ch, errors2 = fsi_eval code cancellationToken
+ let errors =
+ errors2
+ |> Array.map (fun (e1, e2, e3, _) ->
+ (e1, e2, e3, ("", (0, 0), (0, 0)))
+ )
+ |> Array.append errors
+ ch, errors
+ match ch with
+ | Choice1Of2 v ->
+ allCode <- newAllCode
+ return Ok(v), errors
+ | Choice2Of2 ex ->
+ return Error ex, errors
+ | Ok code, errors ->
+ return Error (Exception "Eval.eval / errors / buildCodeResults: %A{buildCodeResults} / code: %A{code}"), errors
+ | Error error, errors ->
+ return Error error, errors
| Some (Error ex) ->
- trace Critical (fun () -> $"Eval.eval / buildCodeResult Error / buildCodeResult: %A{buildCodeResult} / ex: {ex |> SpiralSm.format_exception}") _locals
- return Error (Exception $"Eval.eval / buildCodeResult Error / Exception / buildCodeResult: %A{buildCodeResult} / ex: {ex |> SpiralSm.format_exception}"),
+ trace Critical (fun () -> $"Eval.eval / buildCodeResults Error / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}") _locals
+ return Error (Exception $"Eval.eval / buildCodeResults Error / Exception / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}"),
[|
(
- TraceLevel.Critical, $"Eval.eval / buildCodeResult Error / errors[0] / buildCodeResult: %A{buildCodeResult} / ex: {ex |> SpiralSm.format_exception}", 0, ("", (0, 0), (0, 0))
+ TraceLevel.Critical, $"Eval.eval / buildCodeResults Error / errors[0] / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}", 0, ("", (0, 0), (0, 0))
)
|]
| _ ->
- return Error (Exception $"Eval.eval / buildCodeResult / Exception / buildCodeResult: %A{buildCodeResult}"),
+ return Error (Exception $"Eval.eval / buildCodeResults / Exception / buildCodeResults: %A{buildCodeResults}"),
[|
(
- TraceLevel.Critical, $"Eval.eval / buildCodeResult / errors[0] / buildCodeResult: %A{buildCodeResult}", 0, ("", (0, 0), (0, 0))
+ TraceLevel.Critical, $"Eval.eval / buildCodeResults / errors[0] / buildCodeResults: %A{buildCodeResults}", 0, ("", (0, 0), (0, 0))
)
|]
with ex ->
diff --git a/apps/spiral/Eval.dib.ipynb b/apps/spiral/Eval.dib.ipynb
index e67f19c9..c5682a97 100644
--- a/apps/spiral/Eval.dib.ipynb
+++ b/apps/spiral/Eval.dib.ipynb
@@ -229,7 +229,7 @@
"outputs": [],
"source": [
"let workspaceRoot = SpiralFileSystem.get_workspace_root ()\n",
- "let targetDir = workspaceRoot > \"target/polyglot/spiral_eval\"\n",
+ "let targetDir = workspaceRoot > \"target/spiral_Eval\"\n",
"[ targetDir ]\n",
"|> List.iter (fun dir -> if Directory.Exists dir |> not then Directory.CreateDirectory dir |> ignore)\n",
"\n",
@@ -456,6 +456,358 @@
" )"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## prepareSpi"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "dotnet_interactive": {
+ "language": "fsharp"
+ },
+ "polyglot_notebook": {
+ "kernelName": "fsharp"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "let prepareSpi rawCellCode lines =\n",
+ " let lastBlock =\n",
+ " lines\n",
+ " |> Array.tryFindBack (fun line ->\n",
+ " line |> String.length > 0\n",
+ " && line.[0] <> ' '\n",
+ " )\n",
+ "\n",
+ " let hasMain =\n",
+ " lastBlock\n",
+ " |> Option.exists (fun line ->\n",
+ " line |> SpiralSm.starts_with \"inl main \"\n",
+ " || line |> SpiralSm.starts_with \"let main \"\n",
+ " )\n",
+ "\n",
+ " if hasMain\n",
+ " then rawCellCode, None\n",
+ " else\n",
+ " let lastTopLevelIndex, _ =\n",
+ " (lines |> Array.indexed, (None, false))\n",
+ " ||> Array.foldBack (fun (i, line) (lastTopLevelIndex, finished) ->\n",
+ " trace Verbose (fun () -> $\"Eval.prepareSpi / i: {i} / line: '{line}' / lastTopLevelIndex: {lastTopLevelIndex} / finished: {finished}\") _locals\n",
+ " match line with\n",
+ " | _ when finished -> lastTopLevelIndex, true\n",
+ " | \"\" -> lastTopLevelIndex, false\n",
+ " | line when\n",
+ " line |> SpiralSm.starts_with \" \"\n",
+ " || line |> SpiralSm.starts_with \"// \" -> lastTopLevelIndex, false\n",
+ " | line when\n",
+ " line |> SpiralSm.starts_with \"open \"\n",
+ " || line |> SpiralSm.starts_with \"prototype \"\n",
+ " || line |> SpiralSm.starts_with \"instance \"\n",
+ " || line |> SpiralSm.starts_with \"type \"\n",
+ " || line |> SpiralSm.starts_with \"union \"\n",
+ " || line |> SpiralSm.starts_with \"nominal \" -> lastTopLevelIndex, true\n",
+ " | line when\n",
+ " line |> SpiralSm.starts_with \"inl \"\n",
+ " || line |> SpiralSm.starts_with \"let \" ->\n",
+ " let m =\n",
+ " System.Text.RegularExpressions.Regex.Match (\n",
+ " line,\n",
+ " @\"^(inl|let) +([~\\(\\w][\\w\\d']*(?:| *[~\\w][\\w\\d']*\\)|, *[~\\w][\\w\\d']*)) +[:=](?! +function)\"\n",
+ " )\n",
+ " trace Verbose (fun () -> $\"Eval.prepareSpi / m: '{m}' / m.Groups.Count: {m.Groups.Count}\") _locals\n",
+ " if m.Groups.Count = 3\n",
+ " then Some i, false\n",
+ " else lastTopLevelIndex, true\n",
+ " | _ -> Some i, false\n",
+ " )\n",
+ " let code =\n",
+ " match lastTopLevelIndex with\n",
+ " | Some lastTopLevelIndex ->\n",
+ " lines\n",
+ " |> Array.mapi (fun i line ->\n",
+ " match i with\n",
+ " | i when i < lastTopLevelIndex -> line\n",
+ " | i when i = lastTopLevelIndex -> $\"\\nlet main () =\\n {line}\"\n",
+ " | _ when line |> SpiralSm.trim = \"\" -> \"\"\n",
+ " | _ -> $\" {line}\"\n",
+ " )\n",
+ " |> SpiralSm.concat \"\\n\"\n",
+ " | None -> $\"{rawCellCode}\\n\\ninl main () = ()\\n\"\n",
+ " code, lastTopLevelIndex"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## processSpiralOutput"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "dotnet_interactive": {
+ "language": "fsharp"
+ },
+ "polyglot_notebook": {
+ "kernelName": "fsharp"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "let processSpiralOutput\n",
+ " (props : {|\n",
+ " printCode: bool\n",
+ " traceLevel: TraceLevel\n",
+ " builderCommands: string array\n",
+ " lastTopLevelIndex: int option\n",
+ " backend: Supervisor.Backend\n",
+ " cancellationToken: _\n",
+ " spiralErrors: _\n",
+ " code: string\n",
+ " outputPath: string\n",
+ " |})\n",
+ " = async {\n",
+ " let inline _trace (fn : unit -> string) =\n",
+ " if props.traceLevel = Verbose\n",
+ " then trace Info (fun () -> $\"Eval.processSpiralOutput / props: {props |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / {fn ()}\") _locals\n",
+ " else fn () |> System.Console.WriteLine\n",
+ "\n",
+ " if props.printCode then\n",
+ " let ext = props.outputPath |> System.IO.Path.GetExtension\n",
+ " _trace (fun () -> if props.builderCommands.Length > 0 then $\"{ext}:\\n{props.code}\\n\" else props.code)\n",
+ "\n",
+ " let workspaceRootExternal =\n",
+ " let currentDir =\n",
+ " System.IO.Directory.GetCurrentDirectory ()\n",
+ " |> SpiralSm.to_lower\n",
+ " let workspaceRoot = workspaceRoot |> SpiralSm.to_lower\n",
+ " if currentDir |> SpiralSm.starts_with workspaceRoot\n",
+ " then None\n",
+ " else Some workspaceRoot\n",
+ "\n",
+ " let! spiralBuilderResults =\n",
+ " match props.builderCommands, props.lastTopLevelIndex with\n",
+ " | [||], _ | _, None -> [||] |> Async.init\n",
+ " | builderCommands, _ ->\n",
+ " builderCommands\n",
+ " |> Array.map (fun builderCommand ->\n",
+ " let path =\n",
+ " workspaceRoot > $@\"workspace/target/release/spiral_builder{SpiralRuntime.get_executable_suffix ()}\"\n",
+ " |> System.IO.Path.GetFullPath\n",
+ " let commands =\n",
+ " if props.backend = Supervisor.Fsharp\n",
+ " && (\n",
+ " builderCommand |> SpiralSm.starts_with \"rust\"\n",
+ " || builderCommand |> SpiralSm.starts_with \"typescript\"\n",
+ " || builderCommand |> SpiralSm.starts_with \"python\"\n",
+ " )\n",
+ " then [| $\"{path} fable --fs-path \\\"{props.outputPath}\\\" --command \\\"{builderCommand}\\\"\" |]\n",
+ " elif props.backend = Supervisor.Cuda\n",
+ " && builderCommand |> SpiralSm.starts_with \"cuda\"\n",
+ " then [| $\"{path} {builderCommand} --py-path \\\"{props.outputPath}\\\"\" |]\n",
+ " else [||]\n",
+ " builderCommand, commands\n",
+ " )\n",
+ " |> Array.filter (fun (_, commands) -> commands.Length > 0)\n",
+ " |> Array.map (fun (builderCommand, commands) ->\n",
+ " commands\n",
+ " |> Array.map (fun command -> async {\n",
+ " let! exitCode, result =\n",
+ " SpiralRuntime.execution_options (fun x ->\n",
+ " { x with\n",
+ " l0 = props.cancellationToken\n",
+ " l1 = command\n",
+ " l2 = [|\n",
+ " \"AUTOMATION\", assemblyName = \"dotnet-repl\" |> string\n",
+ " \"TRACE_LEVEL\", $\"%A{Info}\"\n",
+ " |]\n",
+ " l6 = workspaceRootExternal\n",
+ " }\n",
+ " )\n",
+ " |> SpiralRuntime.execute_with_options_async\n",
+ " trace Debug\n",
+ " (fun () -> $\"Eval.processSpiralOutput / spiral_builder\")\n",
+ " (fun () -> $\"exitCode: {exitCode} / result: {result |> SpiralSm.ellipsis_end 400} / {_locals ()}\")\n",
+ " return\n",
+ " if exitCode = 0\n",
+ " then (result, false) |> Ok\n",
+ " else result |> Error\n",
+ " })\n",
+ " )\n",
+ " |> Array.collect id\n",
+ " |> Async.Parallel\n",
+ "\n",
+ " let hasEval =\n",
+ " props.backend = Supervisor.Fsharp\n",
+ " && props.builderCommands |> Array.exists (fun x -> x |> SpiralSm.starts_with \"fsharp\")\n",
+ "\n",
+ " let outputResult =\n",
+ " if props.builderCommands.Length > 0 && not hasEval\n",
+ " then None\n",
+ " else\n",
+ " let code =\n",
+ " if props.printCode || props.builderCommands.Length > 1\n",
+ " then\n",
+ " let header = \"System.Console.WriteLine \\\".fsx output:\\\"\\n\"\n",
+ " $\"{header}{props.code}\"\n",
+ " else props.code\n",
+ " Some (Ok [ code, true ])\n",
+ "\n",
+ " match outputResult, spiralBuilderResults with\n",
+ " | Some outputResult, [||] ->\n",
+ " return outputResult, [||]\n",
+ " | None, [||] ->\n",
+ " return Ok [ \"()\", true ], [||]\n",
+ " | _, spiralBuilderResults ->\n",
+ " try\n",
+ " let spiralResults =\n",
+ " match outputResult with\n",
+ " | Some (Ok code) ->\n",
+ " spiralBuilderResults\n",
+ " |> Array.append (code |> List.map Ok |> List.toArray)\n",
+ " | _ -> spiralBuilderResults\n",
+ " let codes =\n",
+ " spiralResults\n",
+ " |> Array.map (fun spiralBuilderResult' ->\n",
+ " let spiralBuilderResult'', errors =\n",
+ " match spiralBuilderResult' with\n",
+ " | Ok (x, false) ->\n",
+ " let x = x |> FSharp.Json.Json.deserialize>\n",
+ " x, [||]\n",
+ " | Ok (x, true) ->\n",
+ " let result =\n",
+ " [\n",
+ " \"command_result\",\n",
+ " [\n",
+ " \"extension\", \"fsx\"\n",
+ " \"code\", x\n",
+ " \"output\", \"\"\n",
+ " ]\n",
+ " |> Map.ofList\n",
+ " |> FSharp.Json.Json.serialize\n",
+ " ]\n",
+ " |> Map.ofList\n",
+ " result, [||]\n",
+ "\n",
+ " | Error error ->\n",
+ " ([] |> Map),\n",
+ " [|\n",
+ " (\n",
+ " TraceLevel.Critical, $\"Eval.processSpiralOutput / evalResult error / errors[0] / outputPath: {props.outputPath} / builderCommands: %A{props.builderCommands} / spiralBuilderResult': %A{spiralBuilderResult'} / error: %A{error}\", 0, (\"\", (0, 0), (0, 0))\n",
+ " )\n",
+ " |]\n",
+ "\n",
+ " if errors |> Array.isEmpty |> not\n",
+ " || spiralBuilderResult'' |> Map.containsKey \"command_result\" |> not\n",
+ " then Error (Exception $\"Eval.processSpiralOutput / evalResult errors / Exception / spiralBuilderResult'': %A{spiralBuilderResult''}\"), errors\n",
+ " else\n",
+ " let commandResult = spiralBuilderResult''.[\"command_result\"] |> FSharp.Json.Json.deserialize>\n",
+ "\n",
+ " let extension = commandResult.[\"extension\"]\n",
+ " let code = commandResult.[\"code\"]\n",
+ " let output = commandResult.[\"output\"]\n",
+ "\n",
+ " if props.printCode\n",
+ " then _trace (fun () -> $\"\"\".{extension}:{'\\n'}{code}\"\"\")\n",
+ "\n",
+ " let eval = output = \"\" && extension = \"fsx\"\n",
+ "\n",
+ " trace Debug\n",
+ " (fun () -> $\"Eval.processSpiralOutput / result\")\n",
+ " (fun () -> $\"commandResult: {commandResult |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400}/ {_locals ()}\")\n",
+ "\n",
+ " let code =\n",
+ " if props.printCode\n",
+ " || spiralResults.Length > 1\n",
+ " || props.builderCommands.Length > 1\n",
+ " then\n",
+ " if eval then\n",
+ " code\n",
+ " else\n",
+ " let header =\n",
+ " if props.backend = Supervisor.Fsharp\n",
+ " then $\".{extension} output:\\n\"\n",
+ " else $\".{extension} output ({props.backend}):\\n\"\n",
+ " $\"{header}{output}\"\n",
+ " elif eval\n",
+ " then code\n",
+ " else output\n",
+ " Ok (code, eval), [||]\n",
+ " )\n",
+ " trace Debug\n",
+ " (fun () -> $\"Eval.processSpiralOutput / codes\")\n",
+ " (fun () ->\n",
+ " let props = {| props with cancellationToken = None |}\n",
+ " $\"codes: {codes |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / spiralResults: {spiralResults |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / spiralBuilderResults: {spiralBuilderResults |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / props: {props |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / {_locals ()}\")\n",
+ " return\n",
+ " (((Ok []), [||]), codes)\n",
+ " ||> Array.fold (fun (acc_code, acc_errors) (code, errors) ->\n",
+ " match code, acc_code with\n",
+ " | Ok code, Ok acc_code ->\n",
+ " let errors =\n",
+ " acc_errors\n",
+ " |> Array.append errors\n",
+ " |> Array.append props.spiralErrors\n",
+ " let errors =\n",
+ " if errors |> Array.isEmpty\n",
+ " then errors\n",
+ " else\n",
+ " errors\n",
+ " |> Array.append [|\n",
+ " TraceLevel.Critical, $\"Eval.processSpiralOutput / errors / errors[-1] / outputPath: {props.outputPath} / builderCommands: %A{props.builderCommands} / code: {code |> fst |> SpiralSm.ellipsis_end 400}\", 0, (\"\", (0, 0), (0, 0))\n",
+ " |]\n",
+ " Ok (code :: acc_code), errors\n",
+ " | Error error, _\n",
+ " | _, Error error ->\n",
+ " Error error,\n",
+ " acc_errors |> Array.append errors\n",
+ " )\n",
+ " with ex ->\n",
+ " trace Critical (fun () -> $\"Eval.processSpiralOutput / try 2 ex / spiralBuilderResults: %A{spiralBuilderResults} / ex: {ex |> SpiralSm.format_exception}\") _locals\n",
+ " return Error (Exception $\"Eval.processSpiralOutput / try 2 ex / Exception / spiralBuilderResults: %A{spiralBuilderResults} / ex: {ex |> SpiralSm.format_exception}\"),\n",
+ " [|\n",
+ " (\n",
+ " TraceLevel.Critical, $\"Eval.processSpiralOutput / try 2 ex / errors[0] / spiralBuilderResults: %A{spiralBuilderResults} / ex: {ex |> SpiralSm.format_exception}\", 0, (\"\", (0, 0), (0, 0))\n",
+ " )\n",
+ " |]\n",
+ "}"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## tryGetPropertyValue"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "dotnet_interactive": {
+ "language": "fsharp"
+ },
+ "polyglot_notebook": {
+ "kernelName": "fsharp"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "let tryGetPropertyValue (propertyName: string) (obj: obj) =\n",
+ " let objType = obj.GetType ()\n",
+ " let propertyInfo = propertyName |> objType.GetProperty\n",
+ " if propertyInfo <> null\n",
+ " then propertyInfo.GetValue (obj, null) |> Some\n",
+ " else None"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -484,7 +836,9 @@
" (cancellationToken: Option)\n",
" (code: string)\n",
" =\n",
- " trace Verbose (fun () -> $\"Eval.eval / code: %A{code}\") _locals\n",
+ " trace Verbose\n",
+ " (fun () -> $\"Eval.eval\")\n",
+ " (fun () -> $\"code: {code |> SpiralSm.ellipsis_end 400} / {_locals ()}\")\n",
"\n",
" let rawCellCode =\n",
" code |> SpiralSm.replace \"\\r\\n\" \"\\n\"\n",
@@ -494,12 +848,12 @@
" if lines |> Array.exists (fun line -> line |> SpiralSm.starts_with \"#r \" && line |> SpiralSm.ends_with \"\\\"\") then\n",
" let cancellationToken = defaultArg cancellationToken System.Threading.CancellationToken.None\n",
" let ch, errors = fsi_eval code cancellationToken\n",
- " trace Verbose (fun () -> $\"Eval.eval / fsi_eval / ch: %A{ch} / errors: {errors}\") _locals\n",
+ " trace Verbose (fun () -> $\"Eval.eval / fsi_eval 1 / ch: %A{ch} / errors: {errors}\") _locals\n",
" match ch with\n",
" | Choice1Of2 v -> Ok(v), errors\n",
" | Choice2Of2 ex -> Error(ex), errors\n",
" else\n",
- " let builderCommand =\n",
+ " let builderCommands =\n",
" lines\n",
" |> Array.choose (fun line ->\n",
" if line |> SpiralSm.starts_with \"///! \"\n",
@@ -557,233 +911,99 @@
"\n",
" async {\n",
" try\n",
- " let lastBlock =\n",
- " lines\n",
- " |> Array.tryFindBack (fun line ->\n",
- " line |> String.length > 0\n",
- " && line.[0] <> ' '\n",
- " )\n",
+ " let cellCode, lastTopLevelIndex = prepareSpi rawCellCode lines\n",
"\n",
- " let hasMain =\n",
- " lastBlock\n",
- " |> Option.exists (fun line ->\n",
- " line |> SpiralSm.starts_with \"inl main \"\n",
- " || line |> SpiralSm.starts_with \"let main \"\n",
- " )\n",
+ " let newAllCode = $\"{allCode}\\n\\n{cellCode}\"\n",
"\n",
- " let cellCode, lastTopLevelIndex =\n",
- " if hasMain\n",
- " then rawCellCode, None\n",
+ " let buildBackends =\n",
+ " if builderCommands.Length = 0\n",
+ " then [| Supervisor.Fsharp |]\n",
" else\n",
- " let lastTopLevelIndex, _ =\n",
- " (lines |> Array.indexed, (None, false))\n",
- " ||> Array.foldBack (fun (i, line) (lastTopLevelIndex, finished) ->\n",
- " trace Debug (fun () -> $\"i: {i} / line: '{line}' / lastTopLevelIndex: {lastTopLevelIndex} / finished: {finished}\") _locals\n",
- " match line with\n",
- " | _ when finished -> lastTopLevelIndex, true\n",
- " | \"\" -> lastTopLevelIndex, false\n",
- " | line when\n",
- " line |> SpiralSm.starts_with \" \"\n",
- " || line |> SpiralSm.starts_with \"// \" -> lastTopLevelIndex, false\n",
- " | line when\n",
- " line |> SpiralSm.starts_with \"open \"\n",
- " || line |> SpiralSm.starts_with \"prototype \"\n",
- " || line |> SpiralSm.starts_with \"instance \"\n",
- " || line |> SpiralSm.starts_with \"type \"\n",
- " || line |> SpiralSm.starts_with \"union \"\n",
- " || line |> SpiralSm.starts_with \"nominal \" -> lastTopLevelIndex, true\n",
- " | line when\n",
- " line |> SpiralSm.starts_with \"inl \"\n",
- " || line |> SpiralSm.starts_with \"let \" ->\n",
- " let m =\n",
- " System.Text.RegularExpressions.Regex.Match (\n",
- " line,\n",
- " @\"^(inl|let) +([~\\(\\w][\\w\\d']*(?:| *[~\\w][\\w\\d']*\\)|, *[~\\w][\\w\\d']*)) +[:=](?! +function)\"\n",
- " )\n",
- " trace Debug (fun () -> $\"m: '{m}' / m.Groups.Count: {m.Groups.Count}\") _locals\n",
- " if m.Groups.Count = 3\n",
- " then Some i, false\n",
- " else lastTopLevelIndex, true\n",
- " | _ -> Some i, false\n",
- " )\n",
- " let code =\n",
- " match lastTopLevelIndex with\n",
- " | Some lastTopLevelIndex ->\n",
- " lines\n",
- " |> Array.mapi (fun i line ->\n",
- " match i with\n",
- " | i when i < lastTopLevelIndex -> line\n",
- " | i when i = lastTopLevelIndex -> $\"\\nlet main () =\\n {line}\"\n",
- " | _ when line |> SpiralSm.trim = \"\" -> \"\"\n",
- " | _ -> $\" {line}\"\n",
- " )\n",
- " |> SpiralSm.concat \"\\n\"\n",
- " | None -> $\"{rawCellCode}\\n\\ninl main () = ()\\n\"\n",
- " code, lastTopLevelIndex\n",
+ " builderCommands\n",
+ " |> Array.map (fun x ->\n",
+ " if x |> SpiralSm.starts_with \"cuda\"\n",
+ " then Supervisor.Cuda\n",
+ " else Supervisor.Fsharp\n",
+ " )\n",
+ " |> Array.distinct\n",
"\n",
- " let newAllCode = $\"{allCode}\\n\\n{cellCode}\"\n",
+ " trace Verbose\n",
+ " (fun () -> $\"Eval.eval\")\n",
+ " (fun () -> $\"cellCode: {cellCode |> SpiralSm.ellipsis_end 400} / lastTopLevelIndex: {lastTopLevelIndex} / builderCommands: %A{builderCommands} / buildBackends: %A{buildBackends} / {_locals ()}\")\n",
"\n",
- " let! buildCodeResult =\n",
- " newAllCode\n",
- " |> Supervisor.buildCode isCache timeout cancellationToken\n",
+ " let! buildCodeResults =\n",
+ " buildBackends\n",
+ " |> Array.map (fun backend -> async {\n",
+ " let! result =\n",
+ " newAllCode\n",
+ " |> Supervisor.buildCode backend isCache timeout cancellationToken\n",
+ " return backend, result\n",
+ " })\n",
+ " |> Async.Parallel\n",
" |> Async.catch\n",
" |> Async.runWithTimeoutAsync timeout\n",
"\n",
- " match buildCodeResult with\n",
- " | Some (Ok (_mainPath, (fsxPath, Some code), spiralErrors)) ->\n",
- " let spiralErrors =\n",
- " mapErrors (Warning, spiralErrors, lastTopLevelIndex) allCode\n",
- " let inline _trace (fn : unit -> string) =\n",
- " if isTrace\n",
- " then trace Info (fun () -> $\"Eval.eval / {fn ()}\") _locals\n",
- " else fn () |> System.Console.WriteLine\n",
- "\n",
- " if printCode\n",
- " then _trace (fun () -> if builderCommand.Length > 0 then $\".fsx:\\n{code}\\n\" else code)\n",
- "\n",
- " let! spiralBuilderResult =\n",
- " match builderCommand, lastTopLevelIndex with\n",
- " | [||], _ | _, None -> [||] |> Async.init\n",
- " | builderCommand, _ -> async {\n",
- " let workspaceRootExternal =\n",
- " let currentDir =\n",
- " System.IO.Directory.GetCurrentDirectory ()\n",
- " |> SpiralSm.to_lower\n",
- " let workspaceRoot = workspaceRoot |> SpiralSm.to_lower\n",
- " if currentDir |> SpiralSm.starts_with workspaceRoot\n",
- " then None\n",
- " else Some workspaceRoot\n",
- " return!\n",
- " builderCommand\n",
- " |> Array.map (fun builderCommand -> async {\n",
- " let! exitCode, result =\n",
- " SpiralRuntime.execution_options (fun x ->\n",
- " { x with\n",
- " l0 = cancellationToken\n",
- " l1 =\n",
- " let path =\n",
- " workspaceRoot > $@\"workspace/target/release/spiral_builder{SpiralRuntime.get_executable_suffix ()}\"\n",
- " |> System.IO.Path.GetFullPath\n",
- " $\"{path} fsharp --fs-path \\\"{fsxPath}\\\" --command \\\"{builderCommand}\\\"\"\n",
- " l2 = [|\n",
- " \"AUTOMATION\", assemblyName = \"dotnet-repl\" |> string\n",
- " \"TRACE_LEVEL\", $\"%A{traceLevel}\"\n",
- " |]\n",
- " l6 = workspaceRootExternal\n",
- " }\n",
- " )\n",
- " |> SpiralRuntime.execute_with_options_async\n",
- " trace Debug (fun () -> $\"Eval.eval / spiral_builder / exitCode: {exitCode} / result: {result |> SpiralSm.ellipsis_end 400}\") _locals\n",
- " return\n",
- " if exitCode = 0\n",
- " then result |> Ok\n",
- " else result |> Error\n",
- " })\n",
- " |> Async.Parallel\n",
- " }\n",
- "\n",
+ " match buildCodeResults with\n",
+ " | Some (Ok buildCodeResults) ->\n",
+ " let! result, errors =\n",
+ " ((Ok [], [||]), buildCodeResults)\n",
+ " ||> Async.fold (fun acc buildCodeResult -> async {\n",
+ " match buildCodeResult with\n",
+ " | (backend, (spiPath, (outputPath, Some code), spiralErrors)) ->\n",
+ " let spiralErrors =\n",
+ " mapErrors (Warning, spiralErrors, lastTopLevelIndex) allCode\n",
+ " let! result =\n",
+ " processSpiralOutput\n",
+ " {|\n",
+ " printCode = printCode\n",
+ " traceLevel = traceLevel\n",
+ " builderCommands = builderCommands\n",
+ " lastTopLevelIndex = lastTopLevelIndex\n",
+ " backend = backend\n",
+ " cancellationToken = cancellationToken\n",
+ " spiralErrors = spiralErrors\n",
+ " code = code\n",
+ " outputPath = outputPath\n",
+ " |}\n",
+ " match result, acc with\n",
+ " | (Ok code, errors), (Ok acc_code, acc_errors) ->\n",
+ " return Ok (acc_code @ code), acc_errors |> Array.append errors\n",
+ " | (Error ex, errors), _ | _, (Error ex, errors) ->\n",
+ " return Error ex, errors |> Array.append errors\n",
+ " | _ -> return acc\n",
+ " })\n",
" let cancellationToken = defaultArg cancellationToken System.Threading.CancellationToken.None\n",
+ " match result, errors with\n",
+ " | Ok code, [||] ->\n",
+ " let code, eval =\n",
+ " code\n",
+ " |> List.map (fun (code, eval) ->\n",
+ " if eval\n",
+ " then None, Some code\n",
+ " else Some code, None\n",
+ " )\n",
+ " |> List.unzip\n",
+ " let code = code |> List.choose id\n",
+ " let eval = eval |> List.choose id\n",
"\n",
- " let fsxResult =\n",
- " if builderCommand.Length > 0\n",
- " then None\n",
- " else\n",
- " try\n",
- " let ch, errors = fsi_eval code cancellationToken\n",
+ " trace Debug\n",
+ " (fun () -> $\"Eval.eval\")\n",
+ " (fun () -> $\"eval: {eval |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / code: {code |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / {_locals ()}\")\n",
+ " \n",
+ " let ch, errors =\n",
+ " match eval, code with\n",
+ " | [], [] ->\n",
+ " Choice2Of2 (Exception $\"Eval.eval / errors / buildCodeResults: %A{buildCodeResults} / code: %A{code}\"), errors\n",
+ " | [ eval ], [] ->\n",
+ " let ch, errors2 = fsi_eval eval cancellationToken\n",
" let errors =\n",
- " errors\n",
+ " errors2\n",
" |> Array.map (fun (e1, e2, e3, _) ->\n",
" (e1, e2, e3, (\"\", (0, 0), (0, 0)))\n",
" )\n",
- " let errors =\n",
- " if errors |> Array.isEmpty\n",
- " then errors\n",
- " else\n",
- " errors\n",
- " |> Array.append [|\n",
- " TraceLevel.Critical, $\"Eval.eval / fsi_eval errors / errors[-1] / fsxPath: {fsxPath} / builderCommand: %A{builderCommand} / code: {code |> SpiralSm.ellipsis_end 400}\", 0, (\"\", (0, 0), (0, 0))\n",
- " |]\n",
- " Some (ch, errors)\n",
- " with ex ->\n",
- " trace Critical (fun () -> $\"Eval.eval / fsi_eval try ex / code : {code |> SpiralSm.ellipsis_end 400} / ex: {ex |> SpiralSm.format_exception}\") _locals\n",
- " None\n",
- "\n",
- " match fsxResult, spiralBuilderResult with\n",
- " | Some (ch, errors), [||] ->\n",
- " let errors = errors |> Array.append spiralErrors\n",
- " match ch with\n",
- " | Choice1Of2 v ->\n",
- " allCode <- newAllCode\n",
- " return Ok(v), errors\n",
- " | Choice2Of2 ex -> return Error ex, errors\n",
- " | _, [||] ->\n",
- " let ch, errors = fsi_eval \"()\" cancellationToken\n",
- " match ch with\n",
- " | Choice1Of2 v ->\n",
- " allCode <- newAllCode\n",
- " return Ok(v), errors\n",
- " | Choice2Of2 ex ->\n",
- " return Error ex, errors\n",
- " | _, spiralBuilderResult ->\n",
- " try\n",
- " let codes =\n",
- " spiralBuilderResult\n",
- " |> Array.map (fun spiralBuilderResult' ->\n",
- " let spiralBuilderResult'', errors =\n",
- " match spiralBuilderResult' with\n",
- " | Ok x ->\n",
- " let x = x |> FSharp.Json.Json.deserialize>\n",
- " x, [||]\n",
- " | Error error ->\n",
- " ([] |> Map),\n",
- " [|\n",
- " (\n",
- " TraceLevel.Critical, $\"Eval.eval / evalResult error / errors[0] / fsxPath: {fsxPath} / builderCommand: %A{builderCommand} / spiralBuilderResult': %A{spiralBuilderResult'} / error: %A{error}\", 0, (\"\", (0, 0), (0, 0))\n",
- " )\n",
- " |]\n",
- "\n",
- " if errors |> Array.isEmpty |> not || spiralBuilderResult'' |> Map.containsKey \"command_result\" |> not\n",
- " then Error (Exception $\"Eval.eval / evalResult errors / Exception / spiralBuilderResult'': %A{spiralBuilderResult''}\"), errors\n",
- " else\n",
- " let commandResult = spiralBuilderResult''.[\"command_result\"] |> FSharp.Json.Json.deserialize>\n",
- "\n",
- " let extension = commandResult.[\"extension\"]\n",
- " if printCode\n",
- " then _trace (fun () -> $\"\"\".{extension}:{'\\n'}{commandResult.[\"code\"]}\"\"\")\n",
- " let code =\n",
- " let header =\n",
- " if printCode || spiralBuilderResult.Length > 1\n",
- " then $\".{extension} output:\\n\" else\n",
- " \"\"\n",
- " let output = commandResult.[\"output\"]\n",
- " $\"{header}{output}\"\n",
- " Ok code, [||]\n",
- " )\n",
- " let result, errors =\n",
- " (((Ok []), [||]), codes)\n",
- " ||> Array.fold (fun (acc_code, acc_errors) (code, errors) ->\n",
- " match code, acc_code with\n",
- " | Ok code, Ok acc_code ->\n",
- " let errors =\n",
- " acc_errors\n",
- " |> Array.append errors\n",
- " |> Array.append spiralErrors\n",
- " let errors =\n",
- " if errors |> Array.isEmpty\n",
- " then errors\n",
- " else\n",
- " errors\n",
- " |> Array.append [|\n",
- " TraceLevel.Critical, $\"Eval.eval / fsi_eval2 errors / errors[-1] / fsxPath: {fsxPath} / builderCommand: %A{builderCommand} / code: {code |> SpiralSm.ellipsis_end 400}\", 0, (\"\", (0, 0), (0, 0))\n",
- " |]\n",
- " Ok (code :: acc_code), errors\n",
- " | Error error, _\n",
- " | _, Error error ->\n",
- " Error error,\n",
- " acc_errors |> Array.append errors\n",
- " )\n",
- " match result with\n",
- " | Ok code ->\n",
+ " |> Array.append errors\n",
+ " ch, errors\n",
+ " | [], _ ->\n",
" let code = code |> List.rev |> String.concat \"\\n\\n\"\n",
" let code =\n",
" if printCode\n",
@@ -791,40 +1011,80 @@
" else $\"\\\"\\\"\\\"{code}\\n\\\"\\\"\\\"\"\n",
" let ch, errors2 = fsi_eval code cancellationToken\n",
" let errors =\n",
- " errors\n",
- " |> Array.append errors2\n",
- " match ch with\n",
- " | Choice1Of2 v ->\n",
- " allCode <- newAllCode\n",
- " return Ok(v), errors\n",
- " | Choice2Of2 ex ->\n",
- " return Error ex, errors\n",
- " | Error error ->\n",
- " return Error error, errors\n",
- " with ex ->\n",
- " trace Critical (fun () -> $\"Eval.eval / try 2 ex / spiralBuilderResult: %A{spiralBuilderResult} / ex: {ex |> SpiralSm.format_exception}\") _locals\n",
- " return Error (Exception $\"Eval.eval / try 2 ex / Exception / spiralBuilderResult: %A{spiralBuilderResult} / ex: {ex |> SpiralSm.format_exception}\"),\n",
- " [|\n",
- " (\n",
- " TraceLevel.Critical, $\"Eval.eval / try 2 ex / errors[0] / spiralBuilderResult: %A{spiralBuilderResult} / ex: {ex |> SpiralSm.format_exception}\", 0, (\"\", (0, 0), (0, 0))\n",
- " )\n",
- " |]\n",
- " | Some (Ok (_, _, errors)) when errors |> List.isEmpty |> not ->\n",
- " return errors.[0] |> fst |> Exception |> Error,\n",
- " mapErrors (TraceLevel.Critical, errors, lastTopLevelIndex) allCode\n",
+ " errors2\n",
+ " |> Array.map (fun (e1, e2, e3, _) ->\n",
+ " (e1, e2, e3, (\"\", (0, 0), (0, 0)))\n",
+ " )\n",
+ " |> Array.append errors\n",
+ " ch, errors\n",
+ " | _ ->\n",
+ " let code, errors =\n",
+ " ((Ok (code |> List.rev), [||]), eval)\n",
+ " ||> List.fold (fun (acc, acc_errors) eval ->\n",
+ " match acc with\n",
+ " | Error x -> Error x, acc_errors\n",
+ " | Ok acc ->\n",
+ " let ch, errors = fsi_eval eval cancellationToken\n",
+ " let errors =\n",
+ " errors\n",
+ " |> Array.map (fun (e1, e2, e3, _) ->\n",
+ " (e1, e2, e3, (\"\", (0, 0), (0, 0)))\n",
+ " )\n",
+ " |> Array.append acc_errors\n",
+ " match ch with\n",
+ " | Choice1Of2 v ->\n",
+ " let v =\n",
+ " v\n",
+ " |> tryGetPropertyValue \"ReflectionValue\"\n",
+ " |> Option.map (fun x -> $\"%A{x}\")\n",
+ " |> Option.defaultValue \"\"\n",
+ " Ok (v :: acc), errors\n",
+ " | Choice2Of2 ex ->\n",
+ " trace Critical (fun () -> $\"Eval.eval / fsi_eval fold Choice error / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}\") _locals\n",
+ " Error ch, errors\n",
+ " )\n",
+ " match code with\n",
+ " | Error ch -> ch, errors\n",
+ " | Ok code ->\n",
+ " let code =\n",
+ " code\n",
+ " |> List.filter ((<>) \"\")\n",
+ " |> String.concat \"\\n\\n\"\n",
+ " let code =\n",
+ " if printCode\n",
+ " then $\"\\\"\\\"\\\"{code}\\n\\n\\n\\\"\\\"\\\"\"\n",
+ " else $\"\\\"\\\"\\\"{code}\\n\\\"\\\"\\\"\"\n",
+ " let ch, errors2 = fsi_eval code cancellationToken\n",
+ " let errors =\n",
+ " errors2\n",
+ " |> Array.map (fun (e1, e2, e3, _) ->\n",
+ " (e1, e2, e3, (\"\", (0, 0), (0, 0)))\n",
+ " )\n",
+ " |> Array.append errors\n",
+ " ch, errors\n",
+ " match ch with\n",
+ " | Choice1Of2 v ->\n",
+ " allCode <- newAllCode\n",
+ " return Ok(v), errors\n",
+ " | Choice2Of2 ex ->\n",
+ " return Error ex, errors\n",
+ " | Ok code, errors ->\n",
+ " return Error (Exception \"Eval.eval / errors / buildCodeResults: %A{buildCodeResults} / code: %A{code}\"), errors\n",
+ " | Error error, errors ->\n",
+ " return Error error, errors\n",
" | Some (Error ex) ->\n",
- " trace Critical (fun () -> $\"Eval.eval / buildCodeResult Error / buildCodeResult: %A{buildCodeResult} / ex: {ex |> SpiralSm.format_exception}\") _locals\n",
- " return Error (Exception $\"Eval.eval / buildCodeResult Error / Exception / buildCodeResult: %A{buildCodeResult} / ex: {ex |> SpiralSm.format_exception}\"),\n",
+ " trace Critical (fun () -> $\"Eval.eval / buildCodeResults Error / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}\") _locals\n",
+ " return Error (Exception $\"Eval.eval / buildCodeResults Error / Exception / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}\"),\n",
" [|\n",
" (\n",
- " TraceLevel.Critical, $\"Eval.eval / buildCodeResult Error / errors[0] / buildCodeResult: %A{buildCodeResult} / ex: {ex |> SpiralSm.format_exception}\", 0, (\"\", (0, 0), (0, 0))\n",
+ " TraceLevel.Critical, $\"Eval.eval / buildCodeResults Error / errors[0] / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}\", 0, (\"\", (0, 0), (0, 0))\n",
" )\n",
" |]\n",
" | _ ->\n",
- " return Error (Exception $\"Eval.eval / buildCodeResult / Exception / buildCodeResult: %A{buildCodeResult}\"),\n",
+ " return Error (Exception $\"Eval.eval / buildCodeResults / Exception / buildCodeResults: %A{buildCodeResults}\"),\n",
" [|\n",
" (\n",
- " TraceLevel.Critical, $\"Eval.eval / buildCodeResult / errors[0] / buildCodeResult: %A{buildCodeResult}\", 0, (\"\", (0, 0), (0, 0))\n",
+ " TraceLevel.Critical, $\"Eval.eval / buildCodeResults / errors[0] / buildCodeResults: %A{buildCodeResults}\", 0, (\"\", (0, 0), (0, 0))\n",
" )\n",
" |]\n",
" with ex ->\n",
diff --git a/apps/spiral/Eval.fs b/apps/spiral/Eval.fs
index d74d56fc..a0ea9dc4 100644
--- a/apps/spiral/Eval.fs
+++ b/apps/spiral/Eval.fs
@@ -84,7 +84,7 @@ module Eval =
|> List.toArray
let workspaceRoot = SpiralFileSystem.get_workspace_root ()
- let targetDir = workspaceRoot > "target/polyglot/spiral_eval"
+ let targetDir = workspaceRoot > "target/spiral_Eval"
[ targetDir ]
|> List.iter (fun dir -> if Directory.Exists dir |> not then Directory.CreateDirectory dir |> ignore)
@@ -250,6 +250,298 @@ module Eval =
disposable.Dispose ()
)
+ /// ## prepareSpi
+ let prepareSpi rawCellCode lines =
+ let lastBlock =
+ lines
+ |> Array.tryFindBack (fun line ->
+ line |> String.length > 0
+ && line.[0] <> ' '
+ )
+
+ let hasMain =
+ lastBlock
+ |> Option.exists (fun line ->
+ line |> SpiralSm.starts_with "inl main "
+ || line |> SpiralSm.starts_with "let main "
+ )
+
+ if hasMain
+ then rawCellCode, None
+ else
+ let lastTopLevelIndex, _ =
+ (lines |> Array.indexed, (None, false))
+ ||> Array.foldBack (fun (i, line) (lastTopLevelIndex, finished) ->
+ trace Verbose (fun () -> $"Eval.prepareSpi / i: {i} / line: '{line}' / lastTopLevelIndex: {lastTopLevelIndex} / finished: {finished}") _locals
+ match line with
+ | _ when finished -> lastTopLevelIndex, true
+ | "" -> lastTopLevelIndex, false
+ | line when
+ line |> SpiralSm.starts_with " "
+ || line |> SpiralSm.starts_with "// " -> lastTopLevelIndex, false
+ | line when
+ line |> SpiralSm.starts_with "open "
+ || line |> SpiralSm.starts_with "prototype "
+ || line |> SpiralSm.starts_with "instance "
+ || line |> SpiralSm.starts_with "type "
+ || line |> SpiralSm.starts_with "union "
+ || line |> SpiralSm.starts_with "nominal " -> lastTopLevelIndex, true
+ | line when
+ line |> SpiralSm.starts_with "inl "
+ || line |> SpiralSm.starts_with "let " ->
+ let m =
+ System.Text.RegularExpressions.Regex.Match (
+ line,
+ @"^(inl|let) +([~\(\w][\w\d']*(?:| *[~\w][\w\d']*\)|, *[~\w][\w\d']*)) +[:=](?! +function)"
+ )
+ trace Verbose (fun () -> $"Eval.prepareSpi / m: '{m}' / m.Groups.Count: {m.Groups.Count}") _locals
+ if m.Groups.Count = 3
+ then Some i, false
+ else lastTopLevelIndex, true
+ | _ -> Some i, false
+ )
+ let code =
+ match lastTopLevelIndex with
+ | Some lastTopLevelIndex ->
+ lines
+ |> Array.mapi (fun i line ->
+ match i with
+ | i when i < lastTopLevelIndex -> line
+ | i when i = lastTopLevelIndex -> $"\nlet main () =\n {line}"
+ | _ when line |> SpiralSm.trim = "" -> ""
+ | _ -> $" {line}"
+ )
+ |> SpiralSm.concat "\n"
+ | None -> $"{rawCellCode}\n\ninl main () = ()\n"
+ code, lastTopLevelIndex
+
+ /// ## processSpiralOutput
+ let processSpiralOutput
+ (props : {|
+ printCode: bool
+ traceLevel: TraceLevel
+ builderCommands: string array
+ lastTopLevelIndex: int option
+ backend: Supervisor.Backend
+ cancellationToken: _
+ spiralErrors: _
+ code: string
+ outputPath: string
+ |})
+ = async {
+ let inline _trace (fn : unit -> string) =
+ if props.traceLevel = Verbose
+ then trace Info (fun () -> $"Eval.processSpiralOutput / props: {props |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / {fn ()}") _locals
+ else fn () |> System.Console.WriteLine
+
+ if props.printCode then
+ let ext = props.outputPath |> System.IO.Path.GetExtension
+ _trace (fun () -> if props.builderCommands.Length > 0 then $"{ext}:\n{props.code}\n" else props.code)
+
+ let workspaceRootExternal =
+ let currentDir =
+ System.IO.Directory.GetCurrentDirectory ()
+ |> SpiralSm.to_lower
+ let workspaceRoot = workspaceRoot |> SpiralSm.to_lower
+ if currentDir |> SpiralSm.starts_with workspaceRoot
+ then None
+ else Some workspaceRoot
+
+ let! spiralBuilderResults =
+ match props.builderCommands, props.lastTopLevelIndex with
+ | [||], _ | _, None -> [||] |> Async.init
+ | builderCommands, _ ->
+ builderCommands
+ |> Array.map (fun builderCommand ->
+ let path =
+ workspaceRoot > $@"workspace/target/release/spiral_builder{SpiralRuntime.get_executable_suffix ()}"
+ |> System.IO.Path.GetFullPath
+ let commands =
+ if props.backend = Supervisor.Fsharp
+ && (
+ builderCommand |> SpiralSm.starts_with "rust"
+ || builderCommand |> SpiralSm.starts_with "typescript"
+ || builderCommand |> SpiralSm.starts_with "python"
+ )
+ then [| $"{path} fable --fs-path \"{props.outputPath}\" --command \"{builderCommand}\"" |]
+ elif props.backend = Supervisor.Cuda
+ && builderCommand |> SpiralSm.starts_with "cuda"
+ then [| $"{path} {builderCommand} --py-path \"{props.outputPath}\"" |]
+ else [||]
+ builderCommand, commands
+ )
+ |> Array.filter (fun (_, commands) -> commands.Length > 0)
+ |> Array.map (fun (builderCommand, commands) ->
+ commands
+ |> Array.map (fun command -> async {
+ let! exitCode, result =
+ SpiralRuntime.execution_options (fun x ->
+ { x with
+ l0 = props.cancellationToken
+ l1 = command
+ l2 = [|
+ "AUTOMATION", assemblyName = "dotnet-repl" |> string
+ "TRACE_LEVEL", $"%A{Info}"
+ |]
+ l6 = workspaceRootExternal
+ }
+ )
+ |> SpiralRuntime.execute_with_options_async
+ trace Debug
+ (fun () -> $"Eval.processSpiralOutput / spiral_builder")
+ (fun () -> $"exitCode: {exitCode} / result: {result |> SpiralSm.ellipsis_end 400} / {_locals ()}")
+ return
+ if exitCode = 0
+ then (result, false) |> Ok
+ else result |> Error
+ })
+ )
+ |> Array.collect id
+ |> Async.Parallel
+
+ let hasEval =
+ props.backend = Supervisor.Fsharp
+ && props.builderCommands |> Array.exists (fun x -> x |> SpiralSm.starts_with "fsharp")
+
+ let outputResult =
+ if props.builderCommands.Length > 0 && not hasEval
+ then None
+ else
+ let code =
+ if props.printCode || props.builderCommands.Length > 1
+ then
+ let header = "System.Console.WriteLine \".fsx output:\"\n"
+ $"{header}{props.code}"
+ else props.code
+ Some (Ok [ code, true ])
+
+ match outputResult, spiralBuilderResults with
+ | Some outputResult, [||] ->
+ return outputResult, [||]
+ | None, [||] ->
+ return Ok [ "()", true ], [||]
+ | _, spiralBuilderResults ->
+ try
+ let spiralResults =
+ match outputResult with
+ | Some (Ok code) ->
+ spiralBuilderResults
+ |> Array.append (code |> List.map Ok |> List.toArray)
+ | _ -> spiralBuilderResults
+ let codes =
+ spiralResults
+ |> Array.map (fun spiralBuilderResult' ->
+ let spiralBuilderResult'', errors =
+ match spiralBuilderResult' with
+ | Ok (x, false) ->
+ let x = x |> FSharp.Json.Json.deserialize>
+ x, [||]
+ | Ok (x, true) ->
+ let result =
+ [
+ "command_result",
+ [
+ "extension", "fsx"
+ "code", x
+ "output", ""
+ ]
+ |> Map.ofList
+ |> FSharp.Json.Json.serialize
+ ]
+ |> Map.ofList
+ result, [||]
+
+ | Error error ->
+ ([] |> Map),
+ [|
+ (
+ TraceLevel.Critical, $"Eval.processSpiralOutput / evalResult error / errors[0] / outputPath: {props.outputPath} / builderCommands: %A{props.builderCommands} / spiralBuilderResult': %A{spiralBuilderResult'} / error: %A{error}", 0, ("", (0, 0), (0, 0))
+ )
+ |]
+
+ if errors |> Array.isEmpty |> not
+ || spiralBuilderResult'' |> Map.containsKey "command_result" |> not
+ then Error (Exception $"Eval.processSpiralOutput / evalResult errors / Exception / spiralBuilderResult'': %A{spiralBuilderResult''}"), errors
+ else
+ let commandResult = spiralBuilderResult''.["command_result"] |> FSharp.Json.Json.deserialize>
+
+ let extension = commandResult.["extension"]
+ let code = commandResult.["code"]
+ let output = commandResult.["output"]
+
+ if props.printCode
+ then _trace (fun () -> $""".{extension}:{'\n'}{code}""")
+
+ let eval = output = "" && extension = "fsx"
+
+ trace Debug
+ (fun () -> $"Eval.processSpiralOutput / result")
+ (fun () -> $"commandResult: {commandResult |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400}/ {_locals ()}")
+
+ let code =
+ if props.printCode
+ || spiralResults.Length > 1
+ || props.builderCommands.Length > 1
+ then
+ if eval then
+ code
+ else
+ let header =
+ if props.backend = Supervisor.Fsharp
+ then $".{extension} output:\n"
+ else $".{extension} output ({props.backend}):\n"
+ $"{header}{output}"
+ elif eval
+ then code
+ else output
+ Ok (code, eval), [||]
+ )
+ trace Debug
+ (fun () -> $"Eval.processSpiralOutput / codes")
+ (fun () ->
+ let props = {| props with cancellationToken = None |}
+ $"codes: {codes |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / spiralResults: {spiralResults |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / spiralBuilderResults: {spiralBuilderResults |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / props: {props |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / {_locals ()}")
+ return
+ (((Ok []), [||]), codes)
+ ||> Array.fold (fun (acc_code, acc_errors) (code, errors) ->
+ match code, acc_code with
+ | Ok code, Ok acc_code ->
+ let errors =
+ acc_errors
+ |> Array.append errors
+ |> Array.append props.spiralErrors
+ let errors =
+ if errors |> Array.isEmpty
+ then errors
+ else
+ errors
+ |> Array.append [|
+ TraceLevel.Critical, $"Eval.processSpiralOutput / errors / errors[-1] / outputPath: {props.outputPath} / builderCommands: %A{props.builderCommands} / code: {code |> fst |> SpiralSm.ellipsis_end 400}", 0, ("", (0, 0), (0, 0))
+ |]
+ Ok (code :: acc_code), errors
+ | Error error, _
+ | _, Error error ->
+ Error error,
+ acc_errors |> Array.append errors
+ )
+ with ex ->
+ trace Critical (fun () -> $"Eval.processSpiralOutput / try 2 ex / spiralBuilderResults: %A{spiralBuilderResults} / ex: {ex |> SpiralSm.format_exception}") _locals
+ return Error (Exception $"Eval.processSpiralOutput / try 2 ex / Exception / spiralBuilderResults: %A{spiralBuilderResults} / ex: {ex |> SpiralSm.format_exception}"),
+ [|
+ (
+ TraceLevel.Critical, $"Eval.processSpiralOutput / try 2 ex / errors[0] / spiralBuilderResults: %A{spiralBuilderResults} / ex: {ex |> SpiralSm.format_exception}", 0, ("", (0, 0), (0, 0))
+ )
+ |]
+ }
+
+ /// ## tryGetPropertyValue
+ let tryGetPropertyValue (propertyName: string) (obj: obj) =
+ let objType = obj.GetType ()
+ let propertyInfo = propertyName |> objType.GetProperty
+ if propertyInfo <> null
+ then propertyInfo.GetValue (obj, null) |> Some
+ else None
+
/// ## eval
let inline eval
(fsi_eval:
@@ -259,7 +551,9 @@ module Eval =
(cancellationToken: Option)
(code: string)
=
- trace Verbose (fun () -> $"Eval.eval / code: %A{code}") _locals
+ trace Verbose
+ (fun () -> $"Eval.eval")
+ (fun () -> $"code: {code |> SpiralSm.ellipsis_end 400} / {_locals ()}")
let rawCellCode =
code |> SpiralSm.replace "\r\n" "\n"
@@ -269,12 +563,12 @@ module Eval =
if lines |> Array.exists (fun line -> line |> SpiralSm.starts_with "#r " && line |> SpiralSm.ends_with "\"") then
let cancellationToken = defaultArg cancellationToken System.Threading.CancellationToken.None
let ch, errors = fsi_eval code cancellationToken
- trace Verbose (fun () -> $"Eval.eval / fsi_eval / ch: %A{ch} / errors: {errors}") _locals
+ trace Verbose (fun () -> $"Eval.eval / fsi_eval 1 / ch: %A{ch} / errors: {errors}") _locals
match ch with
| Choice1Of2 v -> Ok(v), errors
| Choice2Of2 ex -> Error(ex), errors
else
- let builderCommand =
+ let builderCommands =
lines
|> Array.choose (fun line ->
if line |> SpiralSm.starts_with "///! "
@@ -332,233 +626,99 @@ module Eval =
async {
try
- let lastBlock =
- lines
- |> Array.tryFindBack (fun line ->
- line |> String.length > 0
- && line.[0] <> ' '
- )
+ let cellCode, lastTopLevelIndex = prepareSpi rawCellCode lines
- let hasMain =
- lastBlock
- |> Option.exists (fun line ->
- line |> SpiralSm.starts_with "inl main "
- || line |> SpiralSm.starts_with "let main "
- )
+ let newAllCode = $"{allCode}\n\n{cellCode}"
- let cellCode, lastTopLevelIndex =
- if hasMain
- then rawCellCode, None
+ let buildBackends =
+ if builderCommands.Length = 0
+ then [| Supervisor.Fsharp |]
else
- let lastTopLevelIndex, _ =
- (lines |> Array.indexed, (None, false))
- ||> Array.foldBack (fun (i, line) (lastTopLevelIndex, finished) ->
- trace Debug (fun () -> $"i: {i} / line: '{line}' / lastTopLevelIndex: {lastTopLevelIndex} / finished: {finished}") _locals
- match line with
- | _ when finished -> lastTopLevelIndex, true
- | "" -> lastTopLevelIndex, false
- | line when
- line |> SpiralSm.starts_with " "
- || line |> SpiralSm.starts_with "// " -> lastTopLevelIndex, false
- | line when
- line |> SpiralSm.starts_with "open "
- || line |> SpiralSm.starts_with "prototype "
- || line |> SpiralSm.starts_with "instance "
- || line |> SpiralSm.starts_with "type "
- || line |> SpiralSm.starts_with "union "
- || line |> SpiralSm.starts_with "nominal " -> lastTopLevelIndex, true
- | line when
- line |> SpiralSm.starts_with "inl "
- || line |> SpiralSm.starts_with "let " ->
- let m =
- System.Text.RegularExpressions.Regex.Match (
- line,
- @"^(inl|let) +([~\(\w][\w\d']*(?:| *[~\w][\w\d']*\)|, *[~\w][\w\d']*)) +[:=](?! +function)"
- )
- trace Debug (fun () -> $"m: '{m}' / m.Groups.Count: {m.Groups.Count}") _locals
- if m.Groups.Count = 3
- then Some i, false
- else lastTopLevelIndex, true
- | _ -> Some i, false
- )
- let code =
- match lastTopLevelIndex with
- | Some lastTopLevelIndex ->
- lines
- |> Array.mapi (fun i line ->
- match i with
- | i when i < lastTopLevelIndex -> line
- | i when i = lastTopLevelIndex -> $"\nlet main () =\n {line}"
- | _ when line |> SpiralSm.trim = "" -> ""
- | _ -> $" {line}"
- )
- |> SpiralSm.concat "\n"
- | None -> $"{rawCellCode}\n\ninl main () = ()\n"
- code, lastTopLevelIndex
-
- let newAllCode = $"{allCode}\n\n{cellCode}"
+ builderCommands
+ |> Array.map (fun x ->
+ if x |> SpiralSm.starts_with "cuda"
+ then Supervisor.Cuda
+ else Supervisor.Fsharp
+ )
+ |> Array.distinct
- let! buildCodeResult =
- newAllCode
- |> Supervisor.buildCode isCache timeout cancellationToken
+ trace Verbose
+ (fun () -> $"Eval.eval")
+ (fun () -> $"cellCode: {cellCode |> SpiralSm.ellipsis_end 400} / lastTopLevelIndex: {lastTopLevelIndex} / builderCommands: %A{builderCommands} / buildBackends: %A{buildBackends} / {_locals ()}")
+
+ let! buildCodeResults =
+ buildBackends
+ |> Array.map (fun backend -> async {
+ let! result =
+ newAllCode
+ |> Supervisor.buildCode backend isCache timeout cancellationToken
+ return backend, result
+ })
+ |> Async.Parallel
|> Async.catch
|> Async.runWithTimeoutAsync timeout
- match buildCodeResult with
- | Some (Ok (_mainPath, (fsxPath, Some code), spiralErrors)) ->
- let spiralErrors =
- mapErrors (Warning, spiralErrors, lastTopLevelIndex) allCode
- let inline _trace (fn : unit -> string) =
- if isTrace
- then trace Info (fun () -> $"Eval.eval / {fn ()}") _locals
- else fn () |> System.Console.WriteLine
-
- if printCode
- then _trace (fun () -> if builderCommand.Length > 0 then $".fsx:\n{code}\n" else code)
-
- let! spiralBuilderResult =
- match builderCommand, lastTopLevelIndex with
- | [||], _ | _, None -> [||] |> Async.init
- | builderCommand, _ -> async {
- let workspaceRootExternal =
- let currentDir =
- System.IO.Directory.GetCurrentDirectory ()
- |> SpiralSm.to_lower
- let workspaceRoot = workspaceRoot |> SpiralSm.to_lower
- if currentDir |> SpiralSm.starts_with workspaceRoot
- then None
- else Some workspaceRoot
- return!
- builderCommand
- |> Array.map (fun builderCommand -> async {
- let! exitCode, result =
- SpiralRuntime.execution_options (fun x ->
- { x with
- l0 = cancellationToken
- l1 =
- let path =
- workspaceRoot > $@"workspace/target/release/spiral_builder{SpiralRuntime.get_executable_suffix ()}"
- |> System.IO.Path.GetFullPath
- $"{path} fsharp --fs-path \"{fsxPath}\" --command \"{builderCommand}\""
- l2 = [|
- "AUTOMATION", assemblyName = "dotnet-repl" |> string
- "TRACE_LEVEL", $"%A{traceLevel}"
- |]
- l6 = workspaceRootExternal
- }
- )
- |> SpiralRuntime.execute_with_options_async
- trace Debug (fun () -> $"Eval.eval / spiral_builder / exitCode: {exitCode} / result: {result |> SpiralSm.ellipsis_end 400}") _locals
- return
- if exitCode = 0
- then result |> Ok
- else result |> Error
- })
- |> Async.Parallel
- }
-
+ match buildCodeResults with
+ | Some (Ok buildCodeResults) ->
+ let! result, errors =
+ ((Ok [], [||]), buildCodeResults)
+ ||> Async.fold (fun acc buildCodeResult -> async {
+ match buildCodeResult with
+ | (backend, (spiPath, (outputPath, Some code), spiralErrors)) ->
+ let spiralErrors =
+ mapErrors (Warning, spiralErrors, lastTopLevelIndex) allCode
+ let! result =
+ processSpiralOutput
+ {|
+ printCode = printCode
+ traceLevel = traceLevel
+ builderCommands = builderCommands
+ lastTopLevelIndex = lastTopLevelIndex
+ backend = backend
+ cancellationToken = cancellationToken
+ spiralErrors = spiralErrors
+ code = code
+ outputPath = outputPath
+ |}
+ match result, acc with
+ | (Ok code, errors), (Ok acc_code, acc_errors) ->
+ return Ok (acc_code @ code), acc_errors |> Array.append errors
+ | (Error ex, errors), _ | _, (Error ex, errors) ->
+ return Error ex, errors |> Array.append errors
+ | _ -> return acc
+ })
let cancellationToken = defaultArg cancellationToken System.Threading.CancellationToken.None
-
- let fsxResult =
- if builderCommand.Length > 0
- then None
- else
- try
- let ch, errors = fsi_eval code cancellationToken
+ match result, errors with
+ | Ok code, [||] ->
+ let code, eval =
+ code
+ |> List.map (fun (code, eval) ->
+ if eval
+ then None, Some code
+ else Some code, None
+ )
+ |> List.unzip
+ let code = code |> List.choose id
+ let eval = eval |> List.choose id
+
+ trace Debug
+ (fun () -> $"Eval.eval")
+ (fun () -> $"eval: {eval |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / code: {code |> FSharp.Json.Json.serialize |> SpiralSm.ellipsis_end 400} / {_locals ()}")
+
+ let ch, errors =
+ match eval, code with
+ | [], [] ->
+ Choice2Of2 (Exception $"Eval.eval / errors / buildCodeResults: %A{buildCodeResults} / code: %A{code}"), errors
+ | [ eval ], [] ->
+ let ch, errors2 = fsi_eval eval cancellationToken
let errors =
- errors
+ errors2
|> Array.map (fun (e1, e2, e3, _) ->
(e1, e2, e3, ("", (0, 0), (0, 0)))
)
- let errors =
- if errors |> Array.isEmpty
- then errors
- else
- errors
- |> Array.append [|
- TraceLevel.Critical, $"Eval.eval / fsi_eval errors / errors[-1] / fsxPath: {fsxPath} / builderCommand: %A{builderCommand} / code: {code |> SpiralSm.ellipsis_end 400}", 0, ("", (0, 0), (0, 0))
- |]
- Some (ch, errors)
- with ex ->
- trace Critical (fun () -> $"Eval.eval / fsi_eval try ex / code : {code |> SpiralSm.ellipsis_end 400} / ex: {ex |> SpiralSm.format_exception}") _locals
- None
-
- match fsxResult, spiralBuilderResult with
- | Some (ch, errors), [||] ->
- let errors = errors |> Array.append spiralErrors
- match ch with
- | Choice1Of2 v ->
- allCode <- newAllCode
- return Ok(v), errors
- | Choice2Of2 ex -> return Error ex, errors
- | _, [||] ->
- let ch, errors = fsi_eval "()" cancellationToken
- match ch with
- | Choice1Of2 v ->
- allCode <- newAllCode
- return Ok(v), errors
- | Choice2Of2 ex ->
- return Error ex, errors
- | _, spiralBuilderResult ->
- try
- let codes =
- spiralBuilderResult
- |> Array.map (fun spiralBuilderResult' ->
- let spiralBuilderResult'', errors =
- match spiralBuilderResult' with
- | Ok x ->
- let x = x |> FSharp.Json.Json.deserialize>
- x, [||]
- | Error error ->
- ([] |> Map),
- [|
- (
- TraceLevel.Critical, $"Eval.eval / evalResult error / errors[0] / fsxPath: {fsxPath} / builderCommand: %A{builderCommand} / spiralBuilderResult': %A{spiralBuilderResult'} / error: %A{error}", 0, ("", (0, 0), (0, 0))
- )
- |]
-
- if errors |> Array.isEmpty |> not || spiralBuilderResult'' |> Map.containsKey "command_result" |> not
- then Error (Exception $"Eval.eval / evalResult errors / Exception / spiralBuilderResult'': %A{spiralBuilderResult''}"), errors
- else
- let commandResult = spiralBuilderResult''.["command_result"] |> FSharp.Json.Json.deserialize>
-
- let extension = commandResult.["extension"]
- if printCode
- then _trace (fun () -> $""".{extension}:{'\n'}{commandResult.["code"]}""")
- let code =
- let header =
- if printCode || spiralBuilderResult.Length > 1
- then $".{extension} output:\n" else
- ""
- let output = commandResult.["output"]
- $"{header}{output}"
- Ok code, [||]
- )
- let result, errors =
- (((Ok []), [||]), codes)
- ||> Array.fold (fun (acc_code, acc_errors) (code, errors) ->
- match code, acc_code with
- | Ok code, Ok acc_code ->
- let errors =
- acc_errors
- |> Array.append errors
- |> Array.append spiralErrors
- let errors =
- if errors |> Array.isEmpty
- then errors
- else
- errors
- |> Array.append [|
- TraceLevel.Critical, $"Eval.eval / fsi_eval2 errors / errors[-1] / fsxPath: {fsxPath} / builderCommand: %A{builderCommand} / code: {code |> SpiralSm.ellipsis_end 400}", 0, ("", (0, 0), (0, 0))
- |]
- Ok (code :: acc_code), errors
- | Error error, _
- | _, Error error ->
- Error error,
- acc_errors |> Array.append errors
- )
- match result with
- | Ok code ->
+ |> Array.append errors
+ ch, errors
+ | [], _ ->
let code = code |> List.rev |> String.concat "\n\n"
let code =
if printCode
@@ -566,40 +726,80 @@ module Eval =
else $"\"\"\"{code}\n\"\"\""
let ch, errors2 = fsi_eval code cancellationToken
let errors =
- errors
- |> Array.append errors2
- match ch with
- | Choice1Of2 v ->
- allCode <- newAllCode
- return Ok(v), errors
- | Choice2Of2 ex ->
- return Error ex, errors
- | Error error ->
- return Error error, errors
- with ex ->
- trace Critical (fun () -> $"Eval.eval / try 2 ex / spiralBuilderResult: %A{spiralBuilderResult} / ex: {ex |> SpiralSm.format_exception}") _locals
- return Error (Exception $"Eval.eval / try 2 ex / Exception / spiralBuilderResult: %A{spiralBuilderResult} / ex: {ex |> SpiralSm.format_exception}"),
- [|
- (
- TraceLevel.Critical, $"Eval.eval / try 2 ex / errors[0] / spiralBuilderResult: %A{spiralBuilderResult} / ex: {ex |> SpiralSm.format_exception}", 0, ("", (0, 0), (0, 0))
- )
- |]
- | Some (Ok (_, _, errors)) when errors |> List.isEmpty |> not ->
- return errors.[0] |> fst |> Exception |> Error,
- mapErrors (TraceLevel.Critical, errors, lastTopLevelIndex) allCode
+ errors2
+ |> Array.map (fun (e1, e2, e3, _) ->
+ (e1, e2, e3, ("", (0, 0), (0, 0)))
+ )
+ |> Array.append errors
+ ch, errors
+ | _ ->
+ let code, errors =
+ ((Ok (code |> List.rev), [||]), eval)
+ ||> List.fold (fun (acc, acc_errors) eval ->
+ match acc with
+ | Error x -> Error x, acc_errors
+ | Ok acc ->
+ let ch, errors = fsi_eval eval cancellationToken
+ let errors =
+ errors
+ |> Array.map (fun (e1, e2, e3, _) ->
+ (e1, e2, e3, ("", (0, 0), (0, 0)))
+ )
+ |> Array.append acc_errors
+ match ch with
+ | Choice1Of2 v ->
+ let v =
+ v
+ |> tryGetPropertyValue "ReflectionValue"
+ |> Option.map (fun x -> $"%A{x}")
+ |> Option.defaultValue ""
+ Ok (v :: acc), errors
+ | Choice2Of2 ex ->
+ trace Critical (fun () -> $"Eval.eval / fsi_eval fold Choice error / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}") _locals
+ Error ch, errors
+ )
+ match code with
+ | Error ch -> ch, errors
+ | Ok code ->
+ let code =
+ code
+ |> List.filter ((<>) "")
+ |> String.concat "\n\n"
+ let code =
+ if printCode
+ then $"\"\"\"{code}\n\n\n\"\"\""
+ else $"\"\"\"{code}\n\"\"\""
+ let ch, errors2 = fsi_eval code cancellationToken
+ let errors =
+ errors2
+ |> Array.map (fun (e1, e2, e3, _) ->
+ (e1, e2, e3, ("", (0, 0), (0, 0)))
+ )
+ |> Array.append errors
+ ch, errors
+ match ch with
+ | Choice1Of2 v ->
+ allCode <- newAllCode
+ return Ok(v), errors
+ | Choice2Of2 ex ->
+ return Error ex, errors
+ | Ok code, errors ->
+ return Error (Exception "Eval.eval / errors / buildCodeResults: %A{buildCodeResults} / code: %A{code}"), errors
+ | Error error, errors ->
+ return Error error, errors
| Some (Error ex) ->
- trace Critical (fun () -> $"Eval.eval / buildCodeResult Error / buildCodeResult: %A{buildCodeResult} / ex: {ex |> SpiralSm.format_exception}") _locals
- return Error (Exception $"Eval.eval / buildCodeResult Error / Exception / buildCodeResult: %A{buildCodeResult} / ex: {ex |> SpiralSm.format_exception}"),
+ trace Critical (fun () -> $"Eval.eval / buildCodeResults Error / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}") _locals
+ return Error (Exception $"Eval.eval / buildCodeResults Error / Exception / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}"),
[|
(
- TraceLevel.Critical, $"Eval.eval / buildCodeResult Error / errors[0] / buildCodeResult: %A{buildCodeResult} / ex: {ex |> SpiralSm.format_exception}", 0, ("", (0, 0), (0, 0))
+ TraceLevel.Critical, $"Eval.eval / buildCodeResults Error / errors[0] / buildCodeResults: %A{buildCodeResults} / ex: {ex |> SpiralSm.format_exception}", 0, ("", (0, 0), (0, 0))
)
|]
| _ ->
- return Error (Exception $"Eval.eval / buildCodeResult / Exception / buildCodeResult: %A{buildCodeResult}"),
+ return Error (Exception $"Eval.eval / buildCodeResults / Exception / buildCodeResults: %A{buildCodeResults}"),
[|
(
- TraceLevel.Critical, $"Eval.eval / buildCodeResult / errors[0] / buildCodeResult: %A{buildCodeResult}", 0, ("", (0, 0), (0, 0))
+ TraceLevel.Critical, $"Eval.eval / buildCodeResults / errors[0] / buildCodeResults: %A{buildCodeResults}", 0, ("", (0, 0), (0, 0))
)
|]
with ex ->
diff --git a/apps/spiral/Supervisor.dib b/apps/spiral/Supervisor.dib
index 95dede11..cf99a661 100644
--- a/apps/spiral/Supervisor.dib
+++ b/apps/spiral/Supervisor.dib
@@ -232,11 +232,21 @@ let inline getCompilerPort () =
#!markdown
+## Backend
+
+#!fsharp
+
+type Backend =
+ | Fsharp
+ | Cuda
+
+#!markdown
+
## buildFile
#!fsharp
-let inline buildFile timeout port cancellationToken path = async {
+let inline buildFile backend timeout port cancellationToken path = async {
let fullPath = path |> System.IO.Path.GetFullPath
let fileDir = fullPath |> System.IO.Path.GetDirectoryName
let fileName = fullPath |> System.IO.Path.GetFileNameWithoutExtension
@@ -252,11 +262,16 @@ let inline buildFile timeout port cancellationToken path = async {
let! serverPort, errors, ct, disposable = awaitCompiler port (Some token)
use _ = disposable
- let fsxContentSeq =
+ let outputFileName =
+ match backend with
+ | Fsharp -> $"{fileName}.fsx"
+ | Cuda -> $"{fileName}.py"
+
+ let outputContentSeq =
stream
|> FSharp.Control.AsyncSeq.chooseAsync (function
| _, (FileSystem.FileSystemChange.Changed (path, _))
- when (path |> System.IO.Path.GetFileName) = $"{fileName}.fsx"
+ when (path |> System.IO.Path.GetFileName) = outputFileName
->
fileDir > path |> SpiralFileSystem.read_all_text_retry_async
| _ -> None |> Async.init
@@ -301,30 +316,30 @@ let inline buildFile timeout port cancellationToken path = async {
|> FSharp.Control.AsyncSeq.map (fun _ -> None, None)
let outputSeq =
- [ fsxContentSeq; errorsSeq; timerSeq ]
+ [ outputContentSeq; errorsSeq; timerSeq ]
|> FSharp.Control.AsyncSeq.mergeAll
let! outputChild =
((None, [], 0), outputSeq)
||> FSharp.Control.AsyncSeq.scan (
- fun (fsxContentResult, errors, typeErrorCount) (fsxContent, error) ->
- match fsxContent, error with
- | Some fsxContent, None -> Some fsxContent, errors, typeErrorCount
+ fun (outputContentResult, errors, typeErrorCount) (outputContent, error) ->
+ match outputContent, error with
+ | Some outputContent, None -> Some outputContent, errors, typeErrorCount
| None, Some (_, FatalError "File main has a type error somewhere in its path.") ->
- fsxContentResult, errors, typeErrorCount + 1
- | None, Some error -> fsxContentResult, error :: errors, typeErrorCount
+ outputContentResult, errors, typeErrorCount + 1
+ | None, Some error -> outputContentResult, error :: errors, typeErrorCount
| None, None when typeErrorCount >= 1 ->
- fsxContentResult, errors, typeErrorCount + 1
- | _ -> fsxContentResult, errors, typeErrorCount
+ outputContentResult, errors, typeErrorCount + 1
+ | _ -> outputContentResult, errors, typeErrorCount
)
- |> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (fsxContent, errors, typeErrorCount) ->
- trace Debug (fun () -> $"buildFile / takeWhileInclusive / path: {path} / fsxContent: {fsxContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount}") _locals
+ |> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (outputContent, errors, typeErrorCount) ->
+ trace Debug (fun () -> $"Supervisor.buildFile / takeWhileInclusive / path: {path} / outputContent: {outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount}") _locals
#if INTERACTIVE
let errorWait = 2
#else
let errorWait = 4
#endif
- match fsxContent, errors with
+ match outputContent, errors with
| None, [] when typeErrorCount > errorWait -> false
| None, [] -> true
| _ -> false
@@ -342,16 +357,20 @@ let inline buildFile timeout port cancellationToken path = async {
// do! Async.Sleep 60
- let buildFileObj = {| BuildFile = {| uri = fullPathUri; backend = "Fsharp" |} |}
+ let backendId =
+ match backend with
+ | Fsharp -> "Fsharp"
+ | Cuda -> "Python + Cuda"
+ let buildFileObj = {| BuildFile = {| uri = fullPathUri; backend = backendId |} |}
let! _buildFileResult = buildFileObj |> sendObj serverPort
let! result =
outputChild
|> Async.map (function
- | Some (Ok (Some (fsxCode, errors, _))) ->
- fsxCode, errors |> List.distinct |> List.rev
+ | Some (Ok (Some (outputCode, errors, _))) ->
+ outputCode, errors |> List.distinct |> List.rev
| Some (Error ex) ->
- trace Critical (fun () -> $"buildFile / error: {ex |> serializeObj}") _locals
+ trace Critical (fun () -> $"Supervisor.buildFile / error: {ex |> serializeObj}") _locals
None, []
| _ -> None, []
)
@@ -362,8 +381,8 @@ let inline buildFile timeout port cancellationToken path = async {
let! _fileDeleteResult = fileDeleteObj |> sendObj serverPort
()
- let fsxPath = fileDir > $"{fileName}.fsx"
- return fsxPath, result
+ let outputPath = fileDir > outputFileName
+ return outputPath, result
}
#!markdown
@@ -372,20 +391,20 @@ let inline buildFile timeout port cancellationToken path = async {
#!fsharp
-let inline persistCode code = async {
+let inline persistCode backend code = async {
let targetDir = workspaceRoot > "target/spiral_Eval"
let packagesDir = targetDir > "packages"
- let hashHex = code |> SpiralCrypto.hash_text
+ let hashHex = $"{backend}{code}" |> SpiralCrypto.hash_text
let codeDir = packagesDir > hashHex
- let mainPath = codeDir > "main.spi"
+ let spiPath = codeDir > "main.spi"
codeDir |> System.IO.Directory.CreateDirectory |> ignore
- do! code |> SpiralFileSystem.write_all_text_exists mainPath
+ do! code |> SpiralFileSystem.write_all_text_exists spiPath
let spiprojPath = codeDir > "package.spiproj"
let spiprojCode =
@@ -398,18 +417,25 @@ modules:
"""
do! spiprojCode |> SpiralFileSystem.write_all_text_exists spiprojPath
- let fsxPath = codeDir > "main.fsx"
-
- if fsxPath |> System.IO.File.Exists |> not
- then return mainPath, None
- else
- let! oldCode = mainPath |> SpiralFileSystem.read_all_text_async
- if oldCode <> code
- then return mainPath, None
+ match backend with
+ | None -> return spiPath, None
+ | Some backend ->
+ let outputFileName =
+ match backend with
+ | Fsharp -> $"main.fsx"
+ | Cuda -> $"main.py"
+ let outputPath = codeDir > outputFileName
+
+ if outputPath |> System.IO.File.Exists |> not
+ then return spiPath, None
else
- let! fsxCode = fsxPath |> SpiralFileSystem.read_all_text_async
- return mainPath, Some (fsxPath, fsxCode |> SpiralSm.replace "\r\n" "\n")
-}
+ let! oldCode = spiPath |> SpiralFileSystem.read_all_text_async
+ if oldCode <> code
+ then return spiPath, None
+ else
+ let! outputCode = outputPath |> SpiralFileSystem.read_all_text_async
+ return spiPath, Some (outputPath, outputCode |> SpiralSm.replace "\r\n" "\n")
+ }
#!markdown
@@ -417,13 +443,13 @@ modules:
#!fsharp
-let inline buildCode cache timeout cancellationToken code = async {
- let! mainPath, fsx = code |> persistCode
- match fsx with
- | Some (fsxPath, fsxCode) when cache -> return mainPath, (fsxPath, Some fsxCode), []
+let inline buildCode backend cache timeout cancellationToken code = async {
+ let! mainPath, outputCache = code |> persistCode (Some backend)
+ match outputCache with
+ | Some (outputPath, outputCode) when cache -> return mainPath, (outputPath, Some outputCode), []
| _ ->
- let! fsxPath, (fsxCode, errors) = mainPath |> buildFile timeout None cancellationToken
- return mainPath, (fsxPath, fsxCode), errors
+ let! outputPath, (outputCode, errors) = mainPath |> buildFile backend timeout None cancellationToken
+ return mainPath, (outputPath, outputCode), errors
}
#!fsharp
@@ -445,9 +471,9 @@ inl main () =
|> dyn
|> ignore
"""
-|> buildCode false 15000 None
+|> buildCode Fsharp false 15000 None
|> Async.runWithTimeout 15000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some """let rec closure0 () () : int32 =
@@ -467,7 +493,7 @@ let v0 : (unit -> int32) = closure0()
//// test
""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
|> _assertEqual None
@@ -478,9 +504,9 @@ let v0 : (unit -> int32) = closure0()
"""inl main () =
1i32 / 0i32
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
@@ -495,9 +521,9 @@ let v0 : (unit -> int32) = closure0()
"""inl main () =
1 + ""
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
@@ -517,9 +543,9 @@ Fails to satisfy: number"
"""inl main () =
x + y
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
@@ -544,9 +570,9 @@ inl main () =
real_unbox ()
()
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
@@ -566,9 +592,9 @@ inl main () =
| _ => obj
real_unbox `i32 1
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
@@ -596,9 +622,9 @@ inl integral dt : integration =
inl main () =
integral 0.1 (fun x => x ** 2) 0 1
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some "0.3325000000000001\n",
@@ -617,6 +643,58 @@ inl init_series start end inc =
type integration = (f64 -> f64) -> f64 -> f64 -> f64
+inl integral dt : integration =
+ fun f a b =>
+ init_series (a + dt / 2) (b - dt / 2) dt
+ |> listm.map (f >> (*) dt)
+ |> listm.fold (+) 0
+
+inl main () =
+ integral 0.1 (fun x => x ** 2) 0 1
+"""
+|> buildCode Cuda false 10000 None
+|> Async.runWithTimeout 10000
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
+|> _assertEqual (
+ Some (
+ Some "kernel = r\"\"\"
+template struct static_array { el v[dim]; };
+template struct static_array_list { el v[dim]; default_int length; };
+\"\"\"
+class static_array(list):
+ def __init__(self, length):
+ for _ in range(length):
+ self.append(None)
+
+class static_array_list(static_array):
+ def __init__(self, length):
+ super().__init__(length)
+ self.length = 0
+import cupy as cp
+from dataclasses import dataclass
+from typing import NamedTuple, Union, Callable, Tuple
+i8 = i16 = i32 = i64 = u8 = u16 = u32 = u64 = int; f32 = f64 = float; char = string = str
+
+def main():
+ return 0.3325000000000001
+
+if __name__ == '__main__': result = main(); None if result is None else print(result)
+",
+ []
+ )
+)
+
+#!fsharp
+
+//// test
+
+"""
+inl init_series start end inc =
+ inl total : f64 = conv ((end - start) / inc) + 1
+ listm.init total (conv >> (*) inc >> (+) start) : list f64
+
+type integration = (f64 -> f64) -> f64 -> f64 -> f64
+
inl integral dt : integration =
fun f a b =>
init_series (a + dt / 2) (b - dt / 2) dt
@@ -626,9 +704,9 @@ inl integral dt : integration =
inl main () =
integral 0.01 (fun x => x ** 2) 0 1
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some "0.33332500000000004\n",
@@ -697,7 +775,7 @@ let inline getFileTokenRange port cancellationToken path = async {
#!fsharp
let inline getCodeTokenRange cancellationToken code = async {
- let! mainPath, _ = persistCode code
+ let! mainPath, _ = persistCode None code
let codeDir = mainPath |> System.IO.Path.GetDirectoryName
let tokensPath = codeDir > "tokens.json"
@@ -834,7 +912,14 @@ let main args =
let buildFileAsync =
buildFileActions
|> List.map (fun (inputPath, outputPath) -> async {
- let! _fsxPath, (outputCode, errors) = inputPath |> buildFile timeout (Some serverPort) None
+ let! _outputPath, (outputCode, errors) =
+ let backend =
+ if outputPath |> SpiralSm.ends_with ".fsx"
+ then Fsharp
+ elif outputPath |> SpiralSm.ends_with ".py"
+ then Cuda
+ else failwith $"Supervisor.main / invalid backend / outputPath: {outputPath}"
+ inputPath |> buildFile backend timeout (Some serverPort) None
errors
|> List.map snd
@@ -882,7 +967,7 @@ let main args =
trace Debug (fun () -> $"main / executeCommand / exitCode: {exitCode} / command: {command}") _locals
- if isExitOnError && exitCode > 0
+ if isExitOnError && exitCode <> 0
then SpiralRuntime.current_process_kill ()
return exitCode
diff --git a/apps/spiral/Supervisor.dib.html b/apps/spiral/Supervisor.dib.html
index 575f5d21..b1d2d713 100644
--- a/apps/spiral/Supervisor.dib.html
+++ b/apps/spiral/Supervisor.dib.html
@@ -7938,7 +7938,7 @@ serialize_obj
@@ -7950,7 +7950,34 @@ buildFile¶
In [ ]:
-let inline buildFile timeout port cancellationToken path = async {
+type Backend =
+ | Fsharp
+ | Cuda
+
+
+
+
+
+
+
+
+
+
+
+
+buildFile¶
+
+
+
+
+
+
+
+
+In [ ]:
+
+
+let inline buildFile backend timeout port cancellationToken path = async {
let fullPath = path |> System.IO.Path.GetFullPath
let fileDir = fullPath |> System.IO.Path.GetDirectoryName
let fileName = fullPath |> System.IO.Path.GetFileNameWithoutExtension
@@ -7966,11 +7993,16 @@ buildFile¶
let! serverPort, errors, ct, disposable = awaitCompiler port (Some token)
use _ = disposable
- let fsxContentSeq =
+ let outputFileName =
+ match backend with
+ | Fsharp -> $"{fileName}.fsx"
+ | Cuda -> $"{fileName}.py"
+
+ let outputContentSeq =
stream
|> FSharp.Control.AsyncSeq.chooseAsync (function
| _, (FileSystem.FileSystemChange.Changed (path, _))
- when (path |> System.IO.Path.GetFileName) = $"{fileName}.fsx"
+ when (path |> System.IO.Path.GetFileName) = outputFileName
->
fileDir </> path |> SpiralFileSystem.read_all_text_retry_async
| _ -> None |> Async.init
@@ -8015,30 +8047,30 @@ buildFile¶
|> FSharp.Control.AsyncSeq.map (fun _ -> None, None)
let outputSeq =
- [ fsxContentSeq; errorsSeq; timerSeq ]
+ [ outputContentSeq; errorsSeq; timerSeq ]
|> FSharp.Control.AsyncSeq.mergeAll
let! outputChild =
((None, [], 0), outputSeq)
||> FSharp.Control.AsyncSeq.scan (
- fun (fsxContentResult, errors, typeErrorCount) (fsxContent, error) ->
- match fsxContent, error with
- | Some fsxContent, None -> Some fsxContent, errors, typeErrorCount
+ fun (outputContentResult, errors, typeErrorCount) (outputContent, error) ->
+ match outputContent, error with
+ | Some outputContent, None -> Some outputContent, errors, typeErrorCount
| None, Some (_, FatalError "File main has a type error somewhere in its path.") ->
- fsxContentResult, errors, typeErrorCount + 1
- | None, Some error -> fsxContentResult, error :: errors, typeErrorCount
+ outputContentResult, errors, typeErrorCount + 1
+ | None, Some error -> outputContentResult, error :: errors, typeErrorCount
| None, None when typeErrorCount >= 1 ->
- fsxContentResult, errors, typeErrorCount + 1
- | _ -> fsxContentResult, errors, typeErrorCount
+ outputContentResult, errors, typeErrorCount + 1
+ | _ -> outputContentResult, errors, typeErrorCount
)
- |> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (fsxContent, errors, typeErrorCount) ->
- trace Debug (fun () -> $"buildFile / takeWhileInclusive / path: {path} / fsxContent: {fsxContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount}") _locals
+ |> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (outputContent, errors, typeErrorCount) ->
+ trace Debug (fun () -> $"Supervisor.buildFile / takeWhileInclusive / path: {path} / outputContent: {outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount}") _locals
#if INTERACTIVE
let errorWait = 2
#else
let errorWait = 4
#endif
- match fsxContent, errors with
+ match outputContent, errors with
| None, [] when typeErrorCount > errorWait -> false
| None, [] -> true
| _ -> false
@@ -8056,16 +8088,20 @@ buildFile¶
// do! Async.Sleep 60
- let buildFileObj = {| BuildFile = {| uri = fullPathUri; backend = "Fsharp" |} |}
+ let backendId =
+ match backend with
+ | Fsharp -> "Fsharp"
+ | Cuda -> "Python + Cuda"
+ let buildFileObj = {| BuildFile = {| uri = fullPathUri; backend = backendId |} |}
let! _buildFileResult = buildFileObj |> sendObj serverPort
let! result =
outputChild
|> Async.map (function
- | Some (Ok (Some (fsxCode, errors, _))) ->
- fsxCode, errors |> List.distinct |> List.rev
+ | Some (Ok (Some (outputCode, errors, _))) ->
+ outputCode, errors |> List.distinct |> List.rev
| Some (Error ex) ->
- trace Critical (fun () -> $"buildFile / error: {ex |> serializeObj}") _locals
+ trace Critical (fun () -> $"Supervisor.buildFile / error: {ex |> serializeObj}") _locals
None, []
| _ -> None, []
)
@@ -8076,8 +8112,8 @@ buildFile¶
let! _fileDeleteResult = fileDeleteObj |> sendObj serverPort
()
- let fsxPath = fileDir </> $"{fileName}.fsx"
- return fsxPath, result
+ let outputPath = fileDir </> outputFileName
+ return outputPath, result
}
@@ -8085,7 +8121,7 @@ buildFile¶
-
+
@@ -8095,7 +8131,7 @@ persistCode¶
-
+
@@ -8103,20 +8139,20 @@ persistCode¶In [ ]:
-let inline persistCode code = async {
- let targetDir = workspaceRoot </> "target/polyglot/spiral_eval"
+let inline persistCode backend code = async {
+ let targetDir = workspaceRoot </> "target/spiral_Eval"
let packagesDir = targetDir </> "packages"
- let hashHex = code |> SpiralCrypto.hash_text
+ let hashHex = $"{backend}{code}" |> SpiralCrypto.hash_text
let codeDir = packagesDir </> hashHex
- let mainPath = codeDir </> "main.spi"
+ let spiPath = codeDir </> "main.spi"
codeDir |> System.IO.Directory.CreateDirectory |> ignore
- do! code |> SpiralFileSystem.write_all_text_exists mainPath
+ do! code |> SpiralFileSystem.write_all_text_exists spiPath
let spiprojPath = codeDir </> "package.spiproj"
let spiprojCode =
@@ -8129,25 +8165,32 @@ persistCode¶"""
do! spiprojCode |> SpiralFileSystem.write_all_text_exists spiprojPath
- let fsxPath = codeDir </> "main.fsx"
-
- if fsxPath |> System.IO.File.Exists |> not
- then return mainPath, None
- else
- let! oldCode = mainPath |> SpiralFileSystem.read_all_text_async
- if oldCode <> code
- then return mainPath, None
+ match backend with
+ | None -> return spiPath, None
+ | Some backend ->
+ let outputFileName =
+ match backend with
+ | Fsharp -> $"main.fsx"
+ | Cuda -> $"main.py"
+ let outputPath = codeDir </> outputFileName
+
+ if outputPath |> System.IO.File.Exists |> not
+ then return spiPath, None
else
- let! fsxCode = fsxPath |> SpiralFileSystem.read_all_text_async
- return mainPath, Some (fsxPath, fsxCode |> SpiralSm.replace "\r\n" "\n")
-}
+ let! oldCode = spiPath |> SpiralFileSystem.read_all_text_async
+ if oldCode <> code
+ then return spiPath, None
+ else
+ let! outputCode = outputPath |> SpiralFileSystem.read_all_text_async
+ return spiPath, Some (outputPath, outputCode |> SpiralSm.replace "\r\n" "\n")
+ }
-
+
@@ -8157,7 +8200,7 @@ buildCode¶
-
+
@@ -8165,20 +8208,20 @@ buildCode¶
In [ ]:
-let inline buildCode cache timeout cancellationToken code = async {
- let! mainPath, fsx = code |> persistCode
- match fsx with
- | Some (fsxPath, fsxCode) when cache -> return mainPath, (fsxPath, Some fsxCode), []
+let inline buildCode backend cache timeout cancellationToken code = async {
+ let! mainPath, outputCache = code |> persistCode (Some backend)
+ match outputCache with
+ | Some (outputPath, outputCode) when cache -> return mainPath, (outputPath, Some outputCode), []
| _ ->
- let! fsxPath, (fsxCode, errors) = mainPath |> buildFile timeout None cancellationToken
- return mainPath, (fsxPath, fsxCode), errors
+ let! outputPath, (outputCode, errors) = mainPath |> buildFile backend timeout None cancellationToken
+ return mainPath, (outputPath, outputCode), errors
}
-
+
@@ -8194,7 +8237,7 @@ buildCode¶
-
+
@@ -8213,9 +8256,9 @@ buildCode¶
|> dyn
|> ignore
"""
-|> buildCode false 15000 None
+|> buildCode Fsharp false 15000 None
|> Async.runWithTimeout 15000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some """let rec closure0 () () : int32 =
@@ -8241,36 +8284,30 @@ buildCode¶
-00:00:20 debug #1 async.run_with_timeout_async / timeout: 500
-00:00:17 debug #1 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:00:16 debug #1 async.run_with_timeout_async / timeout: 500
+00:00:14 debug #1 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:buildCode@3-398>, None, true,
+ [||], Some <fun:buildCode@3-399>, None, true,
Some "C:\home\git\polyglot")
-00:00:18 verbose #2 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:00:18 verbose #3 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:00:18 verbose #4 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:00:21 debug #2 async.run_with_timeout_async / timeout: 100
-00:00:21 verbose #3 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
-00:00:21 debug #4 async.run_with_timeout_async / timeout: 100
-00:00:21 debug #5 async.run_with_timeout_async / timeout: 100
-00:00:21 debug #6 async.run_with_timeout_async / timeout: 100
-00:00:21 debug #7 async.run_with_timeout_async / timeout: 100
-00:00:21 debug #8 async.run_with_timeout_async / timeout: 100
-00:00:22 debug #9 async.run_with_timeout_async / timeout: 100
-00:00:19 verbose #5 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:00:22 debug #10 async.run_with_timeout_async / timeout: 100
-00:00:15 verbose #1 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:00:15 verbose #2 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:00:20 verbose #6 > Server bound to: http://localhost:13805
-00:00:15 debug #3 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:15 debug #4 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:15 verbose #5 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl app () =\n console.write_line \u0022text\u0022\n 1i32\n\ninl main ...ot/spiral_eval/packages/0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0/main.spi"}} / result:
-00:00:15 verbose #6 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0/main.spi"}} / result:
-00:00:21 verbose #7 > 00:00:02 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0/main.spi
-00:00:16 debug #7 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:17 debug #8 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:18 debug #9 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:19 debug #10 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\main.spi / fsxContent: let rec closure0 () () : int32 =
+00:00:14 verbose #2 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:00:14 verbose #3 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:00:14 verbose #4 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
+00:00:17 debug #2 async.run_with_timeout_async / timeout: 100
+00:00:17 verbose #3 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:00:17 debug #4 async.run_with_timeout_async / timeout: 100
+00:00:14 verbose #5 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:00:17 debug #5 async.run_with_timeout_async / timeout: 100
+00:00:11 verbose #1 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:00:11 verbose #2 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:00:15 verbose #6 > Server bound to: http://localhost:13805
+00:00:12 debug #3 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:12 debug #4 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:12 verbose #5 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl app () =\n console.write_line \u0022text\u0022\n 1i32\n\ninl main ...et/spiral_Eval/packages/8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf/main.spi"}} / result:
+00:00:12 verbose #6 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf/main.spi"}} / result:
+00:00:15 verbose #7 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf/main.spi
+00:00:13 debug #7 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:14 debug #8 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:14 debug #9 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\main.spi / outputContent: let rec closure0 () () : int32 =
let v0 : (string -> unit) = System.Console.WriteLine
let v1 : string = "text"
v0 v1
@@ -8278,10 +8315,10 @@ buildCode¶
let v0 : (unit -> int32) = closure0()
()
/ errors: [] / typeErrorCount: 0
-00:00:19 verbose #11 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0"]}} / result:
-00:00:26 verbose #11 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
-00:00:26 debug #12 async.run_with_timeout_async / timeout: 100
-00:00:19 debug #12 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
+00:00:14 verbose #10 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/spiral_Eval/packages/8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf"]}} / result:
+00:00:20 verbose #6 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
+00:00:20 debug #7 async.run_with_timeout_async / timeout: 100
+00:00:15 debug #11 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
Some
(Some
"let rec closure0 () () : int32 =
@@ -8299,7 +8336,7 @@ buildCode¶
-
+
@@ -8310,7 +8347,7 @@ buildCode¶
//// test
""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
|> _assertEqual None
@@ -8325,41 +8362,41 @@ buildCode¶
-00:00:27 debug #13 async.run_with_timeout_async / timeout: 500
-00:00:24 debug #8 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:00:21 debug #8 async.run_with_timeout_async / timeout: 500
+00:00:19 debug #8 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:buildCode@3-398>, None, true,
+ [||], Some <fun:buildCode@3-399>, None, true,
Some "C:\home\git\polyglot")
-00:00:25 verbose #9 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:00:25 verbose #10 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:00:25 verbose #11 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:00:27 debug #14 async.run_with_timeout_async / timeout: 100
-00:00:27 verbose #15 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
-00:00:27 debug #16 async.run_with_timeout_async / timeout: 100
-00:00:25 verbose #12 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:00:27 debug #17 async.run_with_timeout_async / timeout: 100
-00:00:20 verbose #13 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:00:20 verbose #14 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:00:25 verbose #13 > Server bound to: http://localhost:13805
-00:00:20 debug #15 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:20 debug #16 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:20 verbose #17 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/main.spi"}} / result:
-00:00:20 verbose #18 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/main.spi"}} / result:
-00:00:26 verbose #14 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/main.spi
-00:00:21 debug #19 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:22 debug #20 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:28 verbose #15 > Cannot find `main` in file main.
-00:00:28 verbose #16 > 00:00:03 debug #5 Supervisor.supervisor_server.BuildFile.handle_build_result.BuildSkip / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/main.spi
-00:00:23 debug #21 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:24 debug #22 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:25 debug #23 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:26 debug #24 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:27 debug #25 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:28 debug #26 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:36 verbose #18 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
-00:00:36 debug #19 async.run_with_timeout_async / timeout: 100
-00:00:29 debug #27 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
-00:00:29 debug #28 runWithTimeoutAsync / timeout: 10000
+00:00:19 verbose #9 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:00:19 verbose #10 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:00:19 verbose #11 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
+00:00:22 debug #9 async.run_with_timeout_async / timeout: 100
+00:00:22 verbose #10 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:00:22 debug #11 async.run_with_timeout_async / timeout: 100
+00:00:19 verbose #12 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:00:22 debug #12 async.run_with_timeout_async / timeout: 100
+00:00:16 verbose #12 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:00:16 verbose #13 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:00:20 verbose #13 > Server bound to: http://localhost:13805
+00:00:16 debug #14 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:16 debug #15 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:16 verbose #16 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4/main.spi"}} / result:
+00:00:16 verbose #17 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4/main.spi"}} / result:
+00:00:20 verbose #14 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4/main.spi
+00:00:17 debug #18 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:18 debug #19 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:22 verbose #15 > Cannot find `main` in file main.
+00:00:22 verbose #16 > 00:00:03 debug #5 Supervisor.supervisor_server.BuildFile.handle_build_result.BuildSkip / file: c:/home/git/polyglot/target/spiral_Eval/packages/9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4/main.spi
+00:00:19 debug #20 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:20 debug #21 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:21 debug #22 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:22 debug #23 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:23 debug #24 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:24 debug #25 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:31 verbose #13 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
+00:00:31 debug #14 async.run_with_timeout_async / timeout: 100
+00:00:25 debug #26 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
+00:00:25 debug #27 runWithTimeoutAsync / timeout: 10000
<null>
@@ -8367,7 +8404,7 @@ buildCode¶
-
+
@@ -8380,9 +8417,9 @@ buildCode¶
"""inl main () =
1i32 / 0i32
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
@@ -8401,41 +8438,41 @@ buildCode¶
-00:00:37 debug #20 async.run_with_timeout_async / timeout: 500
-00:00:34 debug #17 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:00:31 debug #15 async.run_with_timeout_async / timeout: 500
+00:00:29 debug #17 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:buildCode@3-398>, None, true,
+ [||], Some <fun:buildCode@3-399>, None, true,
Some "C:\home\git\polyglot")
-00:00:35 verbose #18 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:00:35 verbose #19 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:00:35 verbose #20 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:00:37 debug #21 async.run_with_timeout_async / timeout: 100
-00:00:37 verbose #22 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
-00:00:37 debug #23 async.run_with_timeout_async / timeout: 100
-00:00:35 verbose #21 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:00:38 debug #24 async.run_with_timeout_async / timeout: 100
-00:00:31 verbose #29 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:00:31 verbose #30 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:00:35 verbose #22 > Server bound to: http://localhost:13805
-00:00:31 debug #31 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:31 debug #32 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:31 verbose #33 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n 1i32 / 0i32\n","uri":"file:///c:/home/git/polyglot/target...ot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620/main.spi"}} / result:
-00:00:31 verbose #34 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620/main.spi"}} / result:
-00:00:36 verbose #23 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620/main.spi
-00:00:32 debug #35 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:33 debug #36 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:33 debug #37 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\main.spi / fsxContent: / errors: [
+00:00:29 verbose #18 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:00:29 verbose #19 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:00:29 verbose #20 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
+00:00:32 debug #16 async.run_with_timeout_async / timeout: 100
+00:00:32 verbose #17 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:00:32 debug #18 async.run_with_timeout_async / timeout: 100
+00:00:30 verbose #21 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:00:32 debug #19 async.run_with_timeout_async / timeout: 100
+00:00:26 verbose #28 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:00:26 verbose #29 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:00:30 verbose #22 > Server bound to: http://localhost:13805
+00:00:26 debug #30 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:26 debug #31 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:26 verbose #32 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n 1i32 / 0i32\n","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046/main.spi"}} / result:
+00:00:26 verbose #33 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046/main.spi"}} / result:
+00:00:30 verbose #23 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046/main.spi
+00:00:28 debug #34 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:29 debug #35 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:29 debug #36 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\main.spi / outputContent: / errors: [
[
"An attempt to divide by zero has been detected at compile time.",
{
"TracedError": {
"message": "An attempt to divide by zero has been detected at compile time.",
"trace": [
- "Error trace on line: 1, column: 10 in module: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620/main.spi.
+ "Error trace on line: 1, column: 10 in module: c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046/main.spi.
inl main () =
^
",
- "Error trace on line: 2, column: 5 in module: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620/main.spi.
+ "Error trace on line: 2, column: 5 in module: c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046/main.spi.
1i32 / 0i32
^
"
@@ -8444,10 +8481,10 @@ buildCode¶
}
]
] / typeErrorCount: 0
-00:00:33 verbose #38 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620"]}} / result:
-00:00:40 verbose #25 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
-00:00:40 debug #26 async.run_with_timeout_async / timeout: 100
-00:00:33 debug #39 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
+00:00:29 verbose #37 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046"]}} / result:
+00:00:35 verbose #20 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
+00:00:35 debug #21 async.run_with_timeout_async / timeout: 100
+00:00:29 debug #38 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
Some (None, ["An attempt to divide by zero has been detected at compile time."])
@@ -8455,7 +8492,7 @@ buildCode¶
-
+
@@ -8468,9 +8505,9 @@ buildCode¶
"""inl main () =
1 + ""
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
@@ -8494,31 +8531,30 @@ buildCode¶
-00:00:41 debug #27 async.run_with_timeout_async / timeout: 500
-00:00:38 debug #24 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:00:36 debug #22 async.run_with_timeout_async / timeout: 500
+00:00:33 debug #24 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:buildCode@3-398>, None, true,
+ [||], Some <fun:buildCode@3-399>, None, true,
Some "C:\home\git\polyglot")
-00:00:39 verbose #25 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:00:39 verbose #26 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:00:39 verbose #27 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:00:41 debug #28 async.run_with_timeout_async / timeout: 100
-00:00:41 verbose #29 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
-00:00:41 debug #30 async.run_with_timeout_async / timeout: 100
-00:00:39 verbose #28 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:00:41 debug #31 async.run_with_timeout_async / timeout: 100
-00:00:35 verbose #40 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:00:35 verbose #41 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:00:39 verbose #29 > Server bound to: http://localhost:13805
-00:00:35 debug #42 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:35 debug #43 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:35 verbose #44 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n 1 \u002B \u0022\u0022\n","uri":"file:///c:/home/git/polyg...ot/spiral_eval/packages/2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d/main.spi"}} / result:
-00:00:35 verbose #45 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d/main.spi"}} / result:
-00:00:40 verbose #30 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d/main.spi
-00:00:36 debug #46 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:37 debug #47 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\main.spi / fsxContent: / errors: [] / typeErrorCount: 1
-00:00:37 debug #48 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\main.spi / fsxContent: / errors: [] / typeErrorCount: 2
-00:00:37 debug #49 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\main.spi / fsxContent: / errors: [
+00:00:34 verbose #25 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:00:34 verbose #26 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:00:34 verbose #27 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
+00:00:36 debug #23 async.run_with_timeout_async / timeout: 100
+00:00:36 verbose #24 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:00:36 debug #25 async.run_with_timeout_async / timeout: 100
+00:00:34 verbose #28 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:00:36 debug #26 async.run_with_timeout_async / timeout: 100
+00:00:31 verbose #39 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:00:31 verbose #40 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:00:34 verbose #29 > Server bound to: http://localhost:13805
+00:00:31 debug #41 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:31 debug #42 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:31 verbose #43 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n 1 \u002B \u0022\u0022\n","uri":"file:///c:/home/git/polyg...et/spiral_Eval/packages/76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b/main.spi"}} / result:
+00:00:31 verbose #44 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b/main.spi"}} / result:
+00:00:34 verbose #30 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b/main.spi
+00:00:32 debug #45 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:33 debug #46 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\main.spi / outputContent: / errors: [] / typeErrorCount: 1
+00:00:33 debug #47 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\main.spi / outputContent: / errors: [
[
"main.spi:
Constraint satisfaction error.
@@ -8543,15 +8579,15 @@ buildCode¶
Fails to satisfy: number"
]
],
- "uri": "file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d/main.spi"
+ "uri": "file:///c:/home/git/polyglot/target/spiral_Eval/packages/76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b/main.spi"
}
}
]
-] / typeErrorCount: 2
-00:00:37 verbose #50 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d"]}} / result:
-00:00:44 verbose #32 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
-00:00:44 debug #33 async.run_with_timeout_async / timeout: 100
-00:00:37 debug #51 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
+] / typeErrorCount: 1
+00:00:33 verbose #48 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/spiral_Eval/packages/76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b"]}} / result:
+00:00:38 verbose #27 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
+00:00:39 debug #28 async.run_with_timeout_async / timeout: 100
+00:00:33 debug #49 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
Some (None, ["main.spi:
Constraint satisfaction error.
Got: string
@@ -8562,7 +8598,7 @@ buildCode¶
-
+
@@ -8575,9 +8611,9 @@ buildCode¶
"""inl main () =
x + y
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
@@ -8600,30 +8636,31 @@ buildCode¶
-00:00:44 debug #34 async.run_with_timeout_async / timeout: 500
-00:00:42 debug #31 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:00:39 debug #29 async.run_with_timeout_async / timeout: 500
+00:00:37 debug #31 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:buildCode@3-398>, None, true,
+ [||], Some <fun:buildCode@3-399>, None, true,
Some "C:\home\git\polyglot")
-00:00:42 verbose #32 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:00:42 verbose #33 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:00:42 verbose #34 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:00:45 debug #35 async.run_with_timeout_async / timeout: 100
-00:00:45 verbose #36 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
-00:00:45 debug #37 async.run_with_timeout_async / timeout: 100
-00:00:43 verbose #35 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:00:45 debug #38 async.run_with_timeout_async / timeout: 100
-00:00:38 verbose #52 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:00:38 verbose #53 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:00:43 verbose #36 > Server bound to: http://localhost:13805
-00:00:38 debug #54 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:38 debug #55 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:38 verbose #56 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n x \u002B y\n","uri":"file:///c:/home/git/polyglot/target/...ot/spiral_eval/packages/5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b/main.spi"}} / result:
-00:00:38 verbose #57 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b/main.spi"}} / result:
-00:00:43 verbose #37 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b/main.spi
-00:00:39 debug #58 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:40 debug #59 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\main.spi / fsxContent: / errors: [] / typeErrorCount: 1
-00:00:40 debug #60 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\main.spi / fsxContent: / errors: [
+00:00:37 verbose #32 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:00:37 verbose #33 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:00:37 verbose #34 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
+00:00:40 debug #30 async.run_with_timeout_async / timeout: 100
+00:00:40 verbose #31 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:00:40 debug #32 async.run_with_timeout_async / timeout: 100
+00:00:37 verbose #35 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:00:40 debug #33 async.run_with_timeout_async / timeout: 100
+00:00:34 verbose #50 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:00:34 verbose #51 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:00:38 verbose #36 > Server bound to: http://localhost:13805
+00:00:34 debug #52 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:34 debug #53 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:34 verbose #54 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n x \u002B y\n","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4/main.spi"}} / result:
+00:00:34 verbose #55 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4/main.spi"}} / result:
+00:00:38 verbose #37 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4/main.spi
+00:00:35 debug #56 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:36 debug #57 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:36 debug #58 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\main.spi / outputContent: / errors: [] / typeErrorCount: 1
+00:00:36 debug #59 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\main.spi / outputContent: / errors: [
[
"main.spi:
Unbound variable: x.
@@ -8658,15 +8695,15 @@ buildCode¶
"Unbound variable: y."
]
],
- "uri": "file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b/main.spi"
+ "uri": "file:///c:/home/git/polyglot/target/spiral_Eval/packages/cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4/main.spi"
}
}
]
] / typeErrorCount: 1
-00:00:40 verbose #61 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b"]}} / result:
-00:00:47 verbose #39 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
-00:00:47 debug #40 async.run_with_timeout_async / timeout: 100
-00:00:40 debug #62 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
+00:00:36 verbose #60 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/spiral_Eval/packages/cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4"]}} / result:
+00:00:42 verbose #34 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
+00:00:42 debug #35 async.run_with_timeout_async / timeout: 100
+00:00:37 debug #61 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
Some (None, ["main.spi:
Unbound variable: x.
Unbound variable: y."])
@@ -8676,7 +8713,7 @@ buildCode¶
-
+
@@ -8695,9 +8732,9 @@ buildCode¶
real_unbox ()
()
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
@@ -8716,45 +8753,45 @@ buildCode¶
-00:00:48 debug #41 async.run_with_timeout_async / timeout: 500
-00:00:46 debug #38 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:00:43 debug #36 async.run_with_timeout_async / timeout: 500
+00:00:41 debug #38 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:buildCode@3-398>, None, true,
+ [||], Some <fun:buildCode@3-399>, None, true,
Some "C:\home\git\polyglot")
-00:00:46 verbose #39 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:00:46 verbose #40 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:00:46 verbose #41 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:00:48 debug #42 async.run_with_timeout_async / timeout: 100
-00:00:48 verbose #43 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
-00:00:48 debug #44 async.run_with_timeout_async / timeout: 100
-00:00:46 verbose #42 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:00:49 debug #45 async.run_with_timeout_async / timeout: 100
-00:00:42 verbose #63 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:00:42 verbose #64 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:00:46 verbose #43 > Server bound to: http://localhost:13805
-00:00:42 debug #65 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:42 debug #66 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:42 verbose #67 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl main () =\n real\n inl real_unbox forall a. (obj : a) : a =\...ot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi"}} / result:
-00:00:42 verbose #68 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi"}} / result:
-00:00:47 verbose #44 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi
-00:00:43 debug #69 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:44 debug #70 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:44 debug #71 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\main.spi / fsxContent: / errors: [
+00:00:41 verbose #39 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:00:41 verbose #40 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:00:41 verbose #41 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
+00:00:44 debug #37 async.run_with_timeout_async / timeout: 100
+00:00:44 verbose #38 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:00:44 debug #39 async.run_with_timeout_async / timeout: 100
+00:00:41 verbose #42 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:00:44 debug #40 async.run_with_timeout_async / timeout: 100
+00:00:38 verbose #62 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:00:38 verbose #63 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:00:42 verbose #43 > Server bound to: http://localhost:13805
+00:00:38 debug #64 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:38 debug #65 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:38 verbose #66 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl main () =\n real\n inl real_unbox forall a. (obj : a) : a =\...et/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi"}} / result:
+00:00:38 verbose #67 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi"}} / result:
+00:00:42 verbose #44 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi
+00:00:39 debug #68 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:40 debug #69 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:41 debug #70 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\main.spi / outputContent: / errors: [
[
"Cannot apply a forall with a term.",
{
"TracedError": {
"message": "Cannot apply a forall with a term.",
"trace": [
- "Error trace on line: 2, column: 10 in module: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi.
+ "Error trace on line: 2, column: 10 in module: c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi.
inl main () =
^
",
- "Error trace on line: 4, column: 9 in module: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi.
+ "Error trace on line: 4, column: 9 in module: c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi.
inl real_unbox forall a. (obj : a) : a =
^
",
- "Error trace on line: 7, column: 9 in module: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi.
+ "Error trace on line: 7, column: 9 in module: c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi.
real_unbox ()
^
"
@@ -8763,10 +8800,10 @@ buildCode¶
}
]
] / typeErrorCount: 0
-00:00:44 verbose #72 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50"]}} / result:
-00:00:51 verbose #46 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
-00:00:51 debug #47 async.run_with_timeout_async / timeout: 100
-00:00:44 debug #73 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
+00:00:41 verbose #71 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a"]}} / result:
+00:00:47 verbose #41 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
+00:00:47 debug #42 async.run_with_timeout_async / timeout: 100
+00:00:41 debug #72 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
Some (None, ["Cannot apply a forall with a term."])
@@ -8774,7 +8811,7 @@ buildCode¶
-
+
@@ -8792,9 +8829,9 @@ buildCode¶
| _ => obj
real_unbox `i32 1
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
@@ -8813,30 +8850,30 @@ buildCode¶
-00:00:52 debug #48 async.run_with_timeout_async / timeout: 500
-00:00:50 debug #45 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:00:47 debug #43 async.run_with_timeout_async / timeout: 500
+00:00:45 debug #45 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:buildCode@3-398>, None, true,
+ [||], Some <fun:buildCode@3-399>, None, true,
Some "C:\home\git\polyglot")
-00:00:50 verbose #46 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:00:50 verbose #47 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:00:50 verbose #48 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:00:52 debug #49 async.run_with_timeout_async / timeout: 100
-00:00:52 verbose #50 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
-00:00:53 debug #51 async.run_with_timeout_async / timeout: 100
-00:00:50 verbose #49 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:00:53 debug #52 async.run_with_timeout_async / timeout: 100
-00:00:46 verbose #74 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:00:46 verbose #75 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:00:51 verbose #50 > Server bound to: http://localhost:13805
-00:00:46 debug #76 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:46 debug #77 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:46 verbose #78 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl main () =\n real\n inl real_unbox forall a. (obj : a) : a =\...ot/spiral_eval/packages/84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e/main.spi"}} / result:
-00:00:46 verbose #79 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e/main.spi"}} / result:
-00:00:51 verbose #51 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e/main.spi
-00:00:47 debug #80 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:48 debug #81 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:48 debug #82 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\main.spi / fsxContent: / errors: [
+00:00:45 verbose #46 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:00:45 verbose #47 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:00:45 verbose #48 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
+00:00:48 debug #44 async.run_with_timeout_async / timeout: 100
+00:00:48 verbose #45 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:00:48 debug #46 async.run_with_timeout_async / timeout: 100
+00:00:46 verbose #49 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:00:48 debug #47 async.run_with_timeout_async / timeout: 100
+00:00:42 verbose #73 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:00:42 verbose #74 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:00:46 verbose #50 > Server bound to: http://localhost:13805
+00:00:42 debug #75 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:42 debug #76 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:42 verbose #77 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl main () =\n real\n inl real_unbox forall a. (obj : a) : a =\...et/spiral_Eval/packages/7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e/main.spi"}} / result:
+00:00:42 verbose #78 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e/main.spi"}} / result:
+00:00:46 verbose #51 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e/main.spi
+00:00:43 debug #79 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:44 debug #80 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:45 debug #81 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\main.spi / outputContent: / errors: [
[
"The main function should not have a forall.",
{
@@ -8847,10 +8884,10 @@ buildCode¶
}
]
] / typeErrorCount: 0
-00:00:48 verbose #83 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e"]}} / result:
-00:00:55 verbose #53 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
-00:00:55 debug #54 async.run_with_timeout_async / timeout: 100
-00:00:48 debug #84 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
+00:00:45 verbose #82 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/spiral_Eval/packages/7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e"]}} / result:
+00:00:51 verbose #48 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
+00:00:51 debug #49 async.run_with_timeout_async / timeout: 100
+00:00:45 debug #83 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
Some (None, ["The main function should not have a forall."])
@@ -8858,7 +8895,7 @@ buildCode¶
-
+
@@ -8884,9 +8921,9 @@ buildCode¶
inl main () =
integral 0.1 (fun x => x ** 2) 0 1
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some "0.3325000000000001\n",
@@ -8905,35 +8942,35 @@ buildCode¶
-00:00:56 debug #55 async.run_with_timeout_async / timeout: 500
-00:00:53 debug #52 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:00:51 debug #50 async.run_with_timeout_async / timeout: 500
+00:00:49 debug #52 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:buildCode@3-398>, None, true,
+ [||], Some <fun:buildCode@3-399>, None, true,
Some "C:\home\git\polyglot")
-00:00:54 verbose #53 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:00:54 verbose #54 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:00:54 verbose #55 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:00:56 debug #56 async.run_with_timeout_async / timeout: 100
-00:00:56 verbose #57 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
-00:00:56 debug #58 async.run_with_timeout_async / timeout: 100
-00:00:54 verbose #56 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:00:57 debug #59 async.run_with_timeout_async / timeout: 100
-00:00:50 verbose #85 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:00:50 verbose #86 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:00:54 verbose #57 > Server bound to: http://localhost:13805
-00:00:50 debug #87 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:50 debug #88 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:50 verbose #89 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...ot/spiral_eval/packages/c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294/main.spi"}} / result:
-00:00:50 verbose #90 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294/main.spi"}} / result:
-00:00:55 verbose #58 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294/main.spi
-00:00:51 debug #91 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:52 debug #92 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:52 debug #93 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\main.spi / fsxContent: 0.3325000000000001
+00:00:49 verbose #53 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:00:49 verbose #54 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:00:49 verbose #55 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
+00:00:52 debug #51 async.run_with_timeout_async / timeout: 100
+00:00:52 verbose #52 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:00:52 debug #53 async.run_with_timeout_async / timeout: 100
+00:00:49 verbose #56 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:00:52 debug #54 async.run_with_timeout_async / timeout: 100
+00:00:46 verbose #84 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:00:46 verbose #85 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:00:50 verbose #57 > Server bound to: http://localhost:13805
+00:00:46 debug #86 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:46 debug #87 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:46 verbose #88 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2/main.spi"}} / result:
+00:00:46 verbose #89 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2/main.spi"}} / result:
+00:00:50 verbose #58 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2/main.spi
+00:00:47 debug #90 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:48 debug #91 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:49 debug #92 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\main.spi / outputContent: 0.3325000000000001
/ errors: [] / typeErrorCount: 0
-00:00:52 verbose #94 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294"]}} / result:
-00:00:59 verbose #60 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
-00:00:59 debug #61 async.run_with_timeout_async / timeout: 100
-00:00:52 debug #95 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
+00:00:49 verbose #93 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/spiral_Eval/packages/9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2"]}} / result:
+00:00:55 verbose #55 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
+00:00:55 debug #56 async.run_with_timeout_async / timeout: 100
+00:00:49 debug #94 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
Some (Some "0.3325000000000001
", [])
@@ -8942,7 +8979,145 @@ buildCode¶
-
+
+
+
+
+
+In [ ]:
+
+
+//// test
+
+"""
+inl init_series start end inc =
+ inl total : f64 = conv ((end - start) / inc) + 1
+ listm.init total (conv >> (*) inc >> (+) start) : list f64
+
+type integration = (f64 -> f64) -> f64 -> f64 -> f64
+
+inl integral dt : integration =
+ fun f a b =>
+ init_series (a + dt / 2) (b - dt / 2) dt
+ |> listm.map (f >> (*) dt)
+ |> listm.fold (+) 0
+
+inl main () =
+ integral 0.1 (fun x => x ** 2) 0 1
+"""
+|> buildCode Cuda false 10000 None
+|> Async.runWithTimeout 10000
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
+|> _assertEqual (
+ Some (
+ Some "kernel = r\"\"\"
+template <typename el, int dim> struct static_array { el v[dim]; };
+template <typename el, int dim, typename default_int> struct static_array_list { el v[dim]; default_int length; };
+\"\"\"
+class static_array(list):
+ def __init__(self, length):
+ for _ in range(length):
+ self.append(None)
+
+class static_array_list(static_array):
+ def __init__(self, length):
+ super().__init__(length)
+ self.length = 0
+import cupy as cp
+from dataclasses import dataclass
+from typing import NamedTuple, Union, Callable, Tuple
+i8 = i16 = i32 = i64 = u8 = u16 = u32 = u64 = int; f32 = f64 = float; char = string = str
+
+def main():
+ return 0.3325000000000001
+
+if __name__ == '__main__': result = main(); None if result is None else print(result)
+",
+ []
+ )
+)
+
+
+
+
+
+
+
+
+
+
+
+
+00:00:56 debug #57 async.run_with_timeout_async / timeout: 500
+00:00:53 debug #59 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+ "dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
+ [||], Some <fun:buildCode@3-399>, None, true,
+ Some "C:\home\git\polyglot")
+00:00:54 verbose #60 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:00:54 verbose #61 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:00:54 verbose #62 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
+00:00:56 debug #58 async.run_with_timeout_async / timeout: 100
+00:00:56 verbose #59 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:00:56 debug #60 async.run_with_timeout_async / timeout: 100
+00:00:54 verbose #63 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:00:56 debug #61 async.run_with_timeout_async / timeout: 100
+00:00:51 verbose #95 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:00:51 verbose #96 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:00:54 verbose #64 > Server bound to: http://localhost:13805
+00:00:51 debug #97 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:51 debug #98 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:51 verbose #99 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a/main.spi"}} / result:
+00:00:51 verbose #100 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Python \u002B Cuda","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a/main.spi"}} / result:
+00:00:54 verbose #65 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a/main.spi
+00:00:52 debug #101 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:53 debug #102 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:53 debug #103 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\main.spi / outputContent: kernel = r"""
+template <typename el, int dim> struct static_array { el v[dim]; };
+template <typename el, int dim, typename default_int> struct static_array_list { el v[dim]; default_int length; };
+"""... = u8 = u16 = u32 = u64 = int; f32 = f64 = float; char = string = str
+
+def main():
+ return 0.3325000000000001
+
+if __name__ == '__main__': result = main(); None if result is None else print(result)
+ / errors: [] / typeErrorCount: 0
+00:00:53 verbose #104 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/spiral_Eval/packages/2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a"]}} / result:
+00:00:59 verbose #62 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
+00:00:59 debug #63 async.run_with_timeout_async / timeout: 100
+00:00:53 debug #105 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
+Some
+ (Some
+ "kernel = r"""
+template <typename el, int dim> struct static_array { el v[dim]; };
+template <typename el, int dim, typename default_int> struct static_array_list { el v[dim]; default_int length; };
+"""
+class static_array(list):
+ def __init__(self, length):
+ for _ in range(length):
+ self.append(None)
+
+class static_array_list(static_array):
+ def __init__(self, length):
+ super().__init__(length)
+ self.length = 0
+import cupy as cp
+from dataclasses import dataclass
+from typing import NamedTuple, Union, Callable, Tuple
+i8 = i16 = i32 = i64 = u8 = u16 = u32 = u64 = int; f32 = f64 = float; char = string = str
+
+def main():
+ return 0.3325000000000001
+
+if __name__ == '__main__': result = main(); None if result is None else print(result)
+",
+ [])
+
+
+
+
+
+
+
@@ -8968,9 +9143,9 @@ buildCode¶
inl main () =
integral 0.01 (fun x => x ** 2) 0 1
"""
-|> buildCode false 10000 None
+|> buildCode Fsharp false 10000 None
|> Async.runWithTimeout 10000
-|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)
+|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some "0.33332500000000004\n",
@@ -8991,35 +9166,35 @@ buildCode¶
-00:01:00 debug #62 async.run_with_timeout_async / timeout: 500
-00:00:57 debug #59 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:01:00 debug #64 async.run_with_timeout_async / timeout: 500
+00:00:57 debug #66 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:buildCode@3-398>, None, true,
+ [||], Some <fun:buildCode@3-399>, None, true,
Some "C:\home\git\polyglot")
-00:00:58 verbose #60 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:00:58 verbose #61 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:00:58 verbose #62 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:01:00 debug #63 async.run_with_timeout_async / timeout: 100
-00:01:00 verbose #64 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:00:58 verbose #67 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:00:58 verbose #68 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:00:58 verbose #69 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
00:01:00 debug #65 async.run_with_timeout_async / timeout: 100
-00:00:58 verbose #63 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:01:00 debug #66 async.run_with_timeout_async / timeout: 100
-00:00:54 verbose #96 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:00:54 verbose #97 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:00:58 verbose #64 > Server bound to: http://localhost:13805
-00:00:54 debug #98 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:54 debug #99 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:54 verbose #100 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...ot/spiral_eval/packages/355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c/main.spi"}} / result:
-00:00:54 verbose #101 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c/main.spi"}} / result:
-00:00:59 verbose #65 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c/main.spi
-00:00:55 debug #102 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:56 debug #103 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\main.spi / fsxContent: / errors: [] / typeErrorCount: 0
-00:00:56 debug #104 buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/polyglot/spiral_eval\packages\355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\main.spi / fsxContent: 0.33332500000000004
+00:01:00 verbose #66 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:01:00 debug #67 async.run_with_timeout_async / timeout: 100
+00:00:58 verbose #70 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:01:01 debug #68 async.run_with_timeout_async / timeout: 100
+00:00:55 verbose #106 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:00:55 verbose #107 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:00:58 verbose #71 > Server bound to: http://localhost:13805
+00:00:55 debug #108 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:55 debug #109 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:55 verbose #110 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476/main.spi"}} / result:
+00:00:55 verbose #111 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476/main.spi"}} / result:
+00:00:58 verbose #72 > 00:00:00 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476/main.spi
+00:00:56 debug #112 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:57 debug #113 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\main.spi / outputContent: / errors: [] / typeErrorCount: 0
+00:00:57 debug #114 Supervisor.buildFile / takeWhileInclusive / path: C:\home\git\polyglot\target/spiral_Eval\packages\bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\main.spi / outputContent: 0.33332500000000004
/ errors: [] / typeErrorCount: 0
-00:00:56 verbose #105 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c"]}} / result:
-00:01:03 verbose #67 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
-00:01:03 debug #68 async.run_with_timeout_async / timeout: 100
-00:00:56 debug #106 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
+00:00:57 verbose #115 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///c:/home/git/polyglot/target/spiral_Eval/packages/bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476"]}} / result:
+00:01:03 verbose #69 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False
+00:01:03 debug #70 async.run_with_timeout_async / timeout: 100
+00:00:57 debug #116 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite
Some (Some "0.33332500000000004
", [])
@@ -9029,7 +9204,7 @@ buildCode¶
-
+
@@ -9039,7 +9214,7 @@ getFileTokenRange
+
@@ -9098,7 +9273,7 @@ getFileTokenRange
+
@@ -9108,7 +9283,7 @@ getCodeTokenRange
+
@@ -9117,7 +9292,7 @@ getCodeTokenRange
let inline getCodeTokenRange cancellationToken code = async {
- let! mainPath, _ = persistCode code
+ let! mainPath, _ = persistCode None code
let codeDir = mainPath |> System.IO.Path.GetDirectoryName
let tokensPath = codeDir </> "tokens.json"
@@ -9142,7 +9317,7 @@ getCodeTokenRange
+
@@ -9170,23 +9345,23 @@ getCodeTokenRange
-00:01:08 debug #69 async.run_with_timeout_async / timeout: 500
-00:01:06 debug #66 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:01:08 debug #71 async.run_with_timeout_async / timeout: 500
+00:01:06 debug #73 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:it@4-167>, None, true, Some "C:\home\git\polyglot")
-00:01:06 verbose #67 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:01:06 verbose #68 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:01:06 verbose #69 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:01:09 debug #70 async.run_with_timeout_async / timeout: 100
-00:01:09 verbose #71 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+ [||], Some <fun:it@4-176>, None, true, Some "C:\home\git\polyglot")
+00:01:06 verbose #74 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:01:06 verbose #75 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:01:06 verbose #76 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
00:01:09 debug #72 async.run_with_timeout_async / timeout: 100
-00:01:07 verbose #70 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:01:09 debug #73 async.run_with_timeout_async / timeout: 100
-00:01:02 verbose #107 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:01:02 verbose #108 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:01:07 verbose #71 > Server bound to: http://localhost:13805
-00:01:02 verbose #109 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = ()","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/fb6c8d45c45c5bed6706c564f1573e80b77a3923967ce83cb69737ce2ce5040c/main.spi"}} / result:
-00:01:03 verbose #110 Supervisor.sendJson / port: 13805 / json: {"FileTokenRange":{"range":[{"character":0,"line":0},{"character":16,"line":0}],"uri":"file:///c:/ho...ot/spiral_eval/packages/fb6c8d45c45c5bed6706c564f1573e80b77a3923967ce83cb69737ce2ce5040c/main.spi"}} / result: Some([
+00:01:09 verbose #73 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:01:09 debug #74 async.run_with_timeout_async / timeout: 100
+00:01:06 verbose #77 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:01:09 debug #75 async.run_with_timeout_async / timeout: 100
+00:01:03 verbose #117 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:01:03 verbose #118 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:01:07 verbose #78 > Server bound to: http://localhost:13805
+00:01:03 verbose #119 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = ()","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/fb6c8d45c45c5bed6706c564f1573e80b77a3923967ce83cb69737ce2ce5040c/main.spi"}} / result:
+00:01:04 verbose #120 Supervisor.sendJson / port: 13805 / json: {"FileTokenRange":{"range":[{"character":0,"line":0},{"character":16,"line":0}],"uri":"file:///c:/ho...et/spiral_Eval/packages/fb6c8d45c45c5bed6706c564f1573e80b77a3923967ce83cb69737ce2ce5040c/main.spi"}} / result: Some([
0,
0,
3,
@@ -9221,9 +9396,9 @@ getCodeTokenRange
@@ -9231,7 +9406,7 @@ getCodeTokenRange
+
@@ -9259,23 +9434,23 @@ getCodeTokenRange
-00:01:12 debug #76 async.run_with_timeout_async / timeout: 500
-00:01:10 debug #72 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
+00:01:12 debug #78 async.run_with_timeout_async / timeout: 500
+00:01:10 debug #79 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,
"dotnet "C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release\Spiral.dll" --port 13805 --default-int i32 --default-float f64",
- [||], Some <fun:it@4-387>, None, true, Some "C:\home\git\polyglot")
-00:01:10 verbose #73 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
-00:01:10 verbose #74 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
-00:01:10 verbose #75 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
-00:01:13 debug #77 async.run_with_timeout_async / timeout: 100
-00:01:13 verbose #78 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+ [||], Some <fun:it@4-390>, None, true, Some "C:\home\git\polyglot")
+00:01:10 verbose #80 > 00:00:00 debug #1 pwd: C:\home\git\polyglot
+00:01:10 verbose #81 > 00:00:00 debug #2 dllPath: C:\home\git\polyglot\deps\The-Spiral-Language\The Spiral Language 2\artifacts\bin\The Spiral Language 2\release
+00:01:10 verbose #82 > 00:00:00 debug #3 targetDir: C:\home\git\polyglot\target/polyglot/spiral_eval
00:01:13 debug #79 async.run_with_timeout_async / timeout: 100
-00:01:10 verbose #76 > Starting the Spiral Server. It is bound to: http://localhost:13805
-00:01:13 debug #80 async.run_with_timeout_async / timeout: 100
-00:01:06 verbose #112 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
-00:01:06 verbose #113 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
-00:01:11 verbose #77 > Server bound to: http://localhost:13805
-00:01:06 verbose #114 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = 1i32","uri":"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/9df95a2f18642bd8d2f682f6edb6cef45c30ca9c616b33ebb0e5577eed14871c/main.spi"}} / result:
-00:01:06 verbose #115 Supervisor.sendJson / port: 13805 / json: {"FileTokenRange":{"range":[{"character":0,"line":0},{"character":18,"line":0}],"uri":"file:///c:/ho...ot/spiral_eval/packages/9df95a2f18642bd8d2f682f6edb6cef45c30ca9c616b33ebb0e5577eed14871c/main.spi"}} / result: Some([
+00:01:13 verbose #80 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True
+00:01:13 debug #81 async.run_with_timeout_async / timeout: 100
+00:01:10 verbose #83 > Starting the Spiral Server. It is bound to: http://localhost:13805
+00:01:13 debug #82 async.run_with_timeout_async / timeout: 100
+00:01:07 verbose #122 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result:
+00:01:07 verbose #123 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0
+00:01:10 verbose #84 > Server bound to: http://localhost:13805
+00:01:07 verbose #124 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = 1i32","uri":"file:///c:/home/git/polyglot/target/spiral_Eval/packages/9df95a2f18642bd8d2f682f6edb6cef45c30ca9c616b33ebb0e5577eed14871c/main.spi"}} / result:
+00:01:08 verbose #125 Supervisor.sendJson / port: 13805 / json: {"FileTokenRange":{"range":[{"character":0,"line":0},{"character":18,"line":0}],"uri":"file:///c:/ho...et/spiral_Eval/packages/9df95a2f18642bd8d2f682f6edb6cef45c30ca9c616b33ebb0e5577eed14871c/main.spi"}} / result: Some([
0,
0,
3,
@@ -9310,9 +9485,9 @@ getCodeTokenRange
@@ -9321,7 +9496,7 @@ getCodeTokenRange
+
@@ -9331,7 +9506,7 @@ Arguments¶
-
+
@@ -9364,7 +9539,7 @@ Arguments¶
-
+
@@ -9412,7 +9587,7 @@ Arguments¶
-
+
@@ -9422,7 +9597,7 @@ main¶
-
+
@@ -9485,7 +9660,14 @@ main¶
let buildFileAsync =
buildFileActions
|> List.map (fun (inputPath, outputPath) -> async {
- let! _fsxPath, (outputCode, errors) = inputPath |> buildFile timeout (Some serverPort) None
+ let! _outputPath, (outputCode, errors) =
+ let backend =
+ if outputPath |> SpiralSm.ends_with ".fsx"
+ then Fsharp
+ elif outputPath |> SpiralSm.ends_with ".py"
+ then Cuda
+ else failwith $"Supervisor.main / invalid backend / outputPath: {outputPath}"
+ inputPath |> buildFile backend timeout (Some serverPort) None
errors
|> List.map snd
@@ -9555,7 +9737,7 @@ main¶
-
+
diff --git a/apps/spiral/Supervisor.dib.ipynb b/apps/spiral/Supervisor.dib.ipynb
index 30357928..aaddf9e7 100644
--- a/apps/spiral/Supervisor.dib.ipynb
+++ b/apps/spiral/Supervisor.dib.ipynb
@@ -405,6 +405,31 @@
" |> SpiralSm.replace \"\\\\n\" \"\\n\""
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Backend"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "dotnet_interactive": {
+ "language": "fsharp"
+ },
+ "polyglot_notebook": {
+ "kernelName": "fsharp"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "type Backend =\n",
+ " | Fsharp\n",
+ " | Cuda"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -425,7 +450,7 @@
},
"outputs": [],
"source": [
- "let inline buildFile timeout port cancellationToken path = async {\n",
+ "let inline buildFile backend timeout port cancellationToken path = async {\n",
" let fullPath = path |> System.IO.Path.GetFullPath\n",
" let fileDir = fullPath |> System.IO.Path.GetDirectoryName\n",
" let fileName = fullPath |> System.IO.Path.GetFileNameWithoutExtension\n",
@@ -441,11 +466,16 @@
" let! serverPort, errors, ct, disposable = awaitCompiler port (Some token)\n",
" use _ = disposable\n",
"\n",
- " let fsxContentSeq =\n",
+ " let outputFileName =\n",
+ " match backend with\n",
+ " | Fsharp -> $\"{fileName}.fsx\"\n",
+ " | Cuda -> $\"{fileName}.py\"\n",
+ "\n",
+ " let outputContentSeq =\n",
" stream\n",
" |> FSharp.Control.AsyncSeq.chooseAsync (function\n",
" | _, (FileSystem.FileSystemChange.Changed (path, _))\n",
- " when (path |> System.IO.Path.GetFileName) = $\"{fileName}.fsx\"\n",
+ " when (path |> System.IO.Path.GetFileName) = outputFileName\n",
" ->\n",
" fileDir > path |> SpiralFileSystem.read_all_text_retry_async\n",
" | _ -> None |> Async.init\n",
@@ -490,30 +520,30 @@
" |> FSharp.Control.AsyncSeq.map (fun _ -> None, None)\n",
"\n",
" let outputSeq =\n",
- " [ fsxContentSeq; errorsSeq; timerSeq ]\n",
+ " [ outputContentSeq; errorsSeq; timerSeq ]\n",
" |> FSharp.Control.AsyncSeq.mergeAll\n",
"\n",
" let! outputChild =\n",
" ((None, [], 0), outputSeq)\n",
" ||> FSharp.Control.AsyncSeq.scan (\n",
- " fun (fsxContentResult, errors, typeErrorCount) (fsxContent, error) ->\n",
- " match fsxContent, error with\n",
- " | Some fsxContent, None -> Some fsxContent, errors, typeErrorCount\n",
+ " fun (outputContentResult, errors, typeErrorCount) (outputContent, error) ->\n",
+ " match outputContent, error with\n",
+ " | Some outputContent, None -> Some outputContent, errors, typeErrorCount\n",
" | None, Some (_, FatalError \"File main has a type error somewhere in its path.\") ->\n",
- " fsxContentResult, errors, typeErrorCount + 1\n",
- " | None, Some error -> fsxContentResult, error :: errors, typeErrorCount\n",
+ " outputContentResult, errors, typeErrorCount + 1\n",
+ " | None, Some error -> outputContentResult, error :: errors, typeErrorCount\n",
" | None, None when typeErrorCount >= 1 ->\n",
- " fsxContentResult, errors, typeErrorCount + 1\n",
- " | _ -> fsxContentResult, errors, typeErrorCount\n",
+ " outputContentResult, errors, typeErrorCount + 1\n",
+ " | _ -> outputContentResult, errors, typeErrorCount\n",
" )\n",
- " |> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (fsxContent, errors, typeErrorCount) ->\n",
- " trace Debug (fun () -> $\"buildFile / takeWhileInclusive / path: {path} / fsxContent: {fsxContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount}\") _locals\n",
+ " |> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (outputContent, errors, typeErrorCount) ->\n",
+ " trace Debug (fun () -> $\"Supervisor.buildFile / takeWhileInclusive / path: {path} / outputContent: {outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount}\") _locals\n",
"#if INTERACTIVE\n",
" let errorWait = 2\n",
"#else\n",
" let errorWait = 4\n",
"#endif\n",
- " match fsxContent, errors with\n",
+ " match outputContent, errors with\n",
" | None, [] when typeErrorCount > errorWait -> false\n",
" | None, [] -> true\n",
" | _ -> false\n",
@@ -531,16 +561,20 @@
"\n",
" // do! Async.Sleep 60\n",
"\n",
- " let buildFileObj = {| BuildFile = {| uri = fullPathUri; backend = \"Fsharp\" |} |}\n",
+ " let backendId =\n",
+ " match backend with\n",
+ " | Fsharp -> \"Fsharp\"\n",
+ " | Cuda -> \"Python + Cuda\"\n",
+ " let buildFileObj = {| BuildFile = {| uri = fullPathUri; backend = backendId |} |}\n",
" let! _buildFileResult = buildFileObj |> sendObj serverPort\n",
"\n",
" let! result =\n",
" outputChild\n",
" |> Async.map (function\n",
- " | Some (Ok (Some (fsxCode, errors, _))) ->\n",
- " fsxCode, errors |> List.distinct |> List.rev\n",
+ " | Some (Ok (Some (outputCode, errors, _))) ->\n",
+ " outputCode, errors |> List.distinct |> List.rev\n",
" | Some (Error ex) ->\n",
- " trace Critical (fun () -> $\"buildFile / error: {ex |> serializeObj}\") _locals\n",
+ " trace Critical (fun () -> $\"Supervisor.buildFile / error: {ex |> serializeObj}\") _locals\n",
" None, []\n",
" | _ -> None, []\n",
" )\n",
@@ -551,8 +585,8 @@
" let! _fileDeleteResult = fileDeleteObj |> sendObj serverPort\n",
" ()\n",
"\n",
- " let fsxPath = fileDir > $\"{fileName}.fsx\"\n",
- " return fsxPath, result\n",
+ " let outputPath = fileDir > outputFileName\n",
+ " return outputPath, result\n",
"}"
]
},
@@ -576,20 +610,20 @@
},
"outputs": [],
"source": [
- "let inline persistCode code = async {\n",
- " let targetDir = workspaceRoot > \"target/polyglot/spiral_eval\"\n",
+ "let inline persistCode backend code = async {\n",
+ " let targetDir = workspaceRoot > \"target/spiral_Eval\"\n",
"\n",
" let packagesDir = targetDir > \"packages\"\n",
"\n",
- " let hashHex = code |> SpiralCrypto.hash_text\n",
+ " let hashHex = $\"{backend}{code}\" |> SpiralCrypto.hash_text\n",
"\n",
" let codeDir = packagesDir > hashHex\n",
"\n",
- " let mainPath = codeDir > \"main.spi\"\n",
+ " let spiPath = codeDir > \"main.spi\"\n",
"\n",
" codeDir |> System.IO.Directory.CreateDirectory |> ignore\n",
"\n",
- " do! code |> SpiralFileSystem.write_all_text_exists mainPath\n",
+ " do! code |> SpiralFileSystem.write_all_text_exists spiPath\n",
"\n",
" let spiprojPath = codeDir > \"package.spiproj\"\n",
" let spiprojCode =\n",
@@ -602,18 +636,25 @@
"\"\"\"\n",
" do! spiprojCode |> SpiralFileSystem.write_all_text_exists spiprojPath\n",
"\n",
- " let fsxPath = codeDir > \"main.fsx\"\n",
- "\n",
- " if fsxPath |> System.IO.File.Exists |> not\n",
- " then return mainPath, None\n",
- " else\n",
- " let! oldCode = mainPath |> SpiralFileSystem.read_all_text_async\n",
- " if oldCode <> code\n",
- " then return mainPath, None\n",
+ " match backend with\n",
+ " | None -> return spiPath, None\n",
+ " | Some backend ->\n",
+ " let outputFileName =\n",
+ " match backend with\n",
+ " | Fsharp -> $\"main.fsx\"\n",
+ " | Cuda -> $\"main.py\"\n",
+ " let outputPath = codeDir > outputFileName\n",
+ "\n",
+ " if outputPath |> System.IO.File.Exists |> not\n",
+ " then return spiPath, None\n",
" else\n",
- " let! fsxCode = fsxPath |> SpiralFileSystem.read_all_text_async\n",
- " return mainPath, Some (fsxPath, fsxCode |> SpiralSm.replace \"\\r\\n\" \"\\n\")\n",
- "}"
+ " let! oldCode = spiPath |> SpiralFileSystem.read_all_text_async\n",
+ " if oldCode <> code\n",
+ " then return spiPath, None\n",
+ " else\n",
+ " let! outputCode = outputPath |> SpiralFileSystem.read_all_text_async\n",
+ " return spiPath, Some (outputPath, outputCode |> SpiralSm.replace \"\\r\\n\" \"\\n\")\n",
+ " }"
]
},
{
@@ -636,13 +677,13 @@
},
"outputs": [],
"source": [
- "let inline buildCode cache timeout cancellationToken code = async {\n",
- " let! mainPath, fsx = code |> persistCode\n",
- " match fsx with\n",
- " | Some (fsxPath, fsxCode) when cache -> return mainPath, (fsxPath, Some fsxCode), []\n",
+ "let inline buildCode backend cache timeout cancellationToken code = async {\n",
+ " let! mainPath, outputCache = code |> persistCode (Some backend)\n",
+ " match outputCache with\n",
+ " | Some (outputPath, outputCode) when cache -> return mainPath, (outputPath, Some outputCode), []\n",
" | _ ->\n",
- " let! fsxPath, (fsxCode, errors) = mainPath |> buildFile timeout None cancellationToken\n",
- " return mainPath, (fsxPath, fsxCode), errors\n",
+ " let! outputPath, (outputCode, errors) = mainPath |> buildFile backend timeout None cancellationToken\n",
+ " return mainPath, (outputPath, outputCode), errors\n",
"}"
]
},
@@ -680,36 +721,30 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:00:20 debug #1 async.run_with_timeout_async / timeout: 500\n",
- "00:00:17 debug #1 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:00:16 debug #1 async.run_with_timeout_async / timeout: 500\n",
+ "00:00:14 debug #1 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true,\n",
+ " [||], Some , None, true,\n",
" Some \"C:\\home\\git\\polyglot\")\n",
- "00:00:18 verbose #2 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:00:18 verbose #3 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:00:18 verbose #4 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:00:21 debug #2 async.run_with_timeout_async / timeout: 100\n",
- "00:00:21 verbose #3 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
- "00:00:21 debug #4 async.run_with_timeout_async / timeout: 100\n",
- "00:00:21 debug #5 async.run_with_timeout_async / timeout: 100\n",
- "00:00:21 debug #6 async.run_with_timeout_async / timeout: 100\n",
- "00:00:21 debug #7 async.run_with_timeout_async / timeout: 100\n",
- "00:00:21 debug #8 async.run_with_timeout_async / timeout: 100\n",
- "00:00:22 debug #9 async.run_with_timeout_async / timeout: 100\n",
- "00:00:19 verbose #5 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:00:22 debug #10 async.run_with_timeout_async / timeout: 100\n",
- "00:00:15 verbose #1 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:00:15 verbose #2 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:00:20 verbose #6 > Server bound to: http://localhost:13805\n",
- "00:00:15 debug #3 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:15 debug #4 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:15 verbose #5 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl app () =\\n console.write_line \\u0022text\\u0022\\n 1i32\\n\\ninl main ...ot/spiral_eval/packages/0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0/main.spi\"}} / result:\n",
- "00:00:15 verbose #6 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0/main.spi\"}} / result:\n",
- "00:00:21 verbose #7 > 00:00:02 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0/main.spi\n",
- "00:00:16 debug #7 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:17 debug #8 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:18 debug #9 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:19 debug #10 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\\main.spi / fsxContent: let rec closure0 () () : int32 =\n",
+ "00:00:14 verbose #2 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:00:14 verbose #3 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:00:14 verbose #4 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
+ "00:00:17 debug #2 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:17 verbose #3 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:00:17 debug #4 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:14 verbose #5 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:00:17 debug #5 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:11 verbose #1 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:00:11 verbose #2 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:00:15 verbose #6 > Server bound to: http://localhost:13805\n",
+ "00:00:12 debug #3 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:12 debug #4 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:12 verbose #5 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl app () =\\n console.write_line \\u0022text\\u0022\\n 1i32\\n\\ninl main ...et/spiral_Eval/packages/8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf/main.spi\"}} / result:\n",
+ "00:00:12 verbose #6 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf/main.spi\"}} / result:\n",
+ "00:00:15 verbose #7 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf/main.spi\n",
+ "00:00:13 debug #7 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:14 debug #8 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:14 debug #9 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\\main.spi / outputContent: let rec closure0 () () : int32 =\n",
" let v0 : (string -> unit) = System.Console.WriteLine\n",
" let v1 : string = \"text\"\n",
" v0 v1\n",
@@ -717,10 +752,10 @@
"let v0 : (unit -> int32) = closure0()\n",
"()\n",
" / errors: [] / typeErrorCount: 0\n",
- "00:00:19 verbose #11 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/0ad2ee90a0886647a7d9c334e1811a0c3ae5599125952e30eba9d5e3b57a56e0\"]}} / result:\n",
- "00:00:26 verbose #11 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:00:26 debug #12 async.run_with_timeout_async / timeout: 100\n",
- "00:00:19 debug #12 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
+ "00:00:14 verbose #10 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/8c88433e7d69e9e1a9d4b28a930d3862015735981709156ba9a9a49d1474baaf\"]}} / result:\n",
+ "00:00:20 verbose #6 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:00:20 debug #7 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:15 debug #11 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
"Some\n",
" (Some\n",
" \"let rec closure0 () () : int32 =\n",
@@ -748,9 +783,9 @@
" |> dyn\n",
" |> ignore\n",
"\"\"\"\n",
- "|> buildCode false 15000 None\n",
+ "|> buildCode Fsharp false 15000 None\n",
"|> Async.runWithTimeout 15000\n",
- "|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)\n",
+ "|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)\n",
"|> _assertEqual (\n",
" Some (\n",
" Some \"\"\"let rec closure0 () () : int32 =\n",
@@ -782,41 +817,41 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:00:27 debug #13 async.run_with_timeout_async / timeout: 500\n",
- "00:00:24 debug #8 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:00:21 debug #8 async.run_with_timeout_async / timeout: 500\n",
+ "00:00:19 debug #8 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true,\n",
+ " [||], Some , None, true,\n",
" Some \"C:\\home\\git\\polyglot\")\n",
- "00:00:25 verbose #9 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:00:25 verbose #10 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:00:25 verbose #11 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:00:27 debug #14 async.run_with_timeout_async / timeout: 100\n",
- "00:00:27 verbose #15 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
- "00:00:27 debug #16 async.run_with_timeout_async / timeout: 100\n",
- "00:00:25 verbose #12 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:00:27 debug #17 async.run_with_timeout_async / timeout: 100\n",
- "00:00:20 verbose #13 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:00:20 verbose #14 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:00:25 verbose #13 > Server bound to: http://localhost:13805\n",
- "00:00:20 debug #15 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:20 debug #16 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:20 verbose #17 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/main.spi\"}} / result:\n",
- "00:00:20 verbose #18 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/main.spi\"}} / result:\n",
- "00:00:26 verbose #14 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/main.spi\n",
- "00:00:21 debug #19 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:22 debug #20 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:28 verbose #15 > Cannot find `main` in file main.\n",
- "00:00:28 verbose #16 > 00:00:03 debug #5 Supervisor.supervisor_server.BuildFile.handle_build_result.BuildSkip / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/main.spi\n",
- "00:00:23 debug #21 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:24 debug #22 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:25 debug #23 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:26 debug #24 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:27 debug #25 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:28 debug #26 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:36 verbose #18 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:00:36 debug #19 async.run_with_timeout_async / timeout: 100\n",
- "00:00:29 debug #27 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
- "00:00:29 debug #28 runWithTimeoutAsync / timeout: 10000\n",
+ "00:00:19 verbose #9 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:00:19 verbose #10 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:00:19 verbose #11 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
+ "00:00:22 debug #9 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:22 verbose #10 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:00:22 debug #11 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:19 verbose #12 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:00:22 debug #12 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:16 verbose #12 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:00:16 verbose #13 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:00:20 verbose #13 > Server bound to: http://localhost:13805\n",
+ "00:00:16 debug #14 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:16 debug #15 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:16 verbose #16 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4/main.spi\"}} / result:\n",
+ "00:00:16 verbose #17 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4/main.spi\"}} / result:\n",
+ "00:00:20 verbose #14 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4/main.spi\n",
+ "00:00:17 debug #18 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:18 debug #19 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:22 verbose #15 > Cannot find `main` in file main.\n",
+ "00:00:22 verbose #16 > 00:00:03 debug #5 Supervisor.supervisor_server.BuildFile.handle_build_result.BuildSkip / file: c:/home/git/polyglot/target/spiral_Eval/packages/9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4/main.spi\n",
+ "00:00:19 debug #20 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:20 debug #21 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:21 debug #22 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:22 debug #23 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:23 debug #24 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:24 debug #25 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9c831865c266ad2da284d289670a5c0190122ff42cafbbc1826cd6e1d207b0d4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:31 verbose #13 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:00:31 debug #14 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:25 debug #26 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
+ "00:00:25 debug #27 runWithTimeoutAsync / timeout: 10000\n",
"\n",
"\n"
]
@@ -826,7 +861,7 @@
"//// test\n",
"\n",
"\"\"\n",
- "|> buildCode false 10000 None\n",
+ "|> buildCode Fsharp false 10000 None\n",
"|> Async.runWithTimeout 10000\n",
"|> _assertEqual None"
]
@@ -847,41 +882,41 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:00:37 debug #20 async.run_with_timeout_async / timeout: 500\n",
- "00:00:34 debug #17 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:00:31 debug #15 async.run_with_timeout_async / timeout: 500\n",
+ "00:00:29 debug #17 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true,\n",
+ " [||], Some , None, true,\n",
" Some \"C:\\home\\git\\polyglot\")\n",
- "00:00:35 verbose #18 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:00:35 verbose #19 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:00:35 verbose #20 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:00:37 debug #21 async.run_with_timeout_async / timeout: 100\n",
- "00:00:37 verbose #22 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
- "00:00:37 debug #23 async.run_with_timeout_async / timeout: 100\n",
- "00:00:35 verbose #21 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:00:38 debug #24 async.run_with_timeout_async / timeout: 100\n",
- "00:00:31 verbose #29 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:00:31 verbose #30 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:00:35 verbose #22 > Server bound to: http://localhost:13805\n",
- "00:00:31 debug #31 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:31 debug #32 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:31 verbose #33 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl main () =\\n 1i32 / 0i32\\n\",\"uri\":\"file:///c:/home/git/polyglot/target...ot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620/main.spi\"}} / result:\n",
- "00:00:31 verbose #34 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620/main.spi\"}} / result:\n",
- "00:00:36 verbose #23 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620/main.spi\n",
- "00:00:32 debug #35 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:33 debug #36 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:33 debug #37 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\\main.spi / fsxContent: / errors: [\n",
+ "00:00:29 verbose #18 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:00:29 verbose #19 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:00:29 verbose #20 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
+ "00:00:32 debug #16 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:32 verbose #17 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:00:32 debug #18 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:30 verbose #21 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:00:32 debug #19 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:26 verbose #28 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:00:26 verbose #29 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:00:30 verbose #22 > Server bound to: http://localhost:13805\n",
+ "00:00:26 debug #30 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:26 debug #31 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:26 verbose #32 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl main () =\\n 1i32 / 0i32\\n\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046/main.spi\"}} / result:\n",
+ "00:00:26 verbose #33 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046/main.spi\"}} / result:\n",
+ "00:00:30 verbose #23 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046/main.spi\n",
+ "00:00:28 debug #34 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:29 debug #35 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:29 debug #36 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\\main.spi / outputContent: / errors: [\n",
" [\n",
" \"An attempt to divide by zero has been detected at compile time.\",\n",
" {\n",
" \"TracedError\": {\n",
" \"message\": \"An attempt to divide by zero has been detected at compile time.\",\n",
" \"trace\": [\n",
- " \"Error trace on line: 1, column: 10 in module: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620/main.spi.\n",
+ " \"Error trace on line: 1, column: 10 in module: c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046/main.spi.\n",
"inl main () =\n",
" ^\n",
"\",\n",
- " \"Error trace on line: 2, column: 5 in module: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620/main.spi.\n",
+ " \"Error trace on line: 2, column: 5 in module: c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046/main.spi.\n",
" 1i32 / 0i32\n",
" ^\n",
"\"\n",
@@ -890,10 +925,10 @@
" }\n",
" ]\n",
"] / typeErrorCount: 0\n",
- "00:00:33 verbose #38 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/232df6d862bb0667133bf3fbc55c0b33286bde4b85cdb17fe93dda9c433ec620\"]}} / result:\n",
- "00:00:40 verbose #25 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:00:40 debug #26 async.run_with_timeout_async / timeout: 100\n",
- "00:00:33 debug #39 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
+ "00:00:29 verbose #37 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/ee0a78d78a0479a47d81f2adf12ca62c75c5c178ab311d98939cbb8c72ded046\"]}} / result:\n",
+ "00:00:35 verbose #20 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:00:35 debug #21 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:29 debug #38 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
"Some (None, [\"An attempt to divide by zero has been detected at compile time.\"])\n",
"\n"
]
@@ -905,9 +940,9 @@
"\"\"\"inl main () =\n",
" 1i32 / 0i32\n",
"\"\"\"\n",
- "|> buildCode false 10000 None\n",
+ "|> buildCode Fsharp false 10000 None\n",
"|> Async.runWithTimeout 10000\n",
- "|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)\n",
+ "|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)\n",
"|> _assertEqual (\n",
" Some (\n",
" None,\n",
@@ -932,31 +967,30 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:00:41 debug #27 async.run_with_timeout_async / timeout: 500\n",
- "00:00:38 debug #24 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:00:36 debug #22 async.run_with_timeout_async / timeout: 500\n",
+ "00:00:33 debug #24 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true,\n",
+ " [||], Some , None, true,\n",
" Some \"C:\\home\\git\\polyglot\")\n",
- "00:00:39 verbose #25 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:00:39 verbose #26 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:00:39 verbose #27 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:00:41 debug #28 async.run_with_timeout_async / timeout: 100\n",
- "00:00:41 verbose #29 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
- "00:00:41 debug #30 async.run_with_timeout_async / timeout: 100\n",
- "00:00:39 verbose #28 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:00:41 debug #31 async.run_with_timeout_async / timeout: 100\n",
- "00:00:35 verbose #40 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:00:35 verbose #41 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:00:39 verbose #29 > Server bound to: http://localhost:13805\n",
- "00:00:35 debug #42 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:35 debug #43 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:35 verbose #44 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl main () =\\n 1 \\u002B \\u0022\\u0022\\n\",\"uri\":\"file:///c:/home/git/polyg...ot/spiral_eval/packages/2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d/main.spi\"}} / result:\n",
- "00:00:35 verbose #45 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d/main.spi\"}} / result:\n",
- "00:00:40 verbose #30 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d/main.spi\n",
- "00:00:36 debug #46 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:37 debug #47 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\\main.spi / fsxContent: / errors: [] / typeErrorCount: 1\n",
- "00:00:37 debug #48 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\\main.spi / fsxContent: / errors: [] / typeErrorCount: 2\n",
- "00:00:37 debug #49 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\\main.spi / fsxContent: / errors: [\n",
+ "00:00:34 verbose #25 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:00:34 verbose #26 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:00:34 verbose #27 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
+ "00:00:36 debug #23 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:36 verbose #24 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:00:36 debug #25 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:34 verbose #28 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:00:36 debug #26 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:31 verbose #39 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:00:31 verbose #40 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:00:34 verbose #29 > Server bound to: http://localhost:13805\n",
+ "00:00:31 debug #41 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:31 debug #42 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:31 verbose #43 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl main () =\\n 1 \\u002B \\u0022\\u0022\\n\",\"uri\":\"file:///c:/home/git/polyg...et/spiral_Eval/packages/76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b/main.spi\"}} / result:\n",
+ "00:00:31 verbose #44 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b/main.spi\"}} / result:\n",
+ "00:00:34 verbose #30 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b/main.spi\n",
+ "00:00:32 debug #45 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:33 debug #46 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\\main.spi / outputContent: / errors: [] / typeErrorCount: 1\n",
+ "00:00:33 debug #47 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\\main.spi / outputContent: / errors: [\n",
" [\n",
" \"main.spi:\n",
"Constraint satisfaction error.\n",
@@ -981,15 +1015,15 @@
"Fails to satisfy: number\"\n",
" ]\n",
" ],\n",
- " \"uri\": \"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d/main.spi\"\n",
+ " \"uri\": \"file:///c:/home/git/polyglot/target/spiral_Eval/packages/76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b/main.spi\"\n",
" }\n",
" }\n",
" ]\n",
- "] / typeErrorCount: 2\n",
- "00:00:37 verbose #50 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/2278923ce88b0e473e77d4d93e25afa6e5e4f5efe803982e504cc198d4c4d82d\"]}} / result:\n",
- "00:00:44 verbose #32 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:00:44 debug #33 async.run_with_timeout_async / timeout: 100\n",
- "00:00:37 debug #51 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
+ "] / typeErrorCount: 1\n",
+ "00:00:33 verbose #48 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/76b13cc01bea41edca2abb2018ecb52338691709add5c127990c271c0479c00b\"]}} / result:\n",
+ "00:00:38 verbose #27 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:00:39 debug #28 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:33 debug #49 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
"Some (None, [\"main.spi:\n",
"Constraint satisfaction error.\n",
"Got: string\n",
@@ -1004,9 +1038,9 @@
"\"\"\"inl main () =\n",
" 1 + \"\"\n",
"\"\"\"\n",
- "|> buildCode false 10000 None\n",
+ "|> buildCode Fsharp false 10000 None\n",
"|> Async.runWithTimeout 10000\n",
- "|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)\n",
+ "|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)\n",
"|> _assertEqual (\n",
" Some (\n",
" None,\n",
@@ -1036,30 +1070,31 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:00:44 debug #34 async.run_with_timeout_async / timeout: 500\n",
- "00:00:42 debug #31 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:00:39 debug #29 async.run_with_timeout_async / timeout: 500\n",
+ "00:00:37 debug #31 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true,\n",
+ " [||], Some , None, true,\n",
" Some \"C:\\home\\git\\polyglot\")\n",
- "00:00:42 verbose #32 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:00:42 verbose #33 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:00:42 verbose #34 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:00:45 debug #35 async.run_with_timeout_async / timeout: 100\n",
- "00:00:45 verbose #36 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
- "00:00:45 debug #37 async.run_with_timeout_async / timeout: 100\n",
- "00:00:43 verbose #35 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:00:45 debug #38 async.run_with_timeout_async / timeout: 100\n",
- "00:00:38 verbose #52 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:00:38 verbose #53 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:00:43 verbose #36 > Server bound to: http://localhost:13805\n",
- "00:00:38 debug #54 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:38 debug #55 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:38 verbose #56 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl main () =\\n x \\u002B y\\n\",\"uri\":\"file:///c:/home/git/polyglot/target/...ot/spiral_eval/packages/5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b/main.spi\"}} / result:\n",
- "00:00:38 verbose #57 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b/main.spi\"}} / result:\n",
- "00:00:43 verbose #37 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b/main.spi\n",
- "00:00:39 debug #58 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:40 debug #59 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\\main.spi / fsxContent: / errors: [] / typeErrorCount: 1\n",
- "00:00:40 debug #60 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\\main.spi / fsxContent: / errors: [\n",
+ "00:00:37 verbose #32 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:00:37 verbose #33 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:00:37 verbose #34 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
+ "00:00:40 debug #30 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:40 verbose #31 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:00:40 debug #32 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:37 verbose #35 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:00:40 debug #33 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:34 verbose #50 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:00:34 verbose #51 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:00:38 verbose #36 > Server bound to: http://localhost:13805\n",
+ "00:00:34 debug #52 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:34 debug #53 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:34 verbose #54 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl main () =\\n x \\u002B y\\n\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4/main.spi\"}} / result:\n",
+ "00:00:34 verbose #55 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4/main.spi\"}} / result:\n",
+ "00:00:38 verbose #37 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4/main.spi\n",
+ "00:00:35 debug #56 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:36 debug #57 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:36 debug #58 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\\main.spi / outputContent: / errors: [] / typeErrorCount: 1\n",
+ "00:00:36 debug #59 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\\main.spi / outputContent: / errors: [\n",
" [\n",
" \"main.spi:\n",
"Unbound variable: x.\n",
@@ -1094,15 +1129,15 @@
" \"Unbound variable: y.\"\n",
" ]\n",
" ],\n",
- " \"uri\": \"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b/main.spi\"\n",
+ " \"uri\": \"file:///c:/home/git/polyglot/target/spiral_Eval/packages/cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4/main.spi\"\n",
" }\n",
" }\n",
" ]\n",
"] / typeErrorCount: 1\n",
- "00:00:40 verbose #61 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/5d8d0e66f59ab13f3bfd8d88f05ce13771ab005b08581d99225216170ba6489b\"]}} / result:\n",
- "00:00:47 verbose #39 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:00:47 debug #40 async.run_with_timeout_async / timeout: 100\n",
- "00:00:40 debug #62 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
+ "00:00:36 verbose #60 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/cfa3b536fb46879d63cb523d8a44192250a24ea6686659f958914728b1fe1ef4\"]}} / result:\n",
+ "00:00:42 verbose #34 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:00:42 debug #35 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:37 debug #61 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
"Some (None, [\"main.spi:\n",
"Unbound variable: x.\n",
"Unbound variable: y.\"])\n",
@@ -1116,9 +1151,9 @@
"\"\"\"inl main () =\n",
" x + y\n",
"\"\"\"\n",
- "|> buildCode false 10000 None\n",
+ "|> buildCode Fsharp false 10000 None\n",
"|> Async.runWithTimeout 10000\n",
- "|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)\n",
+ "|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)\n",
"|> _assertEqual (\n",
" Some (\n",
" None,\n",
@@ -1147,45 +1182,45 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:00:48 debug #41 async.run_with_timeout_async / timeout: 500\n",
- "00:00:46 debug #38 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:00:43 debug #36 async.run_with_timeout_async / timeout: 500\n",
+ "00:00:41 debug #38 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true,\n",
+ " [||], Some , None, true,\n",
" Some \"C:\\home\\git\\polyglot\")\n",
- "00:00:46 verbose #39 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:00:46 verbose #40 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:00:46 verbose #41 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:00:48 debug #42 async.run_with_timeout_async / timeout: 100\n",
- "00:00:48 verbose #43 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
- "00:00:48 debug #44 async.run_with_timeout_async / timeout: 100\n",
- "00:00:46 verbose #42 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:00:49 debug #45 async.run_with_timeout_async / timeout: 100\n",
- "00:00:42 verbose #63 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:00:42 verbose #64 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:00:46 verbose #43 > Server bound to: http://localhost:13805\n",
- "00:00:42 debug #65 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:42 debug #66 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:42 verbose #67 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\\ninl main () =\\n real\\n inl real_unbox forall a. (obj : a) : a =\\...ot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi\"}} / result:\n",
- "00:00:42 verbose #68 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi\"}} / result:\n",
- "00:00:47 verbose #44 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi\n",
- "00:00:43 debug #69 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:44 debug #70 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:44 debug #71 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\\main.spi / fsxContent: / errors: [\n",
+ "00:00:41 verbose #39 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:00:41 verbose #40 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:00:41 verbose #41 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
+ "00:00:44 debug #37 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:44 verbose #38 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:00:44 debug #39 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:41 verbose #42 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:00:44 debug #40 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:38 verbose #62 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:00:38 verbose #63 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:00:42 verbose #43 > Server bound to: http://localhost:13805\n",
+ "00:00:38 debug #64 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:38 debug #65 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:38 verbose #66 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\\ninl main () =\\n real\\n inl real_unbox forall a. (obj : a) : a =\\...et/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi\"}} / result:\n",
+ "00:00:38 verbose #67 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi\"}} / result:\n",
+ "00:00:42 verbose #44 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi\n",
+ "00:00:39 debug #68 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:40 debug #69 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:41 debug #70 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\\main.spi / outputContent: / errors: [\n",
" [\n",
" \"Cannot apply a forall with a term.\",\n",
" {\n",
" \"TracedError\": {\n",
" \"message\": \"Cannot apply a forall with a term.\",\n",
" \"trace\": [\n",
- " \"Error trace on line: 2, column: 10 in module: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi.\n",
+ " \"Error trace on line: 2, column: 10 in module: c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi.\n",
"inl main () =\n",
" ^\n",
"\",\n",
- " \"Error trace on line: 4, column: 9 in module: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi.\n",
+ " \"Error trace on line: 4, column: 9 in module: c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi.\n",
" inl real_unbox forall a. (obj : a) : a =\n",
" ^\n",
"\",\n",
- " \"Error trace on line: 7, column: 9 in module: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50/main.spi.\n",
+ " \"Error trace on line: 7, column: 9 in module: c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a/main.spi.\n",
" real_unbox ()\n",
" ^\n",
"\"\n",
@@ -1194,10 +1229,10 @@
" }\n",
" ]\n",
"] / typeErrorCount: 0\n",
- "00:00:44 verbose #72 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/a2aa158e3d25dde470018a814a2045bf437bae1760d98ab33335c72b076d4d50\"]}} / result:\n",
- "00:00:51 verbose #46 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:00:51 debug #47 async.run_with_timeout_async / timeout: 100\n",
- "00:00:44 debug #73 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
+ "00:00:41 verbose #71 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/7328c18b0e8ef6c0be0cbc319b4cb6918806cd0ec87942527e5833d681fe1f6a\"]}} / result:\n",
+ "00:00:47 verbose #41 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:00:47 debug #42 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:41 debug #72 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
"Some (None, [\"Cannot apply a forall with a term.\"])\n",
"\n"
]
@@ -1215,9 +1250,9 @@
" real_unbox ()\n",
" ()\n",
"\"\"\"\n",
- "|> buildCode false 10000 None\n",
+ "|> buildCode Fsharp false 10000 None\n",
"|> Async.runWithTimeout 10000\n",
- "|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)\n",
+ "|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)\n",
"|> _assertEqual (\n",
" Some (\n",
" None,\n",
@@ -1242,30 +1277,30 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:00:52 debug #48 async.run_with_timeout_async / timeout: 500\n",
- "00:00:50 debug #45 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:00:47 debug #43 async.run_with_timeout_async / timeout: 500\n",
+ "00:00:45 debug #45 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true,\n",
+ " [||], Some , None, true,\n",
" Some \"C:\\home\\git\\polyglot\")\n",
- "00:00:50 verbose #46 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:00:50 verbose #47 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:00:50 verbose #48 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:00:52 debug #49 async.run_with_timeout_async / timeout: 100\n",
- "00:00:52 verbose #50 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
- "00:00:53 debug #51 async.run_with_timeout_async / timeout: 100\n",
- "00:00:50 verbose #49 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:00:53 debug #52 async.run_with_timeout_async / timeout: 100\n",
- "00:00:46 verbose #74 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:00:46 verbose #75 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:00:51 verbose #50 > Server bound to: http://localhost:13805\n",
- "00:00:46 debug #76 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:46 debug #77 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:46 verbose #78 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\\ninl main () =\\n real\\n inl real_unbox forall a. (obj : a) : a =\\...ot/spiral_eval/packages/84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e/main.spi\"}} / result:\n",
- "00:00:46 verbose #79 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e/main.spi\"}} / result:\n",
- "00:00:51 verbose #51 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e/main.spi\n",
- "00:00:47 debug #80 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:48 debug #81 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:48 debug #82 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\\main.spi / fsxContent: / errors: [\n",
+ "00:00:45 verbose #46 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:00:45 verbose #47 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:00:45 verbose #48 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
+ "00:00:48 debug #44 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:48 verbose #45 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:00:48 debug #46 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:46 verbose #49 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:00:48 debug #47 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:42 verbose #73 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:00:42 verbose #74 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:00:46 verbose #50 > Server bound to: http://localhost:13805\n",
+ "00:00:42 debug #75 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:42 debug #76 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:42 verbose #77 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\\ninl main () =\\n real\\n inl real_unbox forall a. (obj : a) : a =\\...et/spiral_Eval/packages/7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e/main.spi\"}} / result:\n",
+ "00:00:42 verbose #78 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e/main.spi\"}} / result:\n",
+ "00:00:46 verbose #51 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e/main.spi\n",
+ "00:00:43 debug #79 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:44 debug #80 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:45 debug #81 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\\main.spi / outputContent: / errors: [\n",
" [\n",
" \"The main function should not have a forall.\",\n",
" {\n",
@@ -1276,10 +1311,10 @@
" }\n",
" ]\n",
"] / typeErrorCount: 0\n",
- "00:00:48 verbose #83 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/84eca3865a0cfc1afd28f49a38d395e9b89071527b4bda759de7cfb116593b3e\"]}} / result:\n",
- "00:00:55 verbose #53 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:00:55 debug #54 async.run_with_timeout_async / timeout: 100\n",
- "00:00:48 debug #84 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
+ "00:00:45 verbose #82 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/7edb70ebb1b24f671a663af73f41c7905a8ba26bb617418a310694663ad6394e\"]}} / result:\n",
+ "00:00:51 verbose #48 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:00:51 debug #49 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:45 debug #83 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
"Some (None, [\"The main function should not have a forall.\"])\n",
"\n"
]
@@ -1296,9 +1331,9 @@
" | _ => obj\n",
" real_unbox `i32 1\n",
"\"\"\"\n",
- "|> buildCode false 10000 None\n",
+ "|> buildCode Fsharp false 10000 None\n",
"|> Async.runWithTimeout 10000\n",
- "|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)\n",
+ "|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)\n",
"|> _assertEqual (\n",
" Some (\n",
" None,\n",
@@ -1323,35 +1358,35 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:00:56 debug #55 async.run_with_timeout_async / timeout: 500\n",
- "00:00:53 debug #52 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:00:51 debug #50 async.run_with_timeout_async / timeout: 500\n",
+ "00:00:49 debug #52 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true,\n",
+ " [||], Some , None, true,\n",
" Some \"C:\\home\\git\\polyglot\")\n",
- "00:00:54 verbose #53 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:00:54 verbose #54 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:00:54 verbose #55 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:00:56 debug #56 async.run_with_timeout_async / timeout: 100\n",
- "00:00:56 verbose #57 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
- "00:00:56 debug #58 async.run_with_timeout_async / timeout: 100\n",
- "00:00:54 verbose #56 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:00:57 debug #59 async.run_with_timeout_async / timeout: 100\n",
- "00:00:50 verbose #85 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:00:50 verbose #86 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:00:54 verbose #57 > Server bound to: http://localhost:13805\n",
- "00:00:50 debug #87 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:50 debug #88 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:50 verbose #89 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\\ninl init_series start end inc =\\n inl total : f64 = conv ((end - start)...ot/spiral_eval/packages/c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294/main.spi\"}} / result:\n",
- "00:00:50 verbose #90 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294/main.spi\"}} / result:\n",
- "00:00:55 verbose #58 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294/main.spi\n",
- "00:00:51 debug #91 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:52 debug #92 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:52 debug #93 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\\main.spi / fsxContent: 0.3325000000000001\n",
+ "00:00:49 verbose #53 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:00:49 verbose #54 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:00:49 verbose #55 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
+ "00:00:52 debug #51 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:52 verbose #52 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:00:52 debug #53 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:49 verbose #56 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:00:52 debug #54 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:46 verbose #84 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:00:46 verbose #85 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:00:50 verbose #57 > Server bound to: http://localhost:13805\n",
+ "00:00:46 debug #86 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:46 debug #87 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:46 verbose #88 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\\ninl init_series start end inc =\\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2/main.spi\"}} / result:\n",
+ "00:00:46 verbose #89 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2/main.spi\"}} / result:\n",
+ "00:00:50 verbose #58 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2/main.spi\n",
+ "00:00:47 debug #90 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:48 debug #91 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:49 debug #92 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\\main.spi / outputContent: 0.3325000000000001\n",
" / errors: [] / typeErrorCount: 0\n",
- "00:00:52 verbose #94 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/c0932fdbf60389c2ae8b78bb5443994f2d0ecdc6c6e7dfddf408cecaa050d294\"]}} / result:\n",
- "00:00:59 verbose #60 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:00:59 debug #61 async.run_with_timeout_async / timeout: 100\n",
- "00:00:52 debug #95 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
+ "00:00:49 verbose #93 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/9ef2ff1993c1cbbc9a30116fb9fc65b44a054b1256bab698edc2fbd62d2289f2\"]}} / result:\n",
+ "00:00:55 verbose #55 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:00:55 debug #56 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:49 debug #94 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
"Some (Some \"0.3325000000000001\n",
"\", [])\n",
"\n"
@@ -1377,9 +1412,9 @@
"inl main () =\n",
" integral 0.1 (fun x => x ** 2) 0 1\n",
"\"\"\"\n",
- "|> buildCode false 10000 None\n",
+ "|> buildCode Fsharp false 10000 None\n",
"|> Async.runWithTimeout 10000\n",
- "|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)\n",
+ "|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)\n",
"|> _assertEqual (\n",
" Some (\n",
" Some \"0.3325000000000001\\n\",\n",
@@ -1404,35 +1439,170 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:01:00 debug #62 async.run_with_timeout_async / timeout: 500\n",
- "00:00:57 debug #59 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:00:56 debug #57 async.run_with_timeout_async / timeout: 500\n",
+ "00:00:53 debug #59 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ " \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
+ " [||], Some , None, true,\n",
+ " Some \"C:\\home\\git\\polyglot\")\n",
+ "00:00:54 verbose #60 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:00:54 verbose #61 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:00:54 verbose #62 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
+ "00:00:56 debug #58 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:56 verbose #59 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:00:56 debug #60 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:54 verbose #63 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:00:56 debug #61 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:51 verbose #95 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:00:51 verbose #96 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:00:54 verbose #64 > Server bound to: http://localhost:13805\n",
+ "00:00:51 debug #97 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:51 debug #98 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:51 verbose #99 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\\ninl init_series start end inc =\\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a/main.spi\"}} / result:\n",
+ "00:00:51 verbose #100 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Python \\u002B Cuda\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a/main.spi\"}} / result:\n",
+ "00:00:54 verbose #65 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a/main.spi\n",
+ "00:00:52 debug #101 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:53 debug #102 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:53 debug #103 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\\main.spi / outputContent: kernel = r\"\"\"\n",
+ "template struct static_array { el v[dim]; };\n",
+ "template struct static_array_list { el v[dim]; default_int length; };\n",
+ "\"\"\"... = u8 = u16 = u32 = u64 = int; f32 = f64 = float; char = string = str\n",
+ "\n",
+ "def main():\n",
+ " return 0.3325000000000001\n",
+ "\n",
+ "if __name__ == '__main__': result = main(); None if result is None else print(result)\n",
+ " / errors: [] / typeErrorCount: 0\n",
+ "00:00:53 verbose #104 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/2e0bd0b3083fbaaaf3a4ff1ebb639c90d0888e866b0857ab4bc5cf2b7402d93a\"]}} / result:\n",
+ "00:00:59 verbose #62 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:00:59 debug #63 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:53 debug #105 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
+ "Some\n",
+ " (Some\n",
+ " \"kernel = r\"\"\"\n",
+ "template struct static_array { el v[dim]; };\n",
+ "template struct static_array_list { el v[dim]; default_int length; };\n",
+ "\"\"\"\n",
+ "class static_array(list):\n",
+ " def __init__(self, length):\n",
+ " for _ in range(length):\n",
+ " self.append(None)\n",
+ "\n",
+ "class static_array_list(static_array):\n",
+ " def __init__(self, length):\n",
+ " super().__init__(length)\n",
+ " self.length = 0\n",
+ "import cupy as cp\n",
+ "from dataclasses import dataclass\n",
+ "from typing import NamedTuple, Union, Callable, Tuple\n",
+ "i8 = i16 = i32 = i64 = u8 = u16 = u32 = u64 = int; f32 = f64 = float; char = string = str\n",
+ "\n",
+ "def main():\n",
+ " return 0.3325000000000001\n",
+ "\n",
+ "if __name__ == '__main__': result = main(); None if result is None else print(result)\n",
+ "\",\n",
+ " [])\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "//// test\n",
+ "\n",
+ "\"\"\"\n",
+ "inl init_series start end inc =\n",
+ " inl total : f64 = conv ((end - start) / inc) + 1\n",
+ " listm.init total (conv >> (*) inc >> (+) start) : list f64\n",
+ "\n",
+ "type integration = (f64 -> f64) -> f64 -> f64 -> f64\n",
+ "\n",
+ "inl integral dt : integration =\n",
+ " fun f a b =>\n",
+ " init_series (a + dt / 2) (b - dt / 2) dt\n",
+ " |> listm.map (f >> (*) dt)\n",
+ " |> listm.fold (+) 0\n",
+ "\n",
+ "inl main () =\n",
+ " integral 0.1 (fun x => x ** 2) 0 1\n",
+ "\"\"\"\n",
+ "|> buildCode Cuda false 10000 None\n",
+ "|> Async.runWithTimeout 10000\n",
+ "|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)\n",
+ "|> _assertEqual (\n",
+ " Some (\n",
+ " Some \"kernel = r\\\"\\\"\\\"\n",
+ "template struct static_array { el v[dim]; };\n",
+ "template struct static_array_list { el v[dim]; default_int length; };\n",
+ "\\\"\\\"\\\"\n",
+ "class static_array(list):\n",
+ " def __init__(self, length):\n",
+ " for _ in range(length):\n",
+ " self.append(None)\n",
+ "\n",
+ "class static_array_list(static_array):\n",
+ " def __init__(self, length):\n",
+ " super().__init__(length)\n",
+ " self.length = 0\n",
+ "import cupy as cp\n",
+ "from dataclasses import dataclass\n",
+ "from typing import NamedTuple, Union, Callable, Tuple\n",
+ "i8 = i16 = i32 = i64 = u8 = u16 = u32 = u64 = int; f32 = f64 = float; char = string = str\n",
+ "\n",
+ "def main():\n",
+ " return 0.3325000000000001\n",
+ "\n",
+ "if __name__ == '__main__': result = main(); None if result is None else print(result)\n",
+ "\",\n",
+ " []\n",
+ " )\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "dotnet_interactive": {
+ "language": "fsharp"
+ },
+ "polyglot_notebook": {
+ "kernelName": "fsharp"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "00:01:00 debug #64 async.run_with_timeout_async / timeout: 500\n",
+ "00:00:57 debug #66 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true,\n",
+ " [||], Some , None, true,\n",
" Some \"C:\\home\\git\\polyglot\")\n",
- "00:00:58 verbose #60 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:00:58 verbose #61 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:00:58 verbose #62 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:01:00 debug #63 async.run_with_timeout_async / timeout: 100\n",
- "00:01:00 verbose #64 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:00:58 verbose #67 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:00:58 verbose #68 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:00:58 verbose #69 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
"00:01:00 debug #65 async.run_with_timeout_async / timeout: 100\n",
- "00:00:58 verbose #63 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:01:00 debug #66 async.run_with_timeout_async / timeout: 100\n",
- "00:00:54 verbose #96 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:00:54 verbose #97 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:00:58 verbose #64 > Server bound to: http://localhost:13805\n",
- "00:00:54 debug #98 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:54 debug #99 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:54 verbose #100 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\\ninl init_series start end inc =\\n inl total : f64 = conv ((end - start)...ot/spiral_eval/packages/355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c/main.spi\"}} / result:\n",
- "00:00:54 verbose #101 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c/main.spi\"}} / result:\n",
- "00:00:59 verbose #65 > 00:00:01 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/polyglot/spiral_eval/packages/355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c/main.spi\n",
- "00:00:55 debug #102 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:56 debug #103 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\\main.spi / fsxContent: / errors: [] / typeErrorCount: 0\n",
- "00:00:56 debug #104 buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\\packages\\355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\\main.spi / fsxContent: 0.33332500000000004\n",
+ "00:01:00 verbose #66 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:01:00 debug #67 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:58 verbose #70 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:01:01 debug #68 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:55 verbose #106 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:00:55 verbose #107 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:00:58 verbose #71 > Server bound to: http://localhost:13805\n",
+ "00:00:55 debug #108 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:55 debug #109 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:55 verbose #110 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"\\ninl init_series start end inc =\\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476/main.spi\"}} / result:\n",
+ "00:00:55 verbose #111 Supervisor.sendJson / port: 13805 / json: {\"BuildFile\":{\"backend\":\"Fsharp\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476/main.spi\"}} / result:\n",
+ "00:00:58 verbose #72 > 00:00:00 debug #4 Supervisor.supervisor_server.BuildFile / file: c:/home/git/polyglot/target/spiral_Eval/packages/bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476/main.spi\n",
+ "00:00:56 debug #112 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:57 debug #113 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\\main.spi / outputContent: / errors: [] / typeErrorCount: 0\n",
+ "00:00:57 debug #114 Supervisor.buildFile / takeWhileInclusive / path: C:\\home\\git\\polyglot\\target/spiral_Eval\\packages\\bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\\main.spi / outputContent: 0.33332500000000004\n",
" / errors: [] / typeErrorCount: 0\n",
- "00:00:56 verbose #105 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/355c36b6d259fe6b1c7527aa9b475ca37914ad348c4a239687383dcd0daeed2c\"]}} / result:\n",
- "00:01:03 verbose #67 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:01:03 debug #68 async.run_with_timeout_async / timeout: 100\n",
- "00:00:56 debug #106 watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
+ "00:00:57 verbose #115 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/bef9303d5ade2630e0a996e8c6bea98b5b6c6f4e06aab63d23b1754d52936476\"]}} / result:\n",
+ "00:01:03 verbose #69 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:01:03 debug #70 async.run_with_timeout_async / timeout: 100\n",
+ "00:00:57 debug #116 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite\n",
"Some (Some \"0.33332500000000004\n",
"\", [])\n",
"\n"
@@ -1458,9 +1628,9 @@
"inl main () =\n",
" integral 0.01 (fun x => x ** 2) 0 1\n",
"\"\"\"\n",
- "|> buildCode false 10000 None\n",
+ "|> buildCode Fsharp false 10000 None\n",
"|> Async.runWithTimeout 10000\n",
- "|> Option.map (fun (_, (_, fsxContent), errors) -> fsxContent, errors |> List.map fst)\n",
+ "|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)\n",
"|> _assertEqual (\n",
" Some (\n",
" Some \"0.33332500000000004\\n\",\n",
@@ -1559,7 +1729,7 @@
"outputs": [],
"source": [
"let inline getCodeTokenRange cancellationToken code = async {\n",
- " let! mainPath, _ = persistCode code\n",
+ " let! mainPath, _ = persistCode None code\n",
"\n",
" let codeDir = mainPath |> System.IO.Path.GetDirectoryName\n",
" let tokensPath = codeDir > \"tokens.json\"\n",
@@ -1597,23 +1767,23 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:01:08 debug #69 async.run_with_timeout_async / timeout: 500\n",
- "00:01:06 debug #66 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:01:08 debug #71 async.run_with_timeout_async / timeout: 500\n",
+ "00:01:06 debug #73 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true, Some \"C:\\home\\git\\polyglot\")\n",
- "00:01:06 verbose #67 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:01:06 verbose #68 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:01:06 verbose #69 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:01:09 debug #70 async.run_with_timeout_async / timeout: 100\n",
- "00:01:09 verbose #71 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ " [||], Some , None, true, Some \"C:\\home\\git\\polyglot\")\n",
+ "00:01:06 verbose #74 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:01:06 verbose #75 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:01:06 verbose #76 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
"00:01:09 debug #72 async.run_with_timeout_async / timeout: 100\n",
- "00:01:07 verbose #70 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:01:09 debug #73 async.run_with_timeout_async / timeout: 100\n",
- "00:01:02 verbose #107 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:01:02 verbose #108 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:01:07 verbose #71 > Server bound to: http://localhost:13805\n",
- "00:01:02 verbose #109 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl main () = ()\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/fb6c8d45c45c5bed6706c564f1573e80b77a3923967ce83cb69737ce2ce5040c/main.spi\"}} / result:\n",
- "00:01:03 verbose #110 Supervisor.sendJson / port: 13805 / json: {\"FileTokenRange\":{\"range\":[{\"character\":0,\"line\":0},{\"character\":16,\"line\":0}],\"uri\":\"file:///c:/ho...ot/spiral_eval/packages/fb6c8d45c45c5bed6706c564f1573e80b77a3923967ce83cb69737ce2ce5040c/main.spi\"}} / result: Some([\n",
+ "00:01:09 verbose #73 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:01:09 debug #74 async.run_with_timeout_async / timeout: 100\n",
+ "00:01:06 verbose #77 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:01:09 debug #75 async.run_with_timeout_async / timeout: 100\n",
+ "00:01:03 verbose #117 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:01:03 verbose #118 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:01:07 verbose #78 > Server bound to: http://localhost:13805\n",
+ "00:01:03 verbose #119 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl main () = ()\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/fb6c8d45c45c5bed6706c564f1573e80b77a3923967ce83cb69737ce2ce5040c/main.spi\"}} / result:\n",
+ "00:01:04 verbose #120 Supervisor.sendJson / port: 13805 / json: {\"FileTokenRange\":{\"range\":[{\"character\":0,\"line\":0},{\"character\":16,\"line\":0}],\"uri\":\"file:///c:/ho...et/spiral_Eval/packages/fb6c8d45c45c5bed6706c564f1573e80b77a3923967ce83cb69737ce2ce5040c/main.spi\"}} / result: Some([\n",
" 0,\n",
" 0,\n",
" 3,\n",
@@ -1648,9 +1818,9 @@
" 8,\n",
" 0\n",
"])\n",
- "00:01:03 verbose #111 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/fb6c8d45c45c5bed6706c564f1573e80b77a3923967ce83cb69737ce2ce5040c\"]}} / result:\n",
- "00:01:10 verbose #74 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:01:10 debug #75 async.run_with_timeout_async / timeout: 100\n",
+ "00:01:04 verbose #121 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/fb6c8d45c45c5bed6706c564f1573e80b77a3923967ce83cb69737ce2ce5040c\"]}} / result:\n",
+ "00:01:10 verbose #76 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:01:10 debug #77 async.run_with_timeout_async / timeout: 100\n",
"Some [|0; 0; 3; 7; 0; 0; 4; 4; 0; 0; 0; 5; 1; 8; 0; 0; 1; 1; 8; 0; 0; 2; 1; 4; 0; 0; 2; 1; 8; 0; 0; 1; 1; 8; 0|]\n",
"\n"
]
@@ -1683,23 +1853,23 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "00:01:12 debug #76 async.run_with_timeout_async / timeout: 500\n",
- "00:01:10 debug #72 execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
+ "00:01:12 debug #78 async.run_with_timeout_async / timeout: 500\n",
+ "00:01:10 debug #79 runtime.execute_with_options_async / options: struct (Some System.Threading.CancellationToken,\n",
" \"dotnet \"C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\\Spiral.dll\" --port 13805 --default-int i32 --default-float f64\",\n",
- " [||], Some , None, true, Some \"C:\\home\\git\\polyglot\")\n",
- "00:01:10 verbose #73 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
- "00:01:10 verbose #74 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
- "00:01:10 verbose #75 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
- "00:01:13 debug #77 async.run_with_timeout_async / timeout: 100\n",
- "00:01:13 verbose #78 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ " [||], Some , None, true, Some \"C:\\home\\git\\polyglot\")\n",
+ "00:01:10 verbose #80 > 00:00:00 debug #1 pwd: C:\\home\\git\\polyglot\n",
+ "00:01:10 verbose #81 > 00:00:00 debug #2 dllPath: C:\\home\\git\\polyglot\\deps\\The-Spiral-Language\\The Spiral Language 2\\artifacts\\bin\\The Spiral Language 2\\release\n",
+ "00:01:10 verbose #82 > 00:00:00 debug #3 targetDir: C:\\home\\git\\polyglot\\target/polyglot/spiral_eval\n",
"00:01:13 debug #79 async.run_with_timeout_async / timeout: 100\n",
- "00:01:10 verbose #76 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
- "00:01:13 debug #80 async.run_with_timeout_async / timeout: 100\n",
- "00:01:06 verbose #112 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
- "00:01:06 verbose #113 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
- "00:01:11 verbose #77 > Server bound to: http://localhost:13805\n",
- "00:01:06 verbose #114 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl main () = 1i32\",\"uri\":\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/9df95a2f18642bd8d2f682f6edb6cef45c30ca9c616b33ebb0e5577eed14871c/main.spi\"}} / result:\n",
- "00:01:06 verbose #115 Supervisor.sendJson / port: 13805 / json: {\"FileTokenRange\":{\"range\":[{\"character\":0,\"line\":0},{\"character\":18,\"line\":0}],\"uri\":\"file:///c:/ho...ot/spiral_eval/packages/9df95a2f18642bd8d2f682f6edb6cef45c30ca9c616b33ebb0e5577eed14871c/main.spi\"}} / result: Some([\n",
+ "00:01:13 verbose #80 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: True\n",
+ "00:01:13 debug #81 async.run_with_timeout_async / timeout: 100\n",
+ "00:01:10 verbose #83 > Starting the Spiral Server. It is bound to: http://localhost:13805\n",
+ "00:01:13 debug #82 async.run_with_timeout_async / timeout: 100\n",
+ "00:01:07 verbose #122 Supervisor.sendJson / port: 13805 / json: {\"Ping\":true} / result:\n",
+ "00:01:07 verbose #123 awaitCompiler / Ping / result: 'Some(null)' / port: 13805 / retry: 0\n",
+ "00:01:10 verbose #84 > Server bound to: http://localhost:13805\n",
+ "00:01:07 verbose #124 Supervisor.sendJson / port: 13805 / json: {\"FileOpen\":{\"spiText\":\"inl main () = 1i32\",\"uri\":\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/9df95a2f18642bd8d2f682f6edb6cef45c30ca9c616b33ebb0e5577eed14871c/main.spi\"}} / result:\n",
+ "00:01:08 verbose #125 Supervisor.sendJson / port: 13805 / json: {\"FileTokenRange\":{\"range\":[{\"character\":0,\"line\":0},{\"character\":18,\"line\":0}],\"uri\":\"file:///c:/ho...et/spiral_Eval/packages/9df95a2f18642bd8d2f682f6edb6cef45c30ca9c616b33ebb0e5577eed14871c/main.spi\"}} / result: Some([\n",
" 0,\n",
" 0,\n",
" 3,\n",
@@ -1734,9 +1904,9 @@
" 12,\n",
" 0\n",
"])\n",
- "00:01:06 verbose #116 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/polyglot/spiral_eval/packages/9df95a2f18642bd8d2f682f6edb6cef45c30ca9c616b33ebb0e5577eed14871c\"]}} / result:\n",
- "00:01:14 verbose #81 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
- "00:01:14 debug #82 async.run_with_timeout_async / timeout: 100\n",
+ "00:01:08 verbose #126 Supervisor.sendJson / port: 13805 / json: {\"FileDelete\":{\"uris\":[\"file:///c:/home/git/polyglot/target/spiral_Eval/packages/9df95a2f18642bd8d2f682f6edb6cef45c30ca9c616b33ebb0e5577eed14871c\"]}} / result:\n",
+ "00:01:14 verbose #83 networking.wait_for_port_access / port: 13805 / retry: 0 / timeout: Some 100 / status: False\n",
+ "00:01:14 debug #84 async.run_with_timeout_async / timeout: 100\n",
"Some [|0; 0; 3; 7; 0; 0; 4; 4; 0; 0; 0; 5; 1; 8; 0; 0; 1; 1; 8; 0; 0; 2; 1; 4; 0; 0; 2; 1; 3; 0; 0; 1; 3; 12; 0|]\n",
"\n"
]
@@ -1916,7 +2086,14 @@
" let buildFileAsync =\n",
" buildFileActions\n",
" |> List.map (fun (inputPath, outputPath) -> async {\n",
- " let! _fsxPath, (outputCode, errors) = inputPath |> buildFile timeout (Some serverPort) None\n",
+ " let! _outputPath, (outputCode, errors) =\n",
+ " let backend =\n",
+ " if outputPath |> SpiralSm.ends_with \".fsx\"\n",
+ " then Fsharp\n",
+ " elif outputPath |> SpiralSm.ends_with \".py\"\n",
+ " then Cuda\n",
+ " else failwith $\"Supervisor.main / invalid backend / outputPath: {outputPath}\"\n",
+ " inputPath |> buildFile backend timeout (Some serverPort) None\n",
"\n",
" errors\n",
" |> List.map snd\n",
diff --git a/apps/spiral/Supervisor.fs b/apps/spiral/Supervisor.fs
index 70473156..546ba299 100644
--- a/apps/spiral/Supervisor.fs
+++ b/apps/spiral/Supervisor.fs
@@ -163,8 +163,13 @@ module Supervisor =
|> SpiralSm.replace "\\r\\n" "\n"
|> SpiralSm.replace "\\n" "\n"
+ /// ## Backend
+ type Backend =
+ | Fsharp
+ | Cuda
+
/// ## buildFile
- let inline buildFile timeout port cancellationToken path = async {
+ let inline buildFile backend timeout port cancellationToken path = async {
let fullPath = path |> System.IO.Path.GetFullPath
let fileDir = fullPath |> System.IO.Path.GetDirectoryName
let fileName = fullPath |> System.IO.Path.GetFileNameWithoutExtension
@@ -180,11 +185,16 @@ module Supervisor =
let! serverPort, errors, ct, disposable = awaitCompiler port (Some token)
use _ = disposable
- let fsxContentSeq =
+ let outputFileName =
+ match backend with
+ | Fsharp -> $"{fileName}.fsx"
+ | Cuda -> $"{fileName}.py"
+
+ let outputContentSeq =
stream
|> FSharp.Control.AsyncSeq.chooseAsync (function
| _, (FileSystem.FileSystemChange.Changed (path, _))
- when (path |> System.IO.Path.GetFileName) = $"{fileName}.fsx"
+ when (path |> System.IO.Path.GetFileName) = outputFileName
->
fileDir > path |> SpiralFileSystem.read_all_text_retry_async
| _ -> None |> Async.init
@@ -229,30 +239,30 @@ module Supervisor =
|> FSharp.Control.AsyncSeq.map (fun _ -> None, None)
let outputSeq =
- [ fsxContentSeq; errorsSeq; timerSeq ]
+ [ outputContentSeq; errorsSeq; timerSeq ]
|> FSharp.Control.AsyncSeq.mergeAll
let! outputChild =
((None, [], 0), outputSeq)
||> FSharp.Control.AsyncSeq.scan (
- fun (fsxContentResult, errors, typeErrorCount) (fsxContent, error) ->
- match fsxContent, error with
- | Some fsxContent, None -> Some fsxContent, errors, typeErrorCount
+ fun (outputContentResult, errors, typeErrorCount) (outputContent, error) ->
+ match outputContent, error with
+ | Some outputContent, None -> Some outputContent, errors, typeErrorCount
| None, Some (_, FatalError "File main has a type error somewhere in its path.") ->
- fsxContentResult, errors, typeErrorCount + 1
- | None, Some error -> fsxContentResult, error :: errors, typeErrorCount
+ outputContentResult, errors, typeErrorCount + 1
+ | None, Some error -> outputContentResult, error :: errors, typeErrorCount
| None, None when typeErrorCount >= 1 ->
- fsxContentResult, errors, typeErrorCount + 1
- | _ -> fsxContentResult, errors, typeErrorCount
+ outputContentResult, errors, typeErrorCount + 1
+ | _ -> outputContentResult, errors, typeErrorCount
)
- |> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (fsxContent, errors, typeErrorCount) ->
- trace Debug (fun () -> $"buildFile / takeWhileInclusive / path: {path} / fsxContent: {fsxContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount}") _locals
+ |> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (outputContent, errors, typeErrorCount) ->
+ trace Debug (fun () -> $"Supervisor.buildFile / takeWhileInclusive / path: {path} / outputContent: {outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount}") _locals
#if INTERACTIVE
let errorWait = 2
#else
let errorWait = 4
#endif
- match fsxContent, errors with
+ match outputContent, errors with
| None, [] when typeErrorCount > errorWait -> false
| None, [] -> true
| _ -> false
@@ -270,16 +280,20 @@ module Supervisor =
// do! Async.Sleep 60
- let buildFileObj = {| BuildFile = {| uri = fullPathUri; backend = "Fsharp" |} |}
+ let backendId =
+ match backend with
+ | Fsharp -> "Fsharp"
+ | Cuda -> "Python + Cuda"
+ let buildFileObj = {| BuildFile = {| uri = fullPathUri; backend = backendId |} |}
let! _buildFileResult = buildFileObj |> sendObj serverPort
let! result =
outputChild
|> Async.map (function
- | Some (Ok (Some (fsxCode, errors, _))) ->
- fsxCode, errors |> List.distinct |> List.rev
+ | Some (Ok (Some (outputCode, errors, _))) ->
+ outputCode, errors |> List.distinct |> List.rev
| Some (Error ex) ->
- trace Critical (fun () -> $"buildFile / error: {ex |> serializeObj}") _locals
+ trace Critical (fun () -> $"Supervisor.buildFile / error: {ex |> serializeObj}") _locals
None, []
| _ -> None, []
)
@@ -290,25 +304,25 @@ module Supervisor =
let! _fileDeleteResult = fileDeleteObj |> sendObj serverPort
()
- let fsxPath = fileDir > $"{fileName}.fsx"
- return fsxPath, result
+ let outputPath = fileDir > outputFileName
+ return outputPath, result
}
/// ## persistCode
- let inline persistCode code = async {
- let targetDir = workspaceRoot > "target/polyglot/spiral_eval"
+ let inline persistCode backend code = async {
+ let targetDir = workspaceRoot > "target/spiral_Eval"
let packagesDir = targetDir > "packages"
- let hashHex = code |> SpiralCrypto.hash_text
+ let hashHex = $"{backend}{code}" |> SpiralCrypto.hash_text
let codeDir = packagesDir > hashHex
- let mainPath = codeDir > "main.spi"
+ let spiPath = codeDir > "main.spi"
codeDir |> System.IO.Directory.CreateDirectory |> ignore
- do! code |> SpiralFileSystem.write_all_text_exists mainPath
+ do! code |> SpiralFileSystem.write_all_text_exists spiPath
let spiprojPath = codeDir > "package.spiproj"
let spiprojCode =
@@ -321,27 +335,34 @@ modules:
"""
do! spiprojCode |> SpiralFileSystem.write_all_text_exists spiprojPath
- let fsxPath = codeDir > "main.fsx"
-
- if fsxPath |> System.IO.File.Exists |> not
- then return mainPath, None
- else
- let! oldCode = mainPath |> SpiralFileSystem.read_all_text_async
- if oldCode <> code
- then return mainPath, None
+ match backend with
+ | None -> return spiPath, None
+ | Some backend ->
+ let outputFileName =
+ match backend with
+ | Fsharp -> $"main.fsx"
+ | Cuda -> $"main.py"
+ let outputPath = codeDir > outputFileName
+
+ if outputPath |> System.IO.File.Exists |> not
+ then return spiPath, None
else
- let! fsxCode = fsxPath |> SpiralFileSystem.read_all_text_async
- return mainPath, Some (fsxPath, fsxCode |> SpiralSm.replace "\r\n" "\n")
- }
+ let! oldCode = spiPath |> SpiralFileSystem.read_all_text_async
+ if oldCode <> code
+ then return spiPath, None
+ else
+ let! outputCode = outputPath |> SpiralFileSystem.read_all_text_async
+ return spiPath, Some (outputPath, outputCode |> SpiralSm.replace "\r\n" "\n")
+ }
/// ## buildCode
- let inline buildCode cache timeout cancellationToken code = async {
- let! mainPath, fsx = code |> persistCode
- match fsx with
- | Some (fsxPath, fsxCode) when cache -> return mainPath, (fsxPath, Some fsxCode), []
+ let inline buildCode backend cache timeout cancellationToken code = async {
+ let! mainPath, outputCache = code |> persistCode (Some backend)
+ match outputCache with
+ | Some (outputPath, outputCode) when cache -> return mainPath, (outputPath, Some outputCode), []
| _ ->
- let! fsxPath, (fsxCode, errors) = mainPath |> buildFile timeout None cancellationToken
- return mainPath, (fsxPath, fsxCode), errors
+ let! outputPath, (outputCode, errors) = mainPath |> buildFile backend timeout None cancellationToken
+ return mainPath, (outputPath, outputCode), errors
}
/// ## getFileTokenRange
@@ -393,7 +414,7 @@ modules:
/// ## getCodeTokenRange
let inline getCodeTokenRange cancellationToken code = async {
- let! mainPath, _ = persistCode code
+ let! mainPath, _ = persistCode None code
let codeDir = mainPath |> System.IO.Path.GetDirectoryName
let tokensPath = codeDir > "tokens.json"
@@ -492,7 +513,14 @@ modules:
let buildFileAsync =
buildFileActions
|> List.map (fun (inputPath, outputPath) -> async {
- let! _fsxPath, (outputCode, errors) = inputPath |> buildFile timeout (Some serverPort) None
+ let! _outputPath, (outputCode, errors) =
+ let backend =
+ if outputPath |> SpiralSm.ends_with ".fsx"
+ then Fsharp
+ elif outputPath |> SpiralSm.ends_with ".py"
+ then Cuda
+ else failwith $"Supervisor.main / invalid backend / outputPath: {outputPath}"
+ inputPath |> buildFile backend timeout (Some serverPort) None
errors
|> List.map snd
@@ -540,7 +568,7 @@ modules:
trace Debug (fun () -> $"main / executeCommand / exitCode: {exitCode} / command: {command}") _locals
- if isExitOnError && exitCode > 0
+ if isExitOnError && exitCode <> 0
then SpiralRuntime.current_process_kill ()
return exitCode
diff --git a/apps/spiral/builder/spiral_builder.dib b/apps/spiral/builder/spiral_builder.dib
index 7efc2e64..ca999b14 100644
--- a/apps/spiral/builder/spiral_builder.dib
+++ b/apps/spiral/builder/spiral_builder.dib
@@ -41,6 +41,14 @@ inl types () =
inl get_args () =
{
fsharp = "fsharp", {
+ spi_path = "spi-path", 's'
+ }
+ cuda = "cuda", {
+ py_path = "py-path", 'p'
+ env = "env", 'e'
+ deps = "deps", 'd'
+ }
+ fable = "fable", {
fs_path = "fs-path", 'f'
command = "command", 'c'
}
@@ -48,11 +56,6 @@ inl get_args () =
fs_path = "fs-path", 'f'
deps = "deps", 'd'
}
- dib = "dib", {
- path = "path", 'p'
- retries = "retries", 'r'
- working_directory = "working-directory", 'w'
- }
typescript = "typescript", {
fs_path = "fs-path", 'f'
deps = "deps", 'd'
@@ -61,10 +64,25 @@ inl get_args () =
fs_path = "fs-path", 'f'
deps = "deps", 'd'
}
+ dib = "dib", {
+ path = "path", 'p'
+ retries = "retries", 'r'
+ working_directory = "working-directory", 'w'
+ }
}
#!markdown
+## cuda_env
+
+#!spiral
+
+union cuda_env =
+ | Pip
+ | Poetry
+
+#!markdown
+
## get_command
#!spiral
@@ -76,20 +94,20 @@ let get_command () =
|> runtime.command_subcommand (
##(get_args () .fsharp |> fst)
|> runtime.new_command
- |> runtime.command_init_arg ((get_args () .fsharp |> snd).fs_path) (
+ |> runtime.command_init_arg ((get_args () .fsharp |> snd).spi_path) (
runtime.arg_required true
)
- |> runtime.command_init_arg ((get_args () .fsharp |> snd).command) (
- id
- )
)
|> runtime.command_subcommand (
- ##(get_args () .rust |> fst)
+ ##(get_args () .cuda |> fst)
|> runtime.new_command
- |> runtime.command_init_arg ((get_args () .rust |> snd).fs_path) (
+ |> runtime.command_init_arg ((get_args () .cuda |> snd).py_path) (
runtime.arg_required true
)
- |> runtime.command_init_arg ((get_args () .rust |> snd).deps) (
+ |> runtime.command_init_arg ((get_args () .cuda |> snd).env) (
+ real runtime.arg_union `cuda_env ignore
+ )
+ |> runtime.command_init_arg ((get_args () .cuda |> snd).deps) (
runtime.arg_value_names ;[ ##"NAME"; ##"VERSION" ]
>> runtime.arg_num_args_range (
runtime.new_value_range
@@ -100,19 +118,31 @@ let get_command () =
)
)
|> runtime.command_subcommand (
- ##(get_args () .dib |> fst)
+ ##(get_args () .fable |> fst)
|> runtime.new_command
- |> runtime.command_init_arg ((get_args () .dib |> snd).path) (
+ |> runtime.command_init_arg ((get_args () .fable |> snd).fs_path) (
runtime.arg_required true
- // >> runtime.arg_value_parser (runtime.value_parser_path_buf ())
)
- |> runtime.command_init_arg ((get_args () .dib |> snd).retries) (
- runtime.arg_value_parser (runtime.value_parser_expr "u8")
- )
- |> runtime.command_init_arg ((get_args () .dib |> snd).working_directory) (
+ |> runtime.command_init_arg ((get_args () .fable |> snd).command) (
id
)
)
+ |> runtime.command_subcommand (
+ ##(get_args () .rust |> fst)
+ |> runtime.new_command
+ |> runtime.command_init_arg ((get_args () .rust |> snd).fs_path) (
+ runtime.arg_required true
+ )
+ |> runtime.command_init_arg ((get_args () .rust |> snd).deps) (
+ runtime.arg_value_names ;[ ##"NAME"; ##"VERSION" ]
+ >> runtime.arg_num_args_range (
+ runtime.new_value_range
+ (am'.Start (1i32 |> convert : unativeint))
+ (am'.End id)
+ )
+ >> runtime.arg_action runtime.Append
+ )
+ )
|> runtime.command_subcommand (
##(get_args () .typescript |> fst)
|> runtime.new_command
@@ -145,10 +175,28 @@ let get_command () =
>> runtime.arg_action runtime.Append
)
)
+ |> runtime.command_subcommand (
+ ##(get_args () .dib |> fst)
+ |> runtime.new_command
+ |> runtime.command_init_arg ((get_args () .dib |> snd).path) (
+ runtime.arg_required true
+ // >> runtime.arg_value_parser (runtime.value_parser_path_buf ())
+ )
+ |> runtime.command_init_arg ((get_args () .dib |> snd).retries) (
+ runtime.arg_value_parser (runtime.value_parser_expr "u8")
+ )
+ |> runtime.command_init_arg ((get_args () .dib |> snd).working_directory) (
+ id
+ )
+ )
+
+#!markdown
+
+## fable
#!markdown
-## execute_dotnet_fable
+### execute_dotnet_fable
#!spiral
@@ -171,10 +219,6 @@ let execute_dotnet_fable { workspace_root_external fsproj_path extension package
#!markdown
-## fsharp
-
-#!markdown
-
### persist_code_project
#!spiral
@@ -302,7 +346,7 @@ inl build_project runtime' output_dir path =
inl build_code runtime packages modules output_dir name code =
inl fsproj_path = code |> persist_code_project packages modules name None
inl exit_code = fsproj_path |> build_project runtime output_dir
- if exit_code > 0 then
+ if exit_code <>. 0 then
inl fsproj_text = fsproj_path |> file_system.read_all_text
trace Critical
fun () => "build_code"
@@ -333,7 +377,7 @@ types ()
#!markdown
-## read_file
+### read_file
#!spiral
@@ -350,7 +394,7 @@ inl read_file path =
#!markdown
-## persist_file
+### persist_file
#!spiral
@@ -362,7 +406,7 @@ inl persist_file packages modules path =
#!markdown
-## build_file
+### build_file
#!spiral
@@ -465,11 +509,11 @@ inl process_rust { fs_path deps trace_level } =
+#. $'$"path = \\\"spiral_builder.{!extension}\\\""'
if cargo_toml_path |> file_system.file_exists |> not
- then empty_cargo_toml_content () |> file_system.write_all_text_exists' cargo_toml_path
+ then empty_cargo_toml_content () |> file_system.write_all_text cargo_toml_path
if workspace_cargo_toml_path |> file_system.file_exists |> not
- then empty_cargo_toml_content () |> file_system.write_all_text_exists' workspace_cargo_toml_path
-
+ then empty_cargo_toml_content () |> file_system.write_all_text workspace_cargo_toml_path
+
inl workspace_root_external = file_system.get_workspace_root_external ()
inl workspace_root = workspace_root_external |> resultm.box |> resultm.unwrap_or_else id
@@ -1148,6 +1192,202 @@ inl process_python { fs_path deps trace_level } =
#!markdown
+## cuda
+
+#!markdown
+
+### process_cuda
+
+#!spiral
+
+inl process_cuda { py_path env deps } =
+ inl extension = "py"
+
+ inl new_code_path = py_path
+ inl new_code = new_code_path |> file_system.read_all_text
+
+ inl workspace_root_external = file_system.get_workspace_root_external ()
+ inl workspace_root = workspace_root_external |> resultm.box |> resultm.unwrap_or_else id
+
+ inl package_dir = new_code_path |> file_system.get_directory_name
+
+ inl manifest_path =
+ match env with
+ | Pip => package_dir > "requirements.txt"
+ | Poetry => package_dir > "pyproject.toml"
+
+ inl deps =
+ deps
+ |> am'.vec_map fun dep =>
+ inl dep = dep |> sm'.from_std_string
+ if dep |> sm'.contains "="
+ then dep
+ elif dep |> sm'.ends_with "]"
+ then dep |> sm'.replace "[" $'$"={{version=\'*\',features=["' |> fun x => $'$"{!x}}}"'
+ else $'$"{!dep}=\'*\'"'
+ |> am'.from_vec
+ |> fun x => x : _ i32 _
+ |> seq.of_array'
+ |> sm'.concat "\n"
+
+ inl exit_code, run_result =
+ if deps = ""
+ then 0, ""
+ else
+ inl manifest =
+ match env with
+ | Pip =>
+ deps
+ | Poetry =>
+ $'$"[tool.poetry]"'
+ +#. $'$"name = \\\"test\\\""'
+ +#. $'$"version = \\\"0.0.1\\\""'
+ +#. $'$"description = \\\"\\\""'
+ +#. $'$"authors = []"'
+ +#. $'$""'
+ +#. $'$"[tool.poetry.dependencies]"'
+ +#. $'$"python=\\\"~3.12\\\""'
+ +#. $'$"{!deps}"'
+ +#. $'$""'
+ +#. $'$"[build-system]"'
+ +#. $'$"requires = [\\\"poetry-core\\\"]"'
+ +#. $'$"build-backend = \\\"poetry.core.masonry.api\\\""'
+
+ manifest |> file_system.write_all_text_exists' manifest_path
+
+ runtime.execution_options fun x => { x with
+ command =
+ match env with
+ | Pip => $'$"pip install -r requirements.txt"'
+ | Poetry => $'$"poetry install"'
+ working_directory = package_dir |> optionm'.some'
+ }
+ |> runtime.execute_with_options
+
+ if exit_code <>. 0 then
+ trace Critical
+ fun () => "spiral_builder.process_cuda / env install error"
+ fun () => $'$"env: {!env} / exit_code: {!exit_code} / new_code_path: {!new_code_path} / run_result: {!run_result}"'
+ { extension = Some extension; code = None; output = None }
+ else
+ inl command =
+ match env with
+ | Pip => $'$"python \\\"{!new_code_path}\\\""'
+ | Poetry => $'$"poetry run python \\\"{!new_code_path}\\\""'
+ inl environment_variables =
+ ;[
+ "TRACE_LEVEL", "Verbose"
+ ]
+ inl exit_code, run_result =
+ runtime.execution_options fun x => { x with
+ command
+ environment_variables
+ working_directory = package_dir |> optionm'.some'
+ }
+ |> runtime.execute_with_options
+
+ inl external_command =
+ inl vars =
+ a environment_variables
+ |> am.map fun k, v => $'$"$env:{!k}=\'\'{!v}\'\'"' : string
+ |> fun x => x : _ i32 _
+ |> seq.of_array
+ |> sm'.concat ";"
+ $'$"pwsh -c \'{!vars}; {!command}\'"' : string
+ if exit_code = 0 then
+ inl output =
+ try
+ fun () =>
+ run_result
+ |> sm'.split "\n"
+ |> fun x => a x : _ i32 _
+ |> seq.of_array
+ |> sm'.concat "\n"
+ fun ex =>
+ trace Critical
+ fun () => "spiral_builder.process_cuda / Exception"
+ fun () => $'$"ex: {!ex} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result} / {!_locals ()}"'
+ None
+ |> optionm'.box
+ |> optionm'.unwrap
+
+ { extension = Some extension; code = Some new_code; output = Some output }
+ else
+ trace Critical
+ fun () => "spiral_builder.process_cuda / error"
+ fun () => $'$"exit_code: {!exit_code} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result}"'
+ { extension = Some extension; code = None; output = None }
+
+#!markdown
+
+## fsharp
+
+#!markdown
+
+### process_fsharp
+
+#!spiral
+
+inl process_fsharp { spi_path } =
+ inl extension = "fsx"
+
+ inl new_code_path = spi_path
+ inl new_code = new_code_path |> file_system.read_all_text
+
+ inl workspace_root_external = file_system.get_workspace_root_external ()
+ inl workspace_root = workspace_root_external |> resultm.box |> resultm.unwrap_or_else id
+
+ inl supervisor_path = workspace_root > $"apps/spiral/dist/Supervisor!(runtime.get_executable_suffix ())"
+ inl code_dir = new_code_path |> file_system.get_directory_name
+ inl file_name = new_code_path |> file_system.get_file_name_without_extension
+ inl output_path = code_dir > $'$"{!file_name}.{!extension}"'
+ inl command = $'$"{!supervisor_path} --build-file \\\"{!new_code_path}\\\" \\\"{!output_path}\\\""'
+ inl environment_variables =
+ ;[
+ "TRACE_LEVEL", "Verbose"
+ ]
+ inl exit_code, run_result =
+ runtime.execution_options fun x => { x with
+ command
+ environment_variables
+ working_directory = workspace_root_external |> resultm.box |> resultm.ok'
+ }
+ |> runtime.execute_with_options
+
+ inl external_command =
+ inl vars =
+ a environment_variables
+ |> am.map fun k, v => $'$"$env:{!k}=\'\'{!v}\'\'"' : string
+ |> fun x => x : _ i32 _
+ |> seq.of_array
+ |> sm'.concat ";"
+ $'$"pwsh -c \'{!vars}; {!command}\'"' : string
+ if exit_code = 0 then
+ inl output =
+ try
+ fun () =>
+ run_result
+ |> sm'.split "\n"
+ |> fun x => a x : _ i32 _
+ |> seq.of_array
+ |> sm'.concat "\n"
+ fun ex =>
+ trace Critical
+ fun () => "spiral_builder.process_fsharp / Exception"
+ fun () => $'$"ex: {!ex} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result} / {!_locals ()}"'
+ None
+ |> optionm'.box
+ |> optionm'.unwrap
+
+ { extension = Some extension; code = Some new_code; output = Some output }
+ else
+ trace Critical
+ fun () => "spiral_builder.process_fsharp / error"
+ fun () => $'$"exit_code: {!exit_code} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result}"'
+ { extension = Some extension; code = None; output = None }
+
+#!markdown
+
## run
#!spiral
@@ -1156,18 +1396,66 @@ let rec run trace_level (matches : runtime.arg_matches) : async.future_pin (resu
fun () =>
match matches |> runtime.matches_subcommand |> optionm'.unbox with
| Some (subcommand, arg_matches)
- when (subcommand |> sm'.from_std_string) = (get_args () .fsharp |> fst) =>
+ when (subcommand |> sm'.from_std_string) = (get_args () .cuda |> fst) =>
+
+ inl py_path =
+ arg_matches
+ |> runtime.matches_get_one ((get_args () .cuda |> snd).py_path |> fst)
+ |> optionm'.unbox
+ |> optionm.value
+ |> sm'.from_std_string
+
+ inl env =
+ arg_matches
+ |> runtime.matches_get_one ((get_args () .cuda |> snd).env |> fst)
+ |> optionm'.unbox
+ |> optionm.map (
+ sm'.from_std_string
+ >> reflection.union_try_pick
+ )
+ |> optionm'.flatten
+ |> optionm'.default_value Pip
+
+ inl deps : am'.vec sm'.std_string =
+ arg_matches
+ |> runtime.matches_get_many ((get_args () .cuda |> snd).deps |> fst)
+ |> optionm'.unbox
+ |> optionm'.default_value (;[] |> am'.to_vec)
+
+ inl command_result =
+ process_cuda { py_path env deps }
+ |> fun { extension code output } =>
+ ;[
+ "extension", extension |> optionm'.default_value ""
+ "code", code |> optionm'.default_value ""
+ "output", output |> optionm'.default_value ""
+ ]
+
+ ;[
+ "command_result",
+ command_result
+ |> am'.to_vec
+ |> am'.vec_map' fun k, v =>
+ new_pair (sm'.to_std_string k) (sm'.to_std_string v)
+ |> mapm.b_tree_map_from_vec_pairs
+ |> sm'.serialize
+ |> resultm.unwrap'
+ |> sm'.from_std_string
+ ]
+
+ | Some (subcommand, arg_matches)
+ when (subcommand |> sm'.from_std_string) = (get_args () .fable |> fst) =>
inl fs_path =
arg_matches
- |> runtime.matches_get_one ((get_args () .fsharp |> snd).fs_path |> fst)
+ |> runtime.matches_get_one ((get_args () .fable |> snd).fs_path |> fst)
|> optionm'.unbox
|> optionm.value
|> sm'.from_std_string
inl command =
arg_matches
- |> runtime.matches_get_one ((get_args () .fsharp |> snd).command |> fst)
+ |> runtime.matches_get_one ((get_args () .fable |> snd).command |> fst)
|> optionm'.unbox
|> optionm.map sm'.from_std_string
@@ -1309,7 +1597,7 @@ inl fs_path = temp_dir > file_name
code |> file_system.write_all_text fs_path
get_command ()
-|> runtime.command_get_matches_from ($'$"_ fsharp -f \\\"{!fs_path}\\\" -c \\\"rust -d regex=\'*\'\\\""' |> runtime.split_args |> resultm.get)
+|> runtime.command_get_matches_from ($'$"_ fable -f \\\"{!fs_path}\\\" -c \\\"rust -d regex=\'*\'\\\""' |> runtime.split_args |> resultm.get)
|> run Verbose
|> async.block_on
|> resultm.unwrap'
@@ -1336,40 +1624,6 @@ disposable |> use |> ignore
#!spiral
-//// test
-///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream
-
-types ()
-
-inl file_name = "test.dib"
-inl code =
- "#!meta\n\n{\"kernelInfo\":{\"defaultKernelName\":\"fsharp\",\"items\":[]}}\n\n#!fsharp\n\n3 - 6\n"
-
-inl temp_dir, disposable =
- (file_name, code)
- |> sm'.format_debug
- |> crypto.hash_text
- |> file_system.create_temp_dir'
-inl path = temp_dir > file_name |> file_system.normalize_path
-
-code
-|> file_system.write_all_text path
-
-get_command ()
-|> runtime.command_get_matches_from ($'$"_ dib -p {!path}"' |> runtime.split_args |> resultm.get)
-|> run Verbose
-|> async.block_on
-|> resultm.unwrap'
-|> __assert_string_contains false "-3 "
-
-$'$"{!path}.html"'
-|> file_system.read_all_text
-|> __assert_string_contains false "\"cell-id=1\""
-
-disposable |> use |> ignore
-
-#!spiral
-
//// test
///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io futures rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream
@@ -1388,7 +1642,7 @@ inl fs_path = temp_dir > file_name
code |> file_system.write_all_text fs_path
get_command ()
-|> runtime.command_get_matches_from ($'$"_ fsharp -f \\\"{!fs_path}\\\" -c \\\"typescript\\\""' |> runtime.split_args |> resultm.get)
+|> runtime.command_get_matches_from ($'$"_ fable -f \\\"{!fs_path}\\\" -c \\\"typescript\\\""' |> runtime.split_args |> resultm.get)
|> run Verbose
|> async.block_on
|> resultm.unwrap'
@@ -1433,7 +1687,7 @@ inl fs_path = temp_dir > file_name
code |> file_system.write_all_text fs_path
get_command ()
-|> runtime.command_get_matches_from ($'$"_ fsharp -f \\\"{!fs_path}\\\" -c \\\"python\\\""' |> runtime.split_args |> resultm.get)
+|> runtime.command_get_matches_from ($'$"_ fable -f \\\"{!fs_path}\\\" -c \\\"python\\\""' |> runtime.split_args |> resultm.get)
|> run Verbose
|> async.block_on
|> resultm.unwrap'
@@ -1458,6 +1712,40 @@ get_command ()
disposable |> use |> ignore
+#!spiral
+
+//// test
+///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream
+
+types ()
+
+inl file_name = "test.dib"
+inl code =
+ "#!meta\n\n{\"kernelInfo\":{\"defaultKernelName\":\"fsharp\",\"items\":[]}}\n\n#!fsharp\n\n3 - 6\n"
+
+inl temp_dir, disposable =
+ (file_name, code)
+ |> sm'.format_debug
+ |> crypto.hash_text
+ |> file_system.create_temp_dir'
+inl path = temp_dir > file_name |> file_system.normalize_path
+
+code
+|> file_system.write_all_text path
+
+get_command ()
+|> runtime.command_get_matches_from ($'$"_ dib -p {!path}"' |> runtime.split_args |> resultm.get)
+|> run Verbose
+|> async.block_on
+|> resultm.unwrap'
+|> __assert_string_contains false "-3 "
+
+$'$"{!path}.html"'
+|> file_system.read_all_text
+|> __assert_string_contains false "\"cell-id=1\""
+
+disposable |> use |> ignore
+
#!markdown
## tests
diff --git a/apps/spiral/builder/spiral_builder.dib.html b/apps/spiral/builder/spiral_builder.dib.html
index 5617ece0..9267ae81 100644
--- a/apps/spiral/builder/spiral_builder.dib.html
+++ b/apps/spiral/builder/spiral_builder.dib.html
@@ -7620,6 +7620,14 @@ get_args¶
inl get_args () =
{
fsharp = "fsharp", {
+ spi_path = "spi-path", 's'
+ }
+ cuda = "cuda", {
+ py_path = "py-path", 'p'
+ env = "env", 'e'
+ deps = "deps", 'd'
+ }
+ fable = "fable", {
fs_path = "fs-path", 'f'
command = "command", 'c'
}
@@ -7627,11 +7635,6 @@ get_args¶
fs_path = "fs-path", 'f'
deps = "deps", 'd'
}
- dib = "dib", {
- path = "path", 'p'
- retries = "retries", 'r'
- working_directory = "working-directory", 'w'
- }
typescript = "typescript", {
fs_path = "fs-path", 'f'
deps = "deps", 'd'
@@ -7640,6 +7643,11 @@ get_args¶
fs_path = "fs-path", 'f'
deps = "deps", 'd'
}
+ dib = "dib", {
+ path = "path", 'p'
+ retries = "retries", 'r'
+ working_directory = "working-directory", 'w'
+ }
}
@@ -7653,7 +7661,7 @@ get_args¶
@@ -7665,6 +7673,33 @@ get_command¶In [ ]:
+union cuda_env =
+ | Pip
+ | Poetry
+
+
+
+
+
+
+
+
+
+
+
+
+get_command¶
+
+
+
+
+
+
+
+
+In [ ]:
+
+
let get_command () =
##"command"
|> runtime.new_command
@@ -7672,20 +7707,20 @@ get_command¶|> runtime.command_subcommand (
##(get_args () .fsharp |> fst)
|> runtime.new_command
- |> runtime.command_init_arg ((get_args () .fsharp |> snd).fs_path) (
+ |> runtime.command_init_arg ((get_args () .fsharp |> snd).spi_path) (
runtime.arg_required true
)
- |> runtime.command_init_arg ((get_args () .fsharp |> snd).command) (
- id
- )
)
|> runtime.command_subcommand (
- ##(get_args () .rust |> fst)
+ ##(get_args () .cuda |> fst)
|> runtime.new_command
- |> runtime.command_init_arg ((get_args () .rust |> snd).fs_path) (
+ |> runtime.command_init_arg ((get_args () .cuda |> snd).py_path) (
runtime.arg_required true
)
- |> runtime.command_init_arg ((get_args () .rust |> snd).deps) (
+ |> runtime.command_init_arg ((get_args () .cuda |> snd).env) (
+ real runtime.arg_union `cuda_env ignore
+ )
+ |> runtime.command_init_arg ((get_args () .cuda |> snd).deps) (
runtime.arg_value_names ;[ ##"NAME"; ##"VERSION" ]
>> runtime.arg_num_args_range (
runtime.new_value_range
@@ -7696,19 +7731,31 @@ get_command¶)
)
|> runtime.command_subcommand (
- ##(get_args () .dib |> fst)
+ ##(get_args () .fable |> fst)
|> runtime.new_command
- |> runtime.command_init_arg ((get_args () .dib |> snd).path) (
+ |> runtime.command_init_arg ((get_args () .fable |> snd).fs_path) (
runtime.arg_required true
- // >> runtime.arg_value_parser (runtime.value_parser_path_buf ())
- )
- |> runtime.command_init_arg ((get_args () .dib |> snd).retries) (
- runtime.arg_value_parser (runtime.value_parser_expr "u8")
)
- |> runtime.command_init_arg ((get_args () .dib |> snd).working_directory) (
+ |> runtime.command_init_arg ((get_args () .fable |> snd).command) (
id
)
)
+ |> runtime.command_subcommand (
+ ##(get_args () .rust |> fst)
+ |> runtime.new_command
+ |> runtime.command_init_arg ((get_args () .rust |> snd).fs_path) (
+ runtime.arg_required true
+ )
+ |> runtime.command_init_arg ((get_args () .rust |> snd).deps) (
+ runtime.arg_value_names ;[ ##"NAME"; ##"VERSION" ]
+ >> runtime.arg_num_args_range (
+ runtime.new_value_range
+ (am'.Start (1i32 |> convert : unativeint))
+ (am'.End id)
+ )
+ >> runtime.arg_action runtime.Append
+ )
+ )
|> runtime.command_subcommand (
##(get_args () .typescript |> fst)
|> runtime.new_command
@@ -7741,23 +7788,48 @@ get_command¶>> runtime.arg_action runtime.Append
)
)
+ |> runtime.command_subcommand (
+ ##(get_args () .dib |> fst)
+ |> runtime.new_command
+ |> runtime.command_init_arg ((get_args () .dib |> snd).path) (
+ runtime.arg_required true
+ // >> runtime.arg_value_parser (runtime.value_parser_path_buf ())
+ )
+ |> runtime.command_init_arg ((get_args () .dib |> snd).retries) (
+ runtime.arg_value_parser (runtime.value_parser_expr "u8")
+ )
+ |> runtime.command_init_arg ((get_args () .dib |> snd).working_directory) (
+ id
+ )
+ )
-
+
+
+
+
+
+
+
+
+execute_dotnet_fable¶
+
+
+
+
@@ -7787,18 +7859,7 @@ execute_dotnet_fable
-
-
-
-
-
-fsharp¶
-
-
-
-
-
+
@@ -7808,7 +7869,7 @@ persist_code_project
+
@@ -7821,7 +7882,7 @@ persist_code_projectinl workspace_root = file_system.get_workspace_root ()
inl target_dir =
- inl target_dir = workspace_root </> "target/polyglot/spiral_builder" </> name
+ inl target_dir = workspace_root </> "target/spiral_builder" </> name
match hash with
| Some hash => target_dir </> "packages" </> hash
| None => target_dir
@@ -7899,7 +7960,7 @@ persist_code_project
+
-
+
-
+
@@ -7962,7 +8023,7 @@ build_code¶
-
+
@@ -7973,7 +8034,7 @@ build_code¶
inl build_code runtime packages modules output_dir name code =
inl fsproj_path = code |> persist_code_project packages modules name None
inl exit_code = fsproj_path |> build_project runtime output_dir
- if exit_code > 0 then
+ if exit_code <>. 0 then
inl fsproj_text = fsproj_path |> file_system.read_all_text
trace Critical
fun () => "build_code"
@@ -7986,7 +8047,7 @@ build_code¶
-
+
@@ -8013,31 +8074,31 @@ build_code¶
-00:00:00 verbose #1 file_system.create_dir / dir: c:\home\git\polyglot\target/polyglot/spiral_builder\test1
-00:00:00 debug #2 build_project / full_path: \\?\C:\home\git\polyglot\target\polyglot\spiral_builder\test1\test1.fsproj
-00:00:00 debug #3 runtime.execute_with_options / file_name: dotnet / arguments: ["publish", "c:/home/git/polyglot/target/polyglot/spiral_builder/test1/test1.fsproj", "--configuration", "Release", "--output", "dist", "--runtime", "win-x64"] / options: (None, "dotnet publish "c:/home/git/polyglot/target/polyglot/spiral_builder/test1/test1.fsproj" --configuration Release --output "dist" --runtime win-x64", Array(MutCell([])), None, None, true, Some("\\?\C:\home\git\polyglot\target\polyglot\spiral_builder\test1"))
+00:00:00 verbose #1 file_system.create_dir / dir: c:\home\git\polyglot\target/spiral_builder\test1
+00:00:00 debug #2 build_project / full_path: \\?\C:\home\git\polyglot\target\spiral_builder\test1\test1.fsproj
+00:00:00 debug #3 runtime.execute_with_options / file_name: dotnet / arguments: ["publish", "c:/home/git/polyglot/target/spiral_builder/test1/test1.fsproj", "--configuration", "Release", "--output", "dist", "--runtime", "win-x64"] / options: (None, "dotnet publish "c:/home/git/polyglot/target/spiral_builder/test1/test1.fsproj" --configuration Release --output "dist" --runtime win-x64", Array(MutCell([])), None, None, true, Some("\\?\C:\home\git\polyglot\target\spiral_builder\test1"))
00:00:00 verbose #4 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
-00:00:00 verbose #5 > Determining projects to restore...
-00:00:01 verbose #6 > Restored c:\home\git\polyglot\target\polyglot\spiral_builder\test1\test1.fsproj (in 335 ms).
-00:00:01 verbose #7 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\home\git\polyglot\target\polyglot\spiral_builder\test1\test1.fsproj]
-00:00:02 verbose #8 > test1 -> c:\home\git\polyglot\target\polyglot\spiral_builder\test1\bin\Release\net9.0\win-x64\test1.dll
-00:00:04 verbose #9 > test1 -> \\?\C:\home\git\polyglot\target\polyglot\spiral_builder\test1\dist\
-00:00:05 verbose #10 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 723
-00:00:05 debug #11 runtime.execute_with_options / file_name: dotnet / arguments: ["publish", "c:/home/git/polyglot/target/polyglot/spiral_builder/test1/test1.fsproj", "--configuration", "Release", "--output", "dist", "--runtime", "linux-x64"] / options: (None, "dotnet publish "c:/home/git/polyglot/target/polyglot/spiral_builder/test1/test1.fsproj" --configuration Release --output "dist" --runtime linux-x64", Array(MutCell([])), None, None, true, Some("\\?\C:\home\git\polyglot\target\polyglot\spiral_builder\test1"))
-00:00:05 verbose #12 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
-00:00:05 verbose #13 > Determining projects to restore...
-00:00:06 verbose #14 > Restored c:\home\git\polyglot\target\polyglot\spiral_builder\test1\test1.fsproj (in 329 ms).
-00:00:06 verbose #15 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\home\git\polyglot\target\polyglot\spiral_builder\test1\test1.fsproj]
-00:00:07 verbose #16 > test1 -> c:\home\git\polyglot\target\polyglot\spiral_builder\test1\bin\Release\net9.0\linux-x64\test1.dll
-00:00:08 verbose #17 > test1 -> \\?\C:\home\git\polyglot\target\polyglot\spiral_builder\test1\dist\
-00:00:08 verbose #18 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 725
+00:00:01 verbose #5 > Determining projects to restore...
+00:00:01 verbose #6 > Restored c:\home\git\polyglot\target\spiral_builder\test1\test1.fsproj (in 461 ms).
+00:00:02 verbose #7 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\home\git\polyglot\target\spiral_builder\test1\test1.fsproj]
+00:00:03 verbose #8 > test1 -> c:\home\git\polyglot\target\spiral_builder\test1\bin\Release\net9.0\win-x64\test1.dll
+00:00:06 verbose #9 > test1 -> \\?\C:\home\git\polyglot\target\spiral_builder\test1\dist\
+00:00:06 verbose #10 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 687
+00:00:06 debug #11 runtime.execute_with_options / file_name: dotnet / arguments: ["publish", "c:/home/git/polyglot/target/spiral_builder/test1/test1.fsproj", "--configuration", "Release", "--output", "dist", "--runtime", "linux-x64"] / options: (None, "dotnet publish "c:/home/git/polyglot/target/spiral_builder/test1/test1.fsproj" --configuration Release --output "dist" --runtime linux-x64", Array(MutCell([])), None, None, true, Some("\\?\C:\home\git\polyglot\target\spiral_builder\test1"))
+00:00:06 verbose #12 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
+00:00:07 verbose #13 > Determining projects to restore...
+00:00:08 verbose #14 > Restored c:\home\git\polyglot\target\spiral_builder\test1\test1.fsproj (in 411 ms).
+00:00:08 verbose #15 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\home\git\polyglot\target\spiral_builder\test1\test1.fsproj]
+00:00:09 verbose #16 > test1 -> c:\home\git\polyglot\target\spiral_builder\test1\bin\Release\net9.0\linux-x64\test1.dll
+00:00:10 verbose #17 > test1 -> \\?\C:\home\git\polyglot\target\spiral_builder\test1\dist\
+00:00:10 verbose #18 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 689
assert_eq / actual: 0 / expected: 0
-
+
@@ -8064,23 +8125,23 @@ build_code¶
-00:00:00 verbose #1 file_system.create_dir / dir: c:\home\git\polyglot\target/polyglot/spiral_builder\test2
-00:00:00 debug #2 build_project / full_path: \\?\C:\home\git\polyglot\target\polyglot\spiral_builder\test2\test2.fsproj
-00:00:00 debug #3 runtime.execute_with_options / file_name: dotnet / arguments: ["publish", "c:/home/git/polyglot/target/polyglot/spiral_builder/test2/test2.fsproj", "--configuration", "Release", "--output", "dist", "--runtime", "win-x64"] / options: (None, "dotnet publish "c:/home/git/polyglot/target/polyglot/spiral_builder/test2/test2.fsproj" --configuration Release --output "dist" --runtime win-x64", Array(MutCell([])), None, None, true, Some("\\?\C:\home\git\polyglot\target\polyglot\spiral_builder\test2"))
+00:00:00 verbose #1 file_system.create_dir / dir: c:\home\git\polyglot\target/spiral_builder\test2
+00:00:00 debug #2 build_project / full_path: \\?\C:\home\git\polyglot\target\spiral_builder\test2\test2.fsproj
+00:00:00 debug #3 runtime.execute_with_options / file_name: dotnet / arguments: ["publish", "c:/home/git/polyglot/target/spiral_builder/test2/test2.fsproj", "--configuration", "Release", "--output", "dist", "--runtime", "win-x64"] / options: (None, "dotnet publish "c:/home/git/polyglot/target/spiral_builder/test2/test2.fsproj" --configuration Release --output "dist" --runtime win-x64", Array(MutCell([])), None, None, true, Some("\\?\C:\home\git\polyglot\target\spiral_builder\test2"))
00:00:00 verbose #4 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
-00:00:00 verbose #5 > Determining projects to restore...
-00:00:01 verbose #6 > Restored c:\home\git\polyglot\target\polyglot\spiral_builder\test2\test2.fsproj (in 328 ms).
-00:00:01 verbose #7 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\home\git\polyglot\target\polyglot\spiral_builder\test2\test2.fsproj]
-00:00:03 verbose #8 > c:\home\git\polyglot\target\polyglot\spiral_builder\test2\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [c:\home\git\polyglot\target\polyglot\spiral_builder\test2\test2.fsproj]
-00:00:03 verbose #9 runtime.execute_with_options / result / exit_code: 1 / std_trace.Length: 743
-00:00:03 debug #10 runtime.execute_with_options / file_name: dotnet / arguments: ["publish", "c:/home/git/polyglot/target/polyglot/spiral_builder/test2/test2.fsproj", "--configuration", "Release", "--output", "dist", "--runtime", "linux-x64"] / options: (None, "dotnet publish "c:/home/git/polyglot/target/polyglot/spiral_builder/test2/test2.fsproj" --configuration Release --output "dist" --runtime linux-x64", Array(MutCell([])), None, None, true, Some("\\?\C:\home\git\polyglot\target\polyglot\spiral_builder\test2"))
-00:00:03 verbose #11 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
-00:00:03 verbose #12 > Determining projects to restore...
-00:00:04 verbose #13 > Restored c:\home\git\polyglot\target\polyglot\spiral_builder\test2\test2.fsproj (in 335 ms).
-00:00:04 verbose #14 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\home\git\polyglot\target\polyglot\spiral_builder\test2\test2.fsproj]
-00:00:06 verbose #15 > c:\home\git\polyglot\target\polyglot\spiral_builder\test2\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [c:\home\git\polyglot\target\polyglot\spiral_builder\test2\test2.fsproj]
-00:00:06 verbose #16 runtime.execute_with_options / result / exit_code: 1 / std_trace.Length: 743
-00:00:06 critical #17 build_code / code: 1 + a |> ignore / fsproj_text: <Project Sdk="Microsoft.NET.Sdk">
+00:00:01 verbose #5 > Determining projects to restore...
+00:00:01 verbose #6 > Restored c:\home\git\polyglot\target\spiral_builder\test2\test2.fsproj (in 444 ms).
+00:00:02 verbose #7 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\home\git\polyglot\target\spiral_builder\test2\test2.fsproj]
+00:00:04 verbose #8 > c:\home\git\polyglot\target\spiral_builder\test2\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [c:\home\git\polyglot\target\spiral_builder\test2\test2.fsproj]
+00:00:04 verbose #9 runtime.execute_with_options / result / exit_code: 1 / std_trace.Length: 707
+00:00:04 debug #10 runtime.execute_with_options / file_name: dotnet / arguments: ["publish", "c:/home/git/polyglot/target/spiral_builder/test2/test2.fsproj", "--configuration", "Release", "--output", "dist", "--runtime", "linux-x64"] / options: (None, "dotnet publish "c:/home/git/polyglot/target/spiral_builder/test2/test2.fsproj" --configuration Release --output "dist" --runtime linux-x64", Array(MutCell([])), None, None, true, Some("\\?\C:\home\git\polyglot\target\spiral_builder\test2"))
+00:00:04 verbose #11 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
+00:00:05 verbose #12 > Determining projects to restore...
+00:00:05 verbose #13 > Restored c:\home\git\polyglot\target\spiral_builder\test2\test2.fsproj (in 406 ms).
+00:00:06 verbose #14 > C:\Users\i574n\scoop\apps\dotnet-sdk-preview\current\sdk\9.0.100-preview.1.24101.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\home\git\polyglot\target\spiral_builder\test2\test2.fsproj]
+00:00:08 verbose #15 > c:\home\git\polyglot\target\spiral_builder\test2\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [c:\home\git\polyglot\target\spiral_builder\test2\test2.fsproj]
+00:00:08 verbose #16 runtime.execute_with_options / result / exit_code: 1 / std_trace.Length: 707
+00:00:08 critical #17 build_code / code: 1 + a |> ignore / fsproj_text: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>preview</LangVersion>
@@ -8107,7 +8168,7 @@ build_code¶
</PropertyGroup>
<ItemGroup>
- <Compile Include="c:/home/git/polyglot/target/polyglot/spiral_builder/test2/test2.fs" />
+ <Compile Include="c:/home/git/polyglot/target/spiral_builder/test2/test2.fs" />
</ItemGroup>
<ItemGroup>
@@ -8120,17 +8181,17 @@ build_code¶
-
-
-
-
+
@@ -8224,7 +8285,7 @@ rust¶
-
+
-
+
-
+
@@ -8309,7 +8370,7 @@ process_rust¶
-
+
@@ -8358,11 +8419,11 @@ process_rust¶
+#. $'$"path = \\\"spiral_builder.{!extension}\\\""'
if cargo_toml_path |> file_system.file_exists |> not
- then empty_cargo_toml_content () |> file_system.write_all_text_exists' cargo_toml_path
+ then empty_cargo_toml_content () |> file_system.write_all_text cargo_toml_path
if workspace_cargo_toml_path |> file_system.file_exists |> not
- then empty_cargo_toml_content () |> file_system.write_all_text_exists' workspace_cargo_toml_path
-
+ then empty_cargo_toml_content () |> file_system.write_all_text workspace_cargo_toml_path
+
inl workspace_root_external = file_system.get_workspace_root_external ()
inl workspace_root = workspace_root_external |> resultm.box |> resultm.unwrap_or_else id
@@ -8580,7 +8641,7 @@ process_rust¶
-
+
@@ -8591,7 +8652,7 @@ dib¶
-
+
@@ -8601,7 +8662,7 @@ process_dib¶
-
+
@@ -8689,7 +8750,7 @@ process_dib¶
-
+
@@ -8700,7 +8761,7 @@ typescript¶
-
+
@@ -8710,7 +8771,7 @@ process_typescript
+
@@ -8933,7 +8994,7 @@ process_typescript
+
@@ -8944,7 +9005,7 @@ python¶
-
+
@@ -8954,7 +9015,7 @@ process_python
+
@@ -9116,17 +9177,28 @@ process_python
+
+
+
+
+
+
+
+
+process_cuda¶
+
+
+
+
@@ -9134,73 +9206,354 @@ run¶
In [ ]:
-let rec run trace_level (matches : runtime.arg_matches) : async.future_pin (resultm.result' string string) =
- fun () =>
- match matches |> runtime.matches_subcommand |> optionm'.unbox with
- | Some (subcommand, arg_matches)
- when (subcommand |> sm'.from_std_string) = (get_args () .fsharp |> fst) =>
+inl process_cuda { py_path env deps } =
+ inl extension = "py"
+
+ inl new_code_path = py_path
+ inl new_code = new_code_path |> file_system.read_all_text
- inl fs_path =
- arg_matches
- |> runtime.matches_get_one ((get_args () .fsharp |> snd).fs_path |> fst)
- |> optionm'.unbox
- |> optionm.value
- |> sm'.from_std_string
+ inl workspace_root_external = file_system.get_workspace_root_external ()
+ inl workspace_root = workspace_root_external |> resultm.box |> resultm.unwrap_or_else id
- inl command =
- arg_matches
- |> runtime.matches_get_one ((get_args () .fsharp |> snd).command |> fst)
- |> optionm'.unbox
- |> optionm.map sm'.from_std_string
+ inl package_dir = new_code_path |> file_system.get_directory_name
+
+ inl manifest_path =
+ match env with
+ | Pip => package_dir </> "requirements.txt"
+ | Poetry => package_dir </> "pyproject.toml"
+
+ inl deps =
+ deps
+ |> am'.vec_map fun dep =>
+ inl dep = dep |> sm'.from_std_string
+ if dep |> sm'.contains "="
+ then dep
+ elif dep |> sm'.ends_with "]"
+ then dep |> sm'.replace "[" $'$"={{version=\'*\',features=["' |> fun x => $'$"{!x}}}"'
+ else $'$"{!dep}=\'*\'"'
+ |> am'.from_vec
+ |> fun x => x : _ i32 _
+ |> seq.of_array'
+ |> sm'.concat "\n"
+
+ inl exit_code, run_result =
+ if deps = ""
+ then 0, ""
+ else
+ inl manifest =
+ match env with
+ | Pip =>
+ deps
+ | Poetry =>
+ $'$"[tool.poetry]"'
+ +#. $'$"name = \\\"test\\\""'
+ +#. $'$"version = \\\"0.0.1\\\""'
+ +#. $'$"description = \\\"\\\""'
+ +#. $'$"authors = []"'
+ +#. $'$""'
+ +#. $'$"[tool.poetry.dependencies]"'
+ +#. $'$"python=\\\"~3.12\\\""'
+ +#. $'$"{!deps}"'
+ +#. $'$""'
+ +#. $'$"[build-system]"'
+ +#. $'$"requires = [\\\"poetry-core\\\"]"'
+ +#. $'$"build-backend = \\\"poetry.core.masonry.api\\\""'
+
+ manifest |> file_system.write_all_text_exists' manifest_path
- inl command_result =
- match command with
- | Some command =>
- get_command ()
- |> runtime.command_get_matches_from (
- $'$"_ {!command} --fs-path \\\"{!fs_path}\\\""' |> runtime.split_args |> resultm.get
- )
- |> run trace_level
- |> async.await
- |> resultm.unwrap'
- | None => "{}"
+ runtime.execution_options fun x => { x with
+ command =
+ match env with
+ | Pip => $'$"pip install -r requirements.txt"'
+ | Poetry => $'$"poetry install"'
+ working_directory = package_dir |> optionm'.some'
+ }
+ |> runtime.execute_with_options
+ if exit_code <>. 0 then
+ trace Critical
+ fun () => "spiral_builder.process_cuda / env install error"
+ fun () => $'$"env: {!env} / exit_code: {!exit_code} / new_code_path: {!new_code_path} / run_result: {!run_result}"'
+ { extension = Some extension; code = None; output = None }
+ else
+ inl command =
+ match env with
+ | Pip => $'$"python \\\"{!new_code_path}\\\""'
+ | Poetry => $'$"poetry run python \\\"{!new_code_path}\\\""'
+ inl environment_variables =
;[
- "command_result",
- command_result
+ "TRACE_LEVEL", "Verbose"
]
+ inl exit_code, run_result =
+ runtime.execution_options fun x => { x with
+ command
+ environment_variables
+ working_directory = package_dir |> optionm'.some'
+ }
+ |> runtime.execute_with_options
- | Some (subcommand, arg_matches)
- when (subcommand |> sm'.from_std_string) = (get_args () .dib |> fst) =>
-
- inl path =
- arg_matches
- |> runtime.matches_get_one ((get_args () .dib |> snd).path |> fst)
- |> optionm'.map'' (
- sm'.from_std_string
- >> file_system.absolute_path
- )
+ inl external_command =
+ inl vars =
+ a environment_variables
+ |> am.map fun k, v => $'$"$env:{!k}=\'\'{!v}\'\'"' : string
+ |> fun x => x : _ i32 _
+ |> seq.of_array
+ |> sm'.concat ";"
+ $'$"pwsh -c \'{!vars}; {!command}\'"' : string
+ if exit_code = 0 then
+ inl output =
+ try
+ fun () =>
+ run_result
+ |> sm'.split "\n"
+ |> fun x => a x : _ i32 _
+ |> seq.of_array
+ |> sm'.concat "\n"
+ fun ex =>
+ trace Critical
+ fun () => "spiral_builder.process_cuda / Exception"
+ fun () => $'$"ex: {!ex} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result} / {!_locals ()}"'
+ None
+ |> optionm'.box
|> optionm'.unwrap
- inl retries =
- arg_matches
- |> runtime.matches_get_one ((get_args () .dib |> snd).retries |> fst)
- |> optionm'.default_value' 1u8
-
- inl working_directory : optionm'.option' string =
- arg_matches
- |> runtime.matches_get_one ((get_args () .dib |> snd).working_directory |> fst)
-
- process_dib { path retries working_directory }
-
- | matches =>
- match matches with
- | Some (subcommand, arg_matches)
- when (subcommand |> sm'.from_std_string) = (get_args () .rust |> fst) =>
-
- inl fs_path =
- arg_matches
- |> runtime.matches_get_one ((get_args () .rust |> snd).fs_path |> fst)
+ { extension = Some extension; code = Some new_code; output = Some output }
+ else
+ trace Critical
+ fun () => "spiral_builder.process_cuda / error"
+ fun () => $'$"exit_code: {!exit_code} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result}"'
+ { extension = Some extension; code = None; output = None }
+
+
+
+
+
+
+
+
+
+
+
+
+fsharp¶
+
+
+
+
+
+
+
+
+
+
+process_fsharp¶
+
+
+
+
+
+
+
+
+In [ ]:
+
+
+inl process_fsharp { spi_path } =
+ inl extension = "fsx"
+
+ inl new_code_path = spi_path
+ inl new_code = new_code_path |> file_system.read_all_text
+
+ inl workspace_root_external = file_system.get_workspace_root_external ()
+ inl workspace_root = workspace_root_external |> resultm.box |> resultm.unwrap_or_else id
+
+ inl supervisor_path = workspace_root </> $"apps/spiral/dist/Supervisor!(runtime.get_executable_suffix ())"
+ inl code_dir = new_code_path |> file_system.get_directory_name
+ inl file_name = new_code_path |> file_system.get_file_name_without_extension
+ inl output_path = code_dir </> $'$"{!file_name}.{!extension}"'
+ inl command = $'$"{!supervisor_path} --build-file \\\"{!new_code_path}\\\" \\\"{!output_path}\\\""'
+ inl environment_variables =
+ ;[
+ "TRACE_LEVEL", "Verbose"
+ ]
+ inl exit_code, run_result =
+ runtime.execution_options fun x => { x with
+ command
+ environment_variables
+ working_directory = workspace_root_external |> resultm.box |> resultm.ok'
+ }
+ |> runtime.execute_with_options
+
+ inl external_command =
+ inl vars =
+ a environment_variables
+ |> am.map fun k, v => $'$"$env:{!k}=\'\'{!v}\'\'"' : string
+ |> fun x => x : _ i32 _
+ |> seq.of_array
+ |> sm'.concat ";"
+ $'$"pwsh -c \'{!vars}; {!command}\'"' : string
+ if exit_code = 0 then
+ inl output =
+ try
+ fun () =>
+ run_result
+ |> sm'.split "\n"
+ |> fun x => a x : _ i32 _
+ |> seq.of_array
+ |> sm'.concat "\n"
+ fun ex =>
+ trace Critical
+ fun () => "spiral_builder.process_fsharp / Exception"
+ fun () => $'$"ex: {!ex} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result} / {!_locals ()}"'
+ None
+ |> optionm'.box
+ |> optionm'.unwrap
+
+ { extension = Some extension; code = Some new_code; output = Some output }
+ else
+ trace Critical
+ fun () => "spiral_builder.process_fsharp / error"
+ fun () => $'$"exit_code: {!exit_code} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result}"'
+ { extension = Some extension; code = None; output = None }
+
+
+
+
+
+
+
+
+
+
+
+
+run¶
+
+
+
+
+
+
+
+
+In [ ]:
+
+
+let rec run trace_level (matches : runtime.arg_matches) : async.future_pin (resultm.result' string string) =
+ fun () =>
+ match matches |> runtime.matches_subcommand |> optionm'.unbox with
+ | Some (subcommand, arg_matches)
+ when (subcommand |> sm'.from_std_string) = (get_args () .cuda |> fst) =>
+
+ inl py_path =
+ arg_matches
+ |> runtime.matches_get_one ((get_args () .cuda |> snd).py_path |> fst)
+ |> optionm'.unbox
+ |> optionm.value
+ |> sm'.from_std_string
+
+ inl env =
+ arg_matches
+ |> runtime.matches_get_one ((get_args () .cuda |> snd).env |> fst)
+ |> optionm'.unbox
+ |> optionm.map (
+ sm'.from_std_string
+ >> reflection.union_try_pick
+ )
+ |> optionm'.flatten
+ |> optionm'.default_value Pip
+
+ inl deps : am'.vec sm'.std_string =
+ arg_matches
+ |> runtime.matches_get_many ((get_args () .cuda |> snd).deps |> fst)
+ |> optionm'.unbox
+ |> optionm'.default_value (;[] |> am'.to_vec)
+
+ inl command_result =
+ process_cuda { py_path env deps }
+ |> fun { extension code output } =>
+ ;[
+ "extension", extension |> optionm'.default_value ""
+ "code", code |> optionm'.default_value ""
+ "output", output |> optionm'.default_value ""
+ ]
+
+ ;[
+ "command_result",
+ command_result
+ |> am'.to_vec
+ |> am'.vec_map' fun k, v =>
+ new_pair (sm'.to_std_string k) (sm'.to_std_string v)
+ |> mapm.b_tree_map_from_vec_pairs
+ |> sm'.serialize
+ |> resultm.unwrap'
+ |> sm'.from_std_string
+ ]
+
+ | Some (subcommand, arg_matches)
+ when (subcommand |> sm'.from_std_string) = (get_args () .fable |> fst) =>
+
+ inl fs_path =
+ arg_matches
+ |> runtime.matches_get_one ((get_args () .fable |> snd).fs_path |> fst)
+ |> optionm'.unbox
+ |> optionm.value
+ |> sm'.from_std_string
+
+ inl command =
+ arg_matches
+ |> runtime.matches_get_one ((get_args () .fable |> snd).command |> fst)
+ |> optionm'.unbox
+ |> optionm.map sm'.from_std_string
+
+ inl command_result =
+ match command with
+ | Some command =>
+ get_command ()
+ |> runtime.command_get_matches_from (
+ $'$"_ {!command} --fs-path \\\"{!fs_path}\\\""' |> runtime.split_args |> resultm.get
+ )
+ |> run trace_level
+ |> async.await
+ |> resultm.unwrap'
+ | None => "{}"
+
+ ;[
+ "command_result",
+ command_result
+ ]
+
+ | Some (subcommand, arg_matches)
+ when (subcommand |> sm'.from_std_string) = (get_args () .dib |> fst) =>
+
+ inl path =
+ arg_matches
+ |> runtime.matches_get_one ((get_args () .dib |> snd).path |> fst)
+ |> optionm'.map'' (
+ sm'.from_std_string
+ >> file_system.absolute_path
+ )
+ |> optionm'.unwrap
+
+ inl retries =
+ arg_matches
+ |> runtime.matches_get_one ((get_args () .dib |> snd).retries |> fst)
+ |> optionm'.default_value' 1u8
+
+ inl working_directory : optionm'.option' string =
+ arg_matches
+ |> runtime.matches_get_one ((get_args () .dib |> snd).working_directory |> fst)
+
+ process_dib { path retries working_directory }
+
+ | matches =>
+ match matches with
+ | Some (subcommand, arg_matches)
+ when (subcommand |> sm'.from_std_string) = (get_args () .rust |> fst) =>
+
+ inl fs_path =
+ arg_matches
+ |> runtime.matches_get_one ((get_args () .rust |> snd).fs_path |> fst)
|> optionm'.unbox
|> optionm.value
|> sm'.from_std_string
@@ -9275,7 +9628,7 @@ run¶
-
+
@@ -9301,7 +9654,7 @@ run¶
code |> file_system.write_all_text fs_path
get_command ()
-|> runtime.command_get_matches_from ($'$"_ fsharp -f \\\"{!fs_path}\\\" -c \\\"rust -d regex=\'*\'\\\""' |> runtime.split_args |> resultm.get)
+|> runtime.command_get_matches_from ($'$"_ fable -f \\\"{!fs_path}\\\" -c \\\"rust -d regex=\'*\'\\\""' |> runtime.split_args |> resultm.get)
|> run Verbose
|> async.block_on
|> resultm.unwrap'
@@ -9337,42 +9690,30 @@ run¶
-00:00:00 verbose #1 file_system.create_dir / dir: C:\Users\i574n\AppData\Local\Temp\!create_temp_path_\spiral_builder_1031b725dff0ef2ac6d4ae07936cffd40a2b1ad2af9ed3f7f1776949ab19173f\c6422374-71e4-07d4-0ba4-c3084b24fbba
-00:00:00 verbose #2 file_system.create_dir / dir: c:\home\git\polyglot\target/polyglot/spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892
-00:00:00 verbose #3 file_system.create_dir / dir: c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\fable_modules
-00:00:00 debug #4 runtime.execute_with_options / file_name: dotnet / arguments: ["fable", "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892/spiral_builder.fsproj", "--optimize", "--lang", "rs", "--extension", ".rs", "--outDir", "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892", "--define", "_WINDOWS"] / options: (None, "dotnet fable "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892/spiral_builder.fsproj" --optimize --lang rs --extension .rs --outDir "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892" --define _WINDOWS", Array(MutCell([])), None, None, true, None)
-00:00:00 verbose #5 > Fable 4.17.0: F# to Rust compiler (status: alpha)
-00:00:00 verbose #6 >
-00:00:00 verbose #7 > Thanks to the contributor! @zaaack
-00:00:00 verbose #8 > Stand with Ukraine! https://standwithukraine.com.ua
-00:00:00 verbose #9 >
-00:00:00 verbose #10 > Parsing ..\..\..\target\polyglot\spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\spiral_builder.fsproj...
-00:00:00 verbose #11 > ..\..\..\target\polyglot\spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892> cmd /C dotnet restore spiral_builder.fable-temp.csproj -p:FABLE_COMPILER=true -p:FABLE_COMPILER_4=true -p:FABLE_COMPILER_RUST=true -p:_WINDOWS=true
-00:00:01 verbose #12 > Determining projects to restore...
-00:00:02 verbose #13 > Restored C:\home\git\polyglot\target\polyglot\spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\spiral_builder.fable-temp.csproj (in 1.12 sec).
-00:00:05 verbose #14 > ..\..\..\target\polyglot\spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892> cmd /C dotnet restore C:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892/spiral_builder.fsproj
-00:00:05 verbose #15 > Determining projects to restore...
-00:00:07 verbose #16 > Restored C:\home\git\polyglot\target\polyglot\spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\spiral_builder.fsproj (in 1.13 sec).
-00:00:08 verbose #17 > Project and references (1 source files) parsed in 7785ms
-00:00:08 verbose #18 >
-00:00:09 verbose #19 > Started Fable compilation...
-00:00:10 verbose #20 >
-00:00:10 verbose #21 > Fable compilation finished in 1323ms
-00:00:10 verbose #22 >
-00:00:10 verbose #23 > .\..\..\..\target\polyglot\spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\spiral_builder.fs(1,1): 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!
-00:00:10 verbose #24 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 1811
-00:00:10 debug #25 runtime.execute_with_options / file_name: cargo / arguments: ["fmt", "--manifest-path", "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\Cargo.toml", "--"] / options: (None, "cargo fmt --manifest-path "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\Cargo.toml" --", Array(MutCell([])), None, None, true, None)
-00:00:10 verbose #26 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 0
-00:00:10 debug #27 runtime.execute_with_options / file_name: cargo / arguments: ["+nightly", "run", "--manifest-path", "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\Cargo.toml"] / options: (None, "cargo +nightly run --manifest-path "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\Cargo.toml"", Array(MutCell([("TRACE_LEVEL", "Verbose"), ("RUSTC_WRAPPER", "sccache"), ("RUSTFLAGS", "-C prefer-dynamic")])), None, None, true, None)
-00:00:11 verbose #28 ! Locking 1 package to latest compatible version
-00:00:11 verbose #29 ! Adding spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892 v0.0.1 (C:\home\git\polyglot\target\polyglot\spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892)
-00:00:11 verbose #30 ! Compiling fable_library_rust v0.1.0 (C:\home\git\polyglot\lib\rust\fable\fable_modules\fable-library-rust)
-00:00:13 verbose #31 ! Compiling spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892 v0.0.1 (C:\home\git\polyglot\target\polyglot\spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892)
-00:00:13 verbose #32 ! Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.52s
-00:00:13 verbose #33 ! Running `c:\home\git\polyglot\target\polyglot\spiral_builder\spiral_builder\target\debug\spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.exe`
-00:00:13 verbose #34 > -3
-00:00:13 verbose #35 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 961
-00:00:13 verbose #36 spiral_builder.process_rust / cleanup: UH3_1("c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\../..\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.d", true, UH3_1("c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\../..\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.exe", true, UH3_1("c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\../..\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.pdb", true, UH3_1("c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\../..\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892", false, UH3_0))))
+00:00:00 verbose #1 file_system.create_dir / dir: C:\Users\i574n\AppData\Local\Temp\!create_temp_path_\spiral_builder_6e61566468b7f3be495bfb26e5387253967bdc549bab13be897a2f1e6e3fb26e\c6422374-71e4-07d4-0ba4-c3084b24fbba
+00:00:00 verbose #2 file_system.create_dir / dir: c:\home\git\polyglot\target/spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892
+00:00:00 debug #3 runtime.execute_with_options / file_name: dotnet / arguments: ["fable", "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892/spiral_builder.fsproj", "--optimize", "--lang", "rs", "--extension", ".rs", "--outDir", "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892", "--define", "_WINDOWS"] / options: (None, "dotnet fable "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892/spiral_builder.fsproj" --optimize --lang rs --extension .rs --outDir "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892" --define _WINDOWS", Array(MutCell([])), None, None, true, None)
+00:00:00 verbose #4 > Fable 4.17.0: F# to Rust compiler (status: alpha)
+00:00:00 verbose #5 >
+00:00:00 verbose #6 > Thanks to the contributor! @alfonsogarciacaro
+00:00:00 verbose #7 > Stand with Ukraine! https://standwithukraine.com.ua
+00:00:00 verbose #8 >
+00:00:00 verbose #9 > Parsing ..\..\..\target\spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\spiral_builder.fsproj...
+00:00:01 verbose #10 > Retrieving project options from cache, in case of issues run `dotnet fable clean` or try `--noCache` option.
+00:00:01 verbose #11 > Project and references (1 source files) parsed in 227ms
+00:00:01 verbose #12 >
+00:00:01 verbose #13 > Skipped compilation because all generated files are up-to-date!
+00:00:01 verbose #14 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 533
+00:00:01 debug #15 runtime.execute_with_options / file_name: cargo / arguments: ["fmt", "--manifest-path", "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\Cargo.toml", "--"] / options: (None, "cargo fmt --manifest-path "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\Cargo.toml" --", Array(MutCell([])), None, None, true, None)
+00:00:01 verbose #16 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 0
+00:00:01 debug #17 runtime.execute_with_options / file_name: cargo / arguments: ["+nightly", "run", "--manifest-path", "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\Cargo.toml"] / options: (None, "cargo +nightly run --manifest-path "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\Cargo.toml"", Array(MutCell([("TRACE_LEVEL", "Verbose"), ("RUSTC_WRAPPER", "sccache"), ("RUSTFLAGS", "-C prefer-dynamic")])), None, None, true, None)
+00:00:02 verbose #18 ! Compiling fable_library_rust v0.1.0 (C:\home\git\polyglot\lib\rust\fable\fable_modules\fable-library-rust)
+00:00:04 verbose #19 ! Compiling spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892 v0.0.1 (C:\home\git\polyglot\target\spiral_builder\spiral_builder\packages\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892)
+00:00:05 verbose #20 ! Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.57s
+00:00:05 verbose #21 ! Running `c:\home\git\polyglot\target\spiral_builder\spiral_builder\target\debug\spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.exe`
+00:00:05 verbose #22 > -3
+00:00:05 verbose #23 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 628
+00:00:05 verbose #24 spiral_builder.process_rust / cleanup: UH3_1("c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\../..\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.d", true, UH3_1("c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\../..\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.exe", true, UH3_1("c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\../..\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.pdb", true, UH3_1("c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\../..\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892", false, UH3_0))))
assert_eq / actual: "rs" / expected: "rs"
assert_eq / actual: "-3" / expected: "-3"
@@ -9380,7 +9721,7 @@ run¶
-
+
@@ -9389,34 +9730,45 @@ run¶
//// test
-///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream
+///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io futures rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream
types ()
-inl file_name = "test.dib"
-inl code =
- "#!meta\n\n{\"kernelInfo\":{\"defaultKernelName\":\"fsharp\",\"items\":[]}}\n\n#!fsharp\n\n3 - 6\n"
+inl code = "3 - 6 |> System.Console.WriteLine\n"
+inl file_name = "main.fs"
inl temp_dir, disposable =
(file_name, code)
|> sm'.format_debug
|> crypto.hash_text
|> file_system.create_temp_dir'
-inl path = temp_dir </> file_name |> file_system.normalize_path
+inl fs_path = temp_dir </> file_name
-code
-|> file_system.write_all_text path
+code |> file_system.write_all_text fs_path
get_command ()
-|> runtime.command_get_matches_from ($'$"_ dib -p {!path}"' |> runtime.split_args |> resultm.get)
+|> runtime.command_get_matches_from ($'$"_ fable -f \\\"{!fs_path}\\\" -c \\\"typescript\\\""' |> runtime.split_args |> resultm.get)
|> run Verbose
|> async.block_on
|> resultm.unwrap'
-|> __assert_string_contains false "<pre>-3 "
-
-$'$"{!path}.html"'
-|> file_system.read_all_text
-|> __assert_string_contains false "\"cell-id=1\""
+|> sm'.deserialize
+|> resultm.unwrap'
+|> mapm.get ("command_result" |> sm'.to_std_string)
+|> optionm'.unwrap
+|> sm'.from_std_string
+|> sm'.deserialize
+|> resultm.unwrap'
+|> fun result =>
+ result
+ |> mapm.get ("extension" |> sm'.to_std_string)
+ |> optionm'.unwrap
+ |> sm'.from_std_string
+ |> _assert_eq "ts"
+ result
+ |> mapm.get ("output" |> sm'.to_std_string)
+ |> optionm'.unwrap
+ |> sm'.from_std_string
+ |> _assert_eq "-3"
disposable |> use |> ignore
@@ -9431,100 +9783,34 @@ run¶
-00:00:00 verbose #1 file_system.create_dir / dir: C:\Users\i574n\AppData\Local\Temp\!create_temp_path_\spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8\af524e22-8e9a-5d18-99ed-bd86e1b74623
-00:00:00 debug #2 runtime.execute_with_options / file_name: dotnet / arguments: ["repl", "--exit-after-run", "--run", "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib", "--output-path", "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb"] / options: (None, "dotnet repl --exit-after-run --run "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib" --output-path "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb"", Array(MutCell([("TRACE_LEVEL", "Verbose"), ("AUTOMATION", "True")])), None, None, false, None)
->
-> ── fsharp ──────────────────────────────────────────────────────────────────────
-> 3 - 6
->
-> ── fsharp - import ─────────────────────────────────────────────────────────────
-> #r
-> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.A
-> spNetCore.Html.Abstractions.dll"
-> #r
-> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D
-> otNet.Interactive.dll"
-> #r
-> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D
-> otNet.Interactive.FSharp.dll"
-> #r
-> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D
-> otNet.Interactive.Formatting.dll"
-> open System
-> open System.IO
-> open System.Text
-> open Microsoft.DotNet.Interactive.Formatting
->
-> ── fsharp - import ─────────────────────────────────────────────────────────────
-> #r
-> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D
-> otNet.Interactive.FSharp.dll"
-> open Microsoft.DotNet.Interactive.FSharp.FSharpKernelHelpers
-> #r
-> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D
-> otNet.Interactive.dll"
-> open type Microsoft.DotNet.Interactive.Kernel
->
-> ── fsharp - import ─────────────────────────────────────────────────────────────
-> Formatter.Register(fun(x: obj)(writer: TextWriter)->fprintfn writer "%120A" x)
->
-> ── fsharp - import ─────────────────────────────────────────────────────────────
-> Formatter.Register(fun(x: System.Collections.IEnumerable)(writer:
-> TextWriter)->fprintfn writer "%120A" x)
->
-> ╭─[ 4.29s - return value ]─────────────────────────────────────────────────────╮
-> │ <div class="dni-plaintext"><pre>-3 │
-> │ </pre></div><style> │
-> │ .dni-code-hint { │
-> │ font-style: italic; │
-> │ overflow: hidden; │
-> │ white-space: nowrap; │
-> │ } │
-> │ .dni-treeview { │
-> │ white-space: nowrap; │
-> │ } │
-> │ .dni-treeview td { │
-> │ vertical-align: top; │
-> │ text-align: start; │
-> │ } │
-> │ details.dni-treeview { │
-> │ padding-left: 1em; │
-> │ } │
-> │ table td { │
-> │ text-align: start; │
-> │ } │
-> │ table tr { │
-> │ vertical-align: top; │
-> │ margin: 0em 0px; │
-> │ } │
-> │ table tr td pre │
-> │ { │
-> │ vertical-align: top !important; │
-> │ margin: 0em 0px !important; │
-> │ } │
-> │ table th { │
-> │ text-align: start; │
-> │ } │
-> │ </style> │
-> ╰──────────────────────────────────────────────────────────────────────────────╯
-00:00:06 verbose #3 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 4316
-00:00:06 debug #4 runtime.execute_with_options / file_name: jupyter / arguments: ["nbconvert", "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb", "--to", "html", "--HTMLExporter.theme=dark"] / options: (None, "jupyter nbconvert "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb" --to html --HTMLExporter.theme=dark", Array(MutCell([])), None, None, true, None)
-00:00:08 verbose #5 ! [NbConvertApp] Converting notebook c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb to html
-00:00:08 verbose #6 ! C:\Users\i574n\scoop\apps\python\current\Lib\site-packages\nbformat\__init__.py:93: MissingIDFieldWarning: Code 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:08 verbose #7 ! validate(nb)
-00:00:09 verbose #8 ! [NbConvertApp] Writing 271490 bytes to c:\Users\i574n\AppData\Local\Temp\!create_temp_path_\spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8\af524e22-8e9a-5d18-99ed-bd86e1b74623\test.dib.html
-00:00:09 verbose #9 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 915
-00:00:09 debug #10 spiral_builder.run / dib / jupyter nbconvert / exit_code: 0 / jupyter_result.Length: 915
-00:00:09 debug #11 runtime.execute_with_options / file_name: pwsh / arguments: ["-c", "$counter = 1; $path = 'c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.html'; (Get-Content $path -Raw) -replace '(id=\\\"cell-id=)[a-fA-F0-9]{8}', { $_.Groups[1].Value + $counter++ } | Set-Content $path"] / options: (None, "pwsh -c "$counter = 1; $path = 'c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.html'; (Get-Content $path -Raw) -replace '(id=\"cell-id=)[a-fA-F0-9]{8}', { $_.Groups[1].Value + $counter++ } | Set-Content $path"", Array(MutCell([])), None, None, true, None)
-00:00:10 verbose #12 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 0
-00:00:10 debug #13 spiral_builder.run / dib / html cell ids / exit_code: 0 / pwsh_replace_html_result.Length: 0
-00:00:10 debug #14 spiral_builder.run / dib / exit_code: 0 / result.Length: 5290
+00:00:00 verbose #1 file_system.create_dir / dir: C:\Users\i574n\AppData\Local\Temp\!create_temp_path_\spiral_builder_69bad1f34c1f4debd82e31f261a7a9631f44027e2c9c5291f147860456d046fd\c6422374-71e4-07d4-0ba4-c3084b24fbba
+00:00:00 verbose #2 file_system.create_dir / dir: c:\home\git\polyglot\target/spiral_builder\spiral_builder\packages\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8
+00:00:00 debug #3 spiral_builder.process_typescript / version: US39_1
+00:00:00 debug #4 runtime.execute_with_options / file_name: dotnet / arguments: ["fable", "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8/spiral_builder.fsproj", "--optimize", "--lang", "ts", "--extension", ".ts", "--outDir", "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8", "--define", "_WINDOWS"] / options: (None, "dotnet fable "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8/spiral_builder.fsproj" --optimize --lang ts --extension .ts --outDir "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8" --define _WINDOWS", Array(MutCell([])), None, None, true, None)
+00:00:00 verbose #5 > Fable 4.17.0: F# to TypeScript compiler
+00:00:00 verbose #6 > Minimum @fable-org/fable-library-ts version (when installed from npm): 1.4.0
+00:00:00 verbose #7 >
+00:00:00 verbose #8 > Thanks to the contributor! @stroborobo
+00:00:00 verbose #9 > Stand with Ukraine! https://standwithukraine.com.ua
+00:00:00 verbose #10 >
+00:00:00 verbose #11 > Parsing ..\..\..\target\spiral_builder\spiral_builder\packages\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\spiral_builder.fsproj...
+00:00:01 verbose #12 > Retrieving project options from cache, in case of issues run `dotnet fable clean` or try `--noCache` option.
+00:00:01 verbose #13 > Project and references (1 source files) parsed in 248ms
+00:00:01 verbose #14 >
+00:00:01 verbose #15 > Skipped compilation because all generated files are up-to-date!
+00:00:01 verbose #16 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 593
+00:00:01 debug #17 spiral_builder.process_typescript / new_code_path: c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\spiral_builder.ts
+00:00:01 debug #18 runtime.execute_with_options / file_name: bun / arguments: ["run", "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\spiral_builder.ts"] / options: (None, "bun run "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\spiral_builder.ts"", Array(MutCell([("TRACE_LEVEL", "Verbose")])), None, None, true, None)
+00:00:01 verbose #19 > -3
+00:00:01 verbose #20 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 2
+assert_eq / actual: "ts" / expected: "ts"
+assert_eq / actual: "-3" / expected: "-3"
-
+
@@ -9537,8 +9823,8 @@ run¶
types ()
-inl code = "3 - 6 |> System.Console.WriteLine\n"
inl file_name = "main.fs"
+inl code = "3 - 6 |> System.Console.WriteLine\n"
inl temp_dir, disposable =
(file_name, code)
@@ -9550,7 +9836,7 @@ run¶
code |> file_system.write_all_text fs_path
get_command ()
-|> runtime.command_get_matches_from ($'$"_ fsharp -f \\\"{!fs_path}\\\" -c \\\"typescript\\\""' |> runtime.split_args |> resultm.get)
+|> runtime.command_get_matches_from ($'$"_ fable -f \\\"{!fs_path}\\\" -c \\\"python\\\""' |> runtime.split_args |> resultm.get)
|> run Verbose
|> async.block_on
|> resultm.unwrap'
@@ -9566,7 +9852,7 @@ run¶
|> mapm.get ("extension" |> sm'.to_std_string)
|> optionm'.unwrap
|> sm'.from_std_string
- |> _assert_eq "ts"
+ |> _assert_eq "py"
result
|> mapm.get ("output" |> sm'.to_std_string)
|> optionm'.unwrap
@@ -9586,42 +9872,32 @@ run¶
-00:00:00 verbose #1 file_system.create_dir / dir: C:\Users\i574n\AppData\Local\Temp\!create_temp_path_\spiral_builder_27533e216e0c3886a81aaa645ed7c3a89181214acc7bc6495fe9ce06e11a1c1f\c6422374-71e4-07d4-0ba4-c3084b24fbba
-00:00:00 verbose #2 file_system.create_dir / dir: c:\home\git\polyglot\target/polyglot/spiral_builder\spiral_builder\packages\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8
-00:00:00 debug #3 spiral_builder.process_typescript / version: US35_1
-00:00:00 debug #4 runtime.execute_with_options / file_name: dotnet / arguments: ["fable", "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8/spiral_builder.fsproj", "--optimize", "--lang", "ts", "--extension", ".ts", "--outDir", "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8", "--define", "_WINDOWS"] / options: (None, "dotnet fable "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8/spiral_builder.fsproj" --optimize --lang ts --extension .ts --outDir "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8" --define _WINDOWS", Array(MutCell([])), None, None, true, None)
-00:00:00 verbose #5 > Fable 4.17.0: F# to TypeScript compiler
-00:00:00 verbose #6 > Minimum @fable-org/fable-library-ts version (when installed from npm): 1.4.0
-00:00:00 verbose #7 >
-00:00:00 verbose #8 > Thanks to the contributor! @dgchurchill
-00:00:00 verbose #9 > Stand with Ukraine! https://standwithukraine.com.ua
-00:00:00 verbose #10 >
-00:00:00 verbose #11 > Parsing ..\..\..\target\polyglot\spiral_builder\spiral_builder\packages\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\spiral_builder.fsproj...
-00:00:00 verbose #12 > ..\..\..\target\polyglot\spiral_builder\spiral_builder\packages\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8> cmd /C dotnet restore spiral_builder.fable-temp.csproj -p:FABLE_COMPILER=true -p:FABLE_COMPILER_4=true -p:FABLE_COMPILER_TYPESCRIPT=true -p:_WINDOWS=true
-00:00:01 verbose #13 > Determining projects to restore...
-00:00:02 verbose #14 > Restored C:\home\git\polyglot\target\polyglot\spiral_builder\spiral_builder\packages\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\spiral_builder.fable-temp.csproj (in 1.12 sec).
-00:00:04 verbose #15 > ..\..\..\target\polyglot\spiral_builder\spiral_builder\packages\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8> cmd /C dotnet restore C:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8/spiral_builder.fsproj
-00:00:05 verbose #16 > Determining projects to restore...
-00:00:07 verbose #17 > Restored C:\home\git\polyglot\target\polyglot\spiral_builder\spiral_builder\packages\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\spiral_builder.fsproj (in 1.14 sec).
-00:00:07 verbose #18 > Project and references (1 source files) parsed in 7062ms
-00:00:07 verbose #19 >
-00:00:08 verbose #20 > Started Fable compilation...
-00:00:09 verbose #21 >
-00:00:09 verbose #22 > Fable compilation finished in 1286ms
-00:00:09 verbose #23 >
-00:00:09 verbose #24 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 1561
-00:00:09 debug #25 spiral_builder.process_typescript / new_code_path: c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\spiral_builder.ts
-00:00:09 debug #26 runtime.execute_with_options / file_name: bun / arguments: ["run", "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\spiral_builder.ts"] / options: (None, "bun run "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\spiral_builder.ts"", Array(MutCell([("TRACE_LEVEL", "Verbose")])), None, None, true, None)
-00:00:10 verbose #27 > -3
-00:00:10 verbose #28 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 2
-assert_eq / actual: "ts" / expected: "ts"
+00:00:00 verbose #1 file_system.create_dir / dir: C:\Users\i574n\AppData\Local\Temp\!create_temp_path_\spiral_builder_e1253471353f8348fca628165c2439fb8aba4f7776e68e5d96fad295f4046f69\c6422374-71e4-07d4-0ba4-c3084b24fbba
+00:00:00 verbose #2 file_system.create_dir / dir: c:\home\git\polyglot\target/spiral_builder\spiral_builder\packages\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce
+00:00:00 debug #3 runtime.execute_with_options / file_name: dotnet / arguments: ["fable", "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce/spiral_builder.fsproj", "--optimize", "--lang", "py", "--extension", ".py", "--outDir", "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce", "--define", "_WINDOWS"] / options: (None, "dotnet fable "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce/spiral_builder.fsproj" --optimize --lang py --extension .py --outDir "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce" --define _WINDOWS", Array(MutCell([])), None, None, true, None)
+00:00:00 verbose #4 > Fable 4.17.0: F# to Python compiler (status: beta)
+00:00:00 verbose #5 >
+00:00:00 verbose #6 > Thanks to the contributor! @ncave
+00:00:00 verbose #7 > Stand with Ukraine! https://standwithukraine.com.ua
+00:00:00 verbose #8 >
+00:00:00 verbose #9 > Parsing ..\..\..\target\spiral_builder\spiral_builder\packages\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\spiral_builder.fsproj...
+00:00:01 verbose #10 > Retrieving project options from cache, in case of issues run `dotnet fable clean` or try `--noCache` option.
+00:00:01 verbose #11 > Project and references (1 source files) parsed in 308ms
+00:00:01 verbose #12 >
+00:00:01 verbose #13 > Skipped compilation because all generated files are up-to-date!
+00:00:01 verbose #14 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 522
+00:00:01 debug #15 spiral_builder.process_python / new_code_path: c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\spiral_builder.py
+00:00:01 debug #16 runtime.execute_with_options / file_name: python / arguments: ["c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\spiral_builder.py"] / options: (None, "python "c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\spiral_builder.py"", Array(MutCell([("TRACE_LEVEL", "Verbose")])), None, None, true, None)
+00:00:01 verbose #17 > -3
+00:00:01 verbose #18 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 2
+assert_eq / actual: "py" / expected: "py"
assert_eq / actual: "-3" / expected: "-3"
-
+
@@ -9630,45 +9906,34 @@ run¶
//// test
-///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io futures rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream
+///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream
types ()
-inl file_name = "main.fs"
-inl code = "3 - 6 |> System.Console.WriteLine\n"
+inl file_name = "test.dib"
+inl code =
+ "#!meta\n\n{\"kernelInfo\":{\"defaultKernelName\":\"fsharp\",\"items\":[]}}\n\n#!fsharp\n\n3 - 6\n"
inl temp_dir, disposable =
(file_name, code)
|> sm'.format_debug
|> crypto.hash_text
|> file_system.create_temp_dir'
-inl fs_path = temp_dir </> file_name
+inl path = temp_dir </> file_name |> file_system.normalize_path
-code |> file_system.write_all_text fs_path
+code
+|> file_system.write_all_text path
get_command ()
-|> runtime.command_get_matches_from ($'$"_ fsharp -f \\\"{!fs_path}\\\" -c \\\"python\\\""' |> runtime.split_args |> resultm.get)
+|> runtime.command_get_matches_from ($'$"_ dib -p {!path}"' |> runtime.split_args |> resultm.get)
|> run Verbose
|> async.block_on
|> resultm.unwrap'
-|> sm'.deserialize
-|> resultm.unwrap'
-|> mapm.get ("command_result" |> sm'.to_std_string)
-|> optionm'.unwrap
-|> sm'.from_std_string
-|> sm'.deserialize
-|> resultm.unwrap'
-|> fun result =>
- result
- |> mapm.get ("extension" |> sm'.to_std_string)
- |> optionm'.unwrap
- |> sm'.from_std_string
- |> _assert_eq "py"
- result
- |> mapm.get ("output" |> sm'.to_std_string)
- |> optionm'.unwrap
- |> sm'.from_std_string
- |> _assert_eq "-3"
+|> __assert_string_contains false "<pre>-3 "
+
+$'$"{!path}.html"'
+|> file_system.read_all_text
+|> __assert_string_contains false "\"cell-id=1\""
disposable |> use |> ignore
@@ -9683,42 +9948,101 @@ run¶
-00:00:00 verbose #1 file_system.create_dir / dir: C:\Users\i574n\AppData\Local\Temp\!create_temp_path_\spiral_builder_3d09353ec45356208cfccf2a829270e4593baf0e19246944759dd82403cb47f0\c6422374-71e4-07d4-0ba4-c3084b24fbba
-00:00:00 verbose #2 file_system.create_dir / dir: c:\home\git\polyglot\target/polyglot/spiral_builder\spiral_builder\packages\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce
-00:00:00 verbose #3 file_system.create_dir / dir: c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\fable_modules
-00:00:00 debug #4 runtime.execute_with_options / file_name: dotnet / arguments: ["fable", "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce/spiral_builder.fsproj", "--optimize", "--lang", "py", "--extension", ".py", "--outDir", "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce", "--define", "_WINDOWS"] / options: (None, "dotnet fable "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce/spiral_builder.fsproj" --optimize --lang py --extension .py --outDir "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce" --define _WINDOWS", Array(MutCell([])), None, None, true, None)
-00:00:00 verbose #5 > Fable 4.17.0: F# to Python compiler (status: beta)
-00:00:00 verbose #6 >
-00:00:00 verbose #7 > Thanks to the contributor! @psfblair
-00:00:00 verbose #8 > Stand with Ukraine! https://standwithukraine.com.ua
-00:00:00 verbose #9 >
-00:00:00 verbose #10 > Parsing ..\..\..\target\polyglot\spiral_builder\spiral_builder\packages\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\spiral_builder.fsproj...
-00:00:00 verbose #11 > ..\..\..\target\polyglot\spiral_builder\spiral_builder\packages\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce> cmd /C dotnet restore spiral_builder.fable-temp.csproj -p:FABLE_COMPILER=true -p:FABLE_COMPILER_4=true -p:FABLE_COMPILER_PYTHON=true -p:_WINDOWS=true
-00:00:01 verbose #12 > Determining projects to restore...
-00:00:03 verbose #13 > Restored C:\home\git\polyglot\target\polyglot\spiral_builder\spiral_builder\packages\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\spiral_builder.fable-temp.csproj (in 1.53 sec).
-00:00:05 verbose #14 > ..\..\..\target\polyglot\spiral_builder\spiral_builder\packages\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce> cmd /C dotnet restore C:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce/spiral_builder.fsproj
-00:00:06 verbose #15 > Determining projects to restore...
-00:00:07 verbose #16 > Restored C:\home\git\polyglot\target\polyglot\spiral_builder\spiral_builder\packages\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\spiral_builder.fsproj (in 1.1 sec).
-00:00:08 verbose #17 > Project and references (1 source files) parsed in 7604ms
-00:00:08 verbose #18 >
-00:00:08 verbose #19 > Started Fable compilation...
-00:00:10 verbose #20 >
-00:00:10 verbose #21 > Fable compilation finished in 1326ms
-00:00:10 verbose #22 >
-00:00:10 verbose #23 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 1487
-00:00:10 debug #24 spiral_builder.process_python / new_code_path: c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\spiral_builder.py
-00:00:10 debug #25 runtime.execute_with_options / file_name: python / arguments: ["c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\spiral_builder.py"] / options: (None, "python "c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\spiral_builder.py"", Array(MutCell([("TRACE_LEVEL", "Verbose")])), None, None, true, None)
-00:00:10 verbose #26 > -3
-00:00:10 verbose #27 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 2
-assert_eq / actual: "py" / expected: "py"
-assert_eq / actual: "-3" / expected: "-3"
+00:00:00 verbose #1 file_system.create_dir / dir: C:\Users\i574n\AppData\Local\Temp\!create_temp_path_\spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc\af524e22-8e9a-5d18-99ed-bd86e1b74623
+00:00:00 debug #2 runtime.execute_with_options / file_name: dotnet / arguments: ["repl", "--exit-after-run", "--run", "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib", "--output-path", "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb"] / options: (None, "dotnet repl --exit-after-run --run "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib" --output-path "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb"", Array(MutCell([("TRACE_LEVEL", "Verbose"), ("AUTOMATION", "True")])), None, None, false, None)
+>
+> ── fsharp ──────────────────────────────────────────────────────────────────────
+> 3 - 6
+>
+> ── fsharp - import ─────────────────────────────────────────────────────────────
+> #r
+> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.A
+> spNetCore.Html.Abstractions.dll"
+> #r
+> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D
+> otNet.Interactive.dll"
+> #r
+> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D
+> otNet.Interactive.FSharp.dll"
+> #r
+> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D
+> otNet.Interactive.Formatting.dll"
+> open System
+> open System.IO
+> open System.Text
+> open Microsoft.DotNet.Interactive.Formatting
+>
+> ── fsharp - import ─────────────────────────────────────────────────────────────
+> #r
+> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D
+> otNet.Interactive.FSharp.dll"
+> open Microsoft.DotNet.Interactive.FSharp.FSharpKernelHelpers
+> #r
+> "C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D
+> otNet.Interactive.dll"
+> open type Microsoft.DotNet.Interactive.Kernel
+>
+> ── fsharp - import ─────────────────────────────────────────────────────────────
+> Formatter.Register(fun(x: obj)(writer: TextWriter)->fprintfn writer "%120A" x)
+>
+> ── fsharp - import ─────────────────────────────────────────────────────────────
+> Formatter.Register(fun(x: System.Collections.IEnumerable)(writer:
+> TextWriter)->fprintfn writer "%120A" x)
+>
+> ╭─[ 5.53s - return value ]─────────────────────────────────────────────────────╮
+> │ <div class="dni-plaintext"><pre>-3 │
+> │ </pre></div><style> │
+> │ .dni-code-hint { │
+> │ font-style: italic; │
+> │ overflow: hidden; │
+> │ white-space: nowrap; │
+> │ } │
+> │ .dni-treeview { │
+> │ white-space: nowrap; │
+> │ } │
+> │ .dni-treeview td { │
+> │ vertical-align: top; │
+> │ text-align: start; │
+> │ } │
+> │ details.dni-treeview { │
+> │ padding-left: 1em; │
+> │ } │
+> │ table td { │
+> │ text-align: start; │
+> │ } │
+> │ table tr { │
+> │ vertical-align: top; │
+> │ margin: 0em 0px; │
+> │ } │
+> │ table tr td pre │
+> │ { │
+> │ vertical-align: top !important; │
+> │ margin: 0em 0px !important; │
+> │ } │
+> │ table th { │
+> │ text-align: start; │
+> │ } │
+> │ </style> │
+> ╰──────────────────────────────────────────────────────────────────────────────╯
+00:00:08 verbose #3 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 4316
+00:00:08 debug #4 runtime.execute_with_options / file_name: jupyter / arguments: ["nbconvert", "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb", "--to", "html", "--HTMLExporter.theme=dark"] / options: (None, "jupyter nbconvert "c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb" --to html --HTMLExporter.theme=dark", Array(MutCell([])), None, None, true, None)
+00:00:11 verbose #5 ! [NbConvertApp] Converting notebook c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb to html
+00:00:11 verbose #6 ! C:\Users\i574n\scoop\apps\python\current\Lib\site-packages\nbformat\__init__.py:93: MissingIDFieldWarning: Code 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:11 verbose #7 ! validate(nb)
+00:00:12 verbose #8 ! [NbConvertApp] Writing 271490 bytes to c:\Users\i574n\AppData\Local\Temp\!create_temp_path_\spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc\af524e22-8e9a-5d18-99ed-bd86e1b74623\test.dib.html
+00:00:12 verbose #9 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 915
+00:00:12 debug #10 spiral_builder.run / dib / jupyter nbconvert / exit_code: 0 / jupyter_result.Length: 915
+00:00:12 debug #11 runtime.execute_with_options / file_name: pwsh / arguments: ["-c", "$counter = 1; $path = 'c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.html'; (Get-Content $path -Raw) -replace '(id=\\\"cell-id=)[a-fA-F0-9]{8}', { $_.Groups[1].Value + $counter++ } | Set-Content $path"] / options: (None, "pwsh -c "$counter = 1; $path = 'c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.html'; (Get-Content $path -Raw) -replace '(id=\"cell-id=)[a-fA-F0-9]{8}', { $_.Groups[1].Value + $counter++ } | Set-Content $path"", Array(MutCell([])), None, None, true, None)
+00:00:14 verbose #12 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 0
+00:00:14 debug #13 spiral_builder.run / dib / html cell ids / exit_code: 0 / pwsh_replace_html_result.Length: 0
+00:00:14 debug #14 spiral_builder.run / dib / exit_code: 0 / result.Length: 5290
-
+
@@ -9728,7 +10052,7 @@ tests¶
-
+
@@ -9747,7 +10071,7 @@ tests¶
-
+
@@ -9757,7 +10081,7 @@ main¶
-
+
diff --git a/apps/spiral/builder/spiral_builder.dib.ipynb b/apps/spiral/builder/spiral_builder.dib.ipynb
index 8411af34..a848be29 100644
--- a/apps/spiral/builder/spiral_builder.dib.ipynb
+++ b/apps/spiral/builder/spiral_builder.dib.ipynb
@@ -95,6 +95,14 @@
"inl get_args () =\n",
" {\n",
" fsharp = \"fsharp\", {\n",
+ " spi_path = \"spi-path\", 's'\n",
+ " }\n",
+ " cuda = \"cuda\", {\n",
+ " py_path = \"py-path\", 'p'\n",
+ " env = \"env\", 'e'\n",
+ " deps = \"deps\", 'd'\n",
+ " }\n",
+ " fable = \"fable\", {\n",
" fs_path = \"fs-path\", 'f'\n",
" command = \"command\", 'c'\n",
" }\n",
@@ -102,11 +110,6 @@
" fs_path = \"fs-path\", 'f'\n",
" deps = \"deps\", 'd'\n",
" }\n",
- " dib = \"dib\", {\n",
- " path = \"path\", 'p'\n",
- " retries = \"retries\", 'r'\n",
- " working_directory = \"working-directory\", 'w'\n",
- " }\n",
" typescript = \"typescript\", {\n",
" fs_path = \"fs-path\", 'f'\n",
" deps = \"deps\", 'd'\n",
@@ -115,9 +118,39 @@
" fs_path = \"fs-path\", 'f'\n",
" deps = \"deps\", 'd'\n",
" }\n",
+ " dib = \"dib\", {\n",
+ " path = \"path\", 'p'\n",
+ " retries = \"retries\", 'r'\n",
+ " working_directory = \"working-directory\", 'w'\n",
+ " }\n",
" }"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## cuda_env"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "dotnet_interactive": {
+ "language": "spiral"
+ },
+ "polyglot_notebook": {
+ "kernelName": "spiral"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "union cuda_env =\n",
+ " | Pip\n",
+ " | Poetry"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -145,20 +178,20 @@
" |> runtime.command_subcommand (\n",
" ##(get_args () .fsharp |> fst)\n",
" |> runtime.new_command\n",
- " |> runtime.command_init_arg ((get_args () .fsharp |> snd).fs_path) (\n",
+ " |> runtime.command_init_arg ((get_args () .fsharp |> snd).spi_path) (\n",
" runtime.arg_required true\n",
" )\n",
- " |> runtime.command_init_arg ((get_args () .fsharp |> snd).command) (\n",
- " id\n",
- " )\n",
" )\n",
" |> runtime.command_subcommand (\n",
- " ##(get_args () .rust |> fst)\n",
+ " ##(get_args () .cuda |> fst)\n",
" |> runtime.new_command\n",
- " |> runtime.command_init_arg ((get_args () .rust |> snd).fs_path) (\n",
+ " |> runtime.command_init_arg ((get_args () .cuda |> snd).py_path) (\n",
" runtime.arg_required true\n",
" )\n",
- " |> runtime.command_init_arg ((get_args () .rust |> snd).deps) (\n",
+ " |> runtime.command_init_arg ((get_args () .cuda |> snd).env) (\n",
+ " real runtime.arg_union `cuda_env ignore\n",
+ " )\n",
+ " |> runtime.command_init_arg ((get_args () .cuda |> snd).deps) (\n",
" runtime.arg_value_names ;[ ##\"NAME\"; ##\"VERSION\" ]\n",
" >> runtime.arg_num_args_range (\n",
" runtime.new_value_range\n",
@@ -169,20 +202,32 @@
" )\n",
" )\n",
" |> runtime.command_subcommand (\n",
- " ##(get_args () .dib |> fst)\n",
+ " ##(get_args () .fable |> fst)\n",
" |> runtime.new_command\n",
- " |> runtime.command_init_arg ((get_args () .dib |> snd).path) (\n",
+ " |> runtime.command_init_arg ((get_args () .fable |> snd).fs_path) (\n",
" runtime.arg_required true\n",
- " // >> runtime.arg_value_parser (runtime.value_parser_path_buf ())\n",
- " )\n",
- " |> runtime.command_init_arg ((get_args () .dib |> snd).retries) (\n",
- " runtime.arg_value_parser (runtime.value_parser_expr \"u8\")\n",
" )\n",
- " |> runtime.command_init_arg ((get_args () .dib |> snd).working_directory) (\n",
+ " |> runtime.command_init_arg ((get_args () .fable |> snd).command) (\n",
" id\n",
" )\n",
" )\n",
" |> runtime.command_subcommand (\n",
+ " ##(get_args () .rust |> fst)\n",
+ " |> runtime.new_command\n",
+ " |> runtime.command_init_arg ((get_args () .rust |> snd).fs_path) (\n",
+ " runtime.arg_required true\n",
+ " )\n",
+ " |> runtime.command_init_arg ((get_args () .rust |> snd).deps) (\n",
+ " runtime.arg_value_names ;[ ##\"NAME\"; ##\"VERSION\" ]\n",
+ " >> runtime.arg_num_args_range (\n",
+ " runtime.new_value_range\n",
+ " (am'.Start (1i32 |> convert : unativeint))\n",
+ " (am'.End id)\n",
+ " )\n",
+ " >> runtime.arg_action runtime.Append\n",
+ " )\n",
+ " )\n",
+ " |> runtime.command_subcommand (\n",
" ##(get_args () .typescript |> fst)\n",
" |> runtime.new_command\n",
" |> runtime.command_init_arg ((get_args () .typescript |> snd).fs_path) (\n",
@@ -213,6 +258,20 @@
" )\n",
" >> runtime.arg_action runtime.Append\n",
" )\n",
+ " )\n",
+ " |> runtime.command_subcommand (\n",
+ " ##(get_args () .dib |> fst)\n",
+ " |> runtime.new_command\n",
+ " |> runtime.command_init_arg ((get_args () .dib |> snd).path) (\n",
+ " runtime.arg_required true\n",
+ " // >> runtime.arg_value_parser (runtime.value_parser_path_buf ())\n",
+ " )\n",
+ " |> runtime.command_init_arg ((get_args () .dib |> snd).retries) (\n",
+ " runtime.arg_value_parser (runtime.value_parser_expr \"u8\")\n",
+ " )\n",
+ " |> runtime.command_init_arg ((get_args () .dib |> snd).working_directory) (\n",
+ " id\n",
+ " )\n",
" )"
]
},
@@ -220,7 +279,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## execute_dotnet_fable"
+ "## fable"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### execute_dotnet_fable"
]
},
{
@@ -254,13 +320,6 @@
" |> retry_fn' 3u8"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## fsharp"
- ]
- },
{
"cell_type": "markdown",
"metadata": {},
@@ -286,7 +345,7 @@
"\n",
" inl workspace_root = file_system.get_workspace_root ()\n",
" inl target_dir =\n",
- " inl target_dir = workspace_root > \"target/polyglot/spiral_builder\" > name\n",
+ " inl target_dir = workspace_root > \"target/spiral_builder\" > name\n",
" match hash with\n",
" | Some hash => target_dir > \"packages\" > hash\n",
" | None => target_dir\n",
@@ -434,7 +493,7 @@
"inl build_code runtime packages modules output_dir name code =\n",
" inl fsproj_path = code |> persist_code_project packages modules name None\n",
" inl exit_code = fsproj_path |> build_project runtime output_dir\n",
- " if exit_code > 0 then\n",
+ " if exit_code <>. 0 then\n",
" inl fsproj_text = fsproj_path |> file_system.read_all_text\n",
" trace Critical\n",
" fun () => \"build_code\"\n",
@@ -459,24 +518,24 @@
{
"data": {
"text/plain": [
- "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: c:\\home\\git\\polyglot\\target/polyglot/spiral_builder\\test1\n",
- "00:00:00 \u001B[94m debug\u001B[39m #2 build_project / full_path: \\\\?\\C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\\test1.fsproj\n",
- "00:00:00 \u001B[94m debug\u001B[39m #3 runtime.execute_with_options / file_name: dotnet / arguments: [\"publish\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/test1/test1.fsproj\", \"--configuration\", \"Release\", \"--output\", \"dist\", \"--runtime\", \"win-x64\"] / options: (None, \"dotnet publish \"c:/home/git/polyglot/target/polyglot/spiral_builder/test1/test1.fsproj\" --configuration Release --output \"dist\" --runtime win-x64\", Array(MutCell([])), None, None, true, Some(\"\\\\?\\C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\"))\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: c:\\home\\git\\polyglot\\target/spiral_builder\\test1\n",
+ "00:00:00 \u001B[94m debug\u001B[39m #2 build_project / full_path: \\\\?\\C:\\home\\git\\polyglot\\target\\spiral_builder\\test1\\test1.fsproj\n",
+ "00:00:00 \u001B[94m debug\u001B[39m #3 runtime.execute_with_options / file_name: dotnet / arguments: [\"publish\", \"c:/home/git/polyglot/target/spiral_builder/test1/test1.fsproj\", \"--configuration\", \"Release\", \"--output\", \"dist\", \"--runtime\", \"win-x64\"] / options: (None, \"dotnet publish \"c:/home/git/polyglot/target/spiral_builder/test1/test1.fsproj\" --configuration Release --output \"dist\" --runtime win-x64\", Array(MutCell([])), None, None, true, Some(\"\\\\?\\C:\\home\\git\\polyglot\\target\\spiral_builder\\test1\"))\n",
"00:00:00 \u001B[90mverbose\u001B[39m #4 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #5 > Determining projects to restore...\n",
- "00:00:01 \u001B[90mverbose\u001B[39m #6 > Restored c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\\test1.fsproj (in 335 ms).\n",
- "00:00:01 \u001B[90mverbose\u001B[39m #7 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\\test1.fsproj]\n",
- "00:00:02 \u001B[90mverbose\u001B[39m #8 > test1 -> c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\\bin\\Release\\net9.0\\win-x64\\test1.dll\n",
- "00:00:04 \u001B[90mverbose\u001B[39m #9 > test1 -> \\\\?\\C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\\dist\\\n",
- "00:00:05 \u001B[90mverbose\u001B[39m #10 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 723\n",
- "00:00:05 \u001B[94m debug\u001B[39m #11 runtime.execute_with_options / file_name: dotnet / arguments: [\"publish\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/test1/test1.fsproj\", \"--configuration\", \"Release\", \"--output\", \"dist\", \"--runtime\", \"linux-x64\"] / options: (None, \"dotnet publish \"c:/home/git/polyglot/target/polyglot/spiral_builder/test1/test1.fsproj\" --configuration Release --output \"dist\" --runtime linux-x64\", Array(MutCell([])), None, None, true, Some(\"\\\\?\\C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\"))\n",
- "00:00:05 \u001B[90mverbose\u001B[39m #12 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
- "00:00:05 \u001B[90mverbose\u001B[39m #13 > Determining projects to restore...\n",
- "00:00:06 \u001B[90mverbose\u001B[39m #14 > Restored c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\\test1.fsproj (in 329 ms).\n",
- "00:00:06 \u001B[90mverbose\u001B[39m #15 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\\test1.fsproj]\n",
- "00:00:07 \u001B[90mverbose\u001B[39m #16 > test1 -> c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\\bin\\Release\\net9.0\\linux-x64\\test1.dll\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #17 > test1 -> \\\\?\\C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test1\\dist\\\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #18 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 725\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #5 > Determining projects to restore...\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #6 > Restored c:\\home\\git\\polyglot\\target\\spiral_builder\\test1\\test1.fsproj (in 461 ms).\n",
+ "00:00:02 \u001B[90mverbose\u001B[39m #7 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\\home\\git\\polyglot\\target\\spiral_builder\\test1\\test1.fsproj]\n",
+ "00:00:03 \u001B[90mverbose\u001B[39m #8 > test1 -> c:\\home\\git\\polyglot\\target\\spiral_builder\\test1\\bin\\Release\\net9.0\\win-x64\\test1.dll\n",
+ "00:00:06 \u001B[90mverbose\u001B[39m #9 > test1 -> \\\\?\\C:\\home\\git\\polyglot\\target\\spiral_builder\\test1\\dist\\\n",
+ "00:00:06 \u001B[90mverbose\u001B[39m #10 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 687\n",
+ "00:00:06 \u001B[94m debug\u001B[39m #11 runtime.execute_with_options / file_name: dotnet / arguments: [\"publish\", \"c:/home/git/polyglot/target/spiral_builder/test1/test1.fsproj\", \"--configuration\", \"Release\", \"--output\", \"dist\", \"--runtime\", \"linux-x64\"] / options: (None, \"dotnet publish \"c:/home/git/polyglot/target/spiral_builder/test1/test1.fsproj\" --configuration Release --output \"dist\" --runtime linux-x64\", Array(MutCell([])), None, None, true, Some(\"\\\\?\\C:\\home\\git\\polyglot\\target\\spiral_builder\\test1\"))\n",
+ "00:00:06 \u001B[90mverbose\u001B[39m #12 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
+ "00:00:07 \u001B[90mverbose\u001B[39m #13 > Determining projects to restore...\n",
+ "00:00:08 \u001B[90mverbose\u001B[39m #14 > Restored c:\\home\\git\\polyglot\\target\\spiral_builder\\test1\\test1.fsproj (in 411 ms).\n",
+ "00:00:08 \u001B[90mverbose\u001B[39m #15 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\\home\\git\\polyglot\\target\\spiral_builder\\test1\\test1.fsproj]\n",
+ "00:00:09 \u001B[90mverbose\u001B[39m #16 > test1 -> c:\\home\\git\\polyglot\\target\\spiral_builder\\test1\\bin\\Release\\net9.0\\linux-x64\\test1.dll\n",
+ "00:00:10 \u001B[90mverbose\u001B[39m #17 > test1 -> \\\\?\\C:\\home\\git\\polyglot\\target\\spiral_builder\\test1\\dist\\\n",
+ "00:00:10 \u001B[90mverbose\u001B[39m #18 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 689\n",
"assert_eq / actual: 0 / expected: 0\n"
]
},
@@ -509,23 +568,23 @@
{
"data": {
"text/plain": [
- "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: c:\\home\\git\\polyglot\\target/polyglot/spiral_builder\\test2\n",
- "00:00:00 \u001B[94m debug\u001B[39m #2 build_project / full_path: \\\\?\\C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\\test2.fsproj\n",
- "00:00:00 \u001B[94m debug\u001B[39m #3 runtime.execute_with_options / file_name: dotnet / arguments: [\"publish\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/test2/test2.fsproj\", \"--configuration\", \"Release\", \"--output\", \"dist\", \"--runtime\", \"win-x64\"] / options: (None, \"dotnet publish \"c:/home/git/polyglot/target/polyglot/spiral_builder/test2/test2.fsproj\" --configuration Release --output \"dist\" --runtime win-x64\", Array(MutCell([])), None, None, true, Some(\"\\\\?\\C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\"))\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: c:\\home\\git\\polyglot\\target/spiral_builder\\test2\n",
+ "00:00:00 \u001B[94m debug\u001B[39m #2 build_project / full_path: \\\\?\\C:\\home\\git\\polyglot\\target\\spiral_builder\\test2\\test2.fsproj\n",
+ "00:00:00 \u001B[94m debug\u001B[39m #3 runtime.execute_with_options / file_name: dotnet / arguments: [\"publish\", \"c:/home/git/polyglot/target/spiral_builder/test2/test2.fsproj\", \"--configuration\", \"Release\", \"--output\", \"dist\", \"--runtime\", \"win-x64\"] / options: (None, \"dotnet publish \"c:/home/git/polyglot/target/spiral_builder/test2/test2.fsproj\" --configuration Release --output \"dist\" --runtime win-x64\", Array(MutCell([])), None, None, true, Some(\"\\\\?\\C:\\home\\git\\polyglot\\target\\spiral_builder\\test2\"))\n",
"00:00:00 \u001B[90mverbose\u001B[39m #4 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #5 > Determining projects to restore...\n",
- "00:00:01 \u001B[90mverbose\u001B[39m #6 > Restored c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\\test2.fsproj (in 328 ms).\n",
- "00:00:01 \u001B[90mverbose\u001B[39m #7 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\\test2.fsproj]\n",
- "00:00:03 \u001B[90mverbose\u001B[39m #8 > c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\\test2.fsproj]\n",
- "00:00:03 \u001B[90mverbose\u001B[39m #9 runtime.execute_with_options / result / exit_code: 1 / std_trace.Length: 743\n",
- "00:00:03 \u001B[94m debug\u001B[39m #10 runtime.execute_with_options / file_name: dotnet / arguments: [\"publish\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/test2/test2.fsproj\", \"--configuration\", \"Release\", \"--output\", \"dist\", \"--runtime\", \"linux-x64\"] / options: (None, \"dotnet publish \"c:/home/git/polyglot/target/polyglot/spiral_builder/test2/test2.fsproj\" --configuration Release --output \"dist\" --runtime linux-x64\", Array(MutCell([])), None, None, true, Some(\"\\\\?\\C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\"))\n",
- "00:00:03 \u001B[90mverbose\u001B[39m #11 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
- "00:00:03 \u001B[90mverbose\u001B[39m #12 > Determining projects to restore...\n",
- "00:00:04 \u001B[90mverbose\u001B[39m #13 > Restored c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\\test2.fsproj (in 335 ms).\n",
- "00:00:04 \u001B[90mverbose\u001B[39m #14 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\\test2.fsproj]\n",
- "00:00:06 \u001B[90mverbose\u001B[39m #15 > c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\test2\\test2.fsproj]\n",
- "00:00:06 \u001B[90mverbose\u001B[39m #16 runtime.execute_with_options / result / exit_code: 1 / std_trace.Length: 743\n",
- "00:00:06 \u001B[91mcritical\u001B[39m #17 build_code / code: 1 + a |> ignore / fsproj_text: \n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #5 > Determining projects to restore...\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #6 > Restored c:\\home\\git\\polyglot\\target\\spiral_builder\\test2\\test2.fsproj (in 444 ms).\n",
+ "00:00:02 \u001B[90mverbose\u001B[39m #7 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\\home\\git\\polyglot\\target\\spiral_builder\\test2\\test2.fsproj]\n",
+ "00:00:04 \u001B[90mverbose\u001B[39m #8 > c:\\home\\git\\polyglot\\target\\spiral_builder\\test2\\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [c:\\home\\git\\polyglot\\target\\spiral_builder\\test2\\test2.fsproj]\n",
+ "00:00:04 \u001B[90mverbose\u001B[39m #9 runtime.execute_with_options / result / exit_code: 1 / std_trace.Length: 707\n",
+ "00:00:04 \u001B[94m debug\u001B[39m #10 runtime.execute_with_options / file_name: dotnet / arguments: [\"publish\", \"c:/home/git/polyglot/target/spiral_builder/test2/test2.fsproj\", \"--configuration\", \"Release\", \"--output\", \"dist\", \"--runtime\", \"linux-x64\"] / options: (None, \"dotnet publish \"c:/home/git/polyglot/target/spiral_builder/test2/test2.fsproj\" --configuration Release --output \"dist\" --runtime linux-x64\", Array(MutCell([])), None, None, true, Some(\"\\\\?\\C:\\home\\git\\polyglot\\target\\spiral_builder\\test2\"))\n",
+ "00:00:04 \u001B[90mverbose\u001B[39m #11 > MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET\n",
+ "00:00:05 \u001B[90mverbose\u001B[39m #12 > Determining projects to restore...\n",
+ "00:00:05 \u001B[90mverbose\u001B[39m #13 > Restored c:\\home\\git\\polyglot\\target\\spiral_builder\\test2\\test2.fsproj (in 406 ms).\n",
+ "00:00:06 \u001B[90mverbose\u001B[39m #14 > C:\\Users\\i574n\\scoop\\apps\\dotnet-sdk-preview\\current\\sdk\\9.0.100-preview.1.24101.2\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(313,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [c:\\home\\git\\polyglot\\target\\spiral_builder\\test2\\test2.fsproj]\n",
+ "00:00:08 \u001B[90mverbose\u001B[39m #15 > c:\\home\\git\\polyglot\\target\\spiral_builder\\test2\\test2.fs(1,5): error FS0039: The value or constructor 'a' is not defined. [c:\\home\\git\\polyglot\\target\\spiral_builder\\test2\\test2.fsproj]\n",
+ "00:00:08 \u001B[90mverbose\u001B[39m #16 runtime.execute_with_options / result / exit_code: 1 / std_trace.Length: 707\n",
+ "00:00:08 \u001B[91mcritical\u001B[39m #17 build_code / code: 1 + a |> ignore / fsproj_text: \n",
"\n",
" net9.0 \n",
" preview \n",
@@ -552,7 +611,7 @@
" \n",
"\n",
" \n",
- " \n",
+ " \n",
" \n",
"\n",
" \n",
@@ -579,7 +638,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## read_file"
+ "### read_file"
]
},
{
@@ -611,7 +670,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## persist_file"
+ "### persist_file"
]
},
{
@@ -638,7 +697,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## build_file"
+ "### build_file"
]
},
{
@@ -801,11 +860,11 @@
" +#. $'$\"path = \\\\\\\"spiral_builder.{!extension}\\\\\\\"\"'\n",
"\n",
" if cargo_toml_path |> file_system.file_exists |> not\n",
- " then empty_cargo_toml_content () |> file_system.write_all_text_exists' cargo_toml_path\n",
+ " then empty_cargo_toml_content () |> file_system.write_all_text cargo_toml_path\n",
"\n",
" if workspace_cargo_toml_path |> file_system.file_exists |> not\n",
- " then empty_cargo_toml_content () |> file_system.write_all_text_exists' workspace_cargo_toml_path\n",
- " \n",
+ " then empty_cargo_toml_content () |> file_system.write_all_text workspace_cargo_toml_path\n",
+ "\n",
" inl workspace_root_external = file_system.get_workspace_root_external ()\n",
" inl workspace_root = workspace_root_external |> resultm.box |> resultm.unwrap_or_else id\n",
"\n",
@@ -1537,6 +1596,238 @@
" { extension = Some extension; code = None; output = None }"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## cuda"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### process_cuda"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "dotnet_interactive": {
+ "language": "spiral"
+ },
+ "polyglot_notebook": {
+ "kernelName": "spiral"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "inl process_cuda { py_path env deps } =\n",
+ " inl extension = \"py\"\n",
+ " \n",
+ " inl new_code_path = py_path\n",
+ " inl new_code = new_code_path |> file_system.read_all_text\n",
+ "\n",
+ " inl workspace_root_external = file_system.get_workspace_root_external ()\n",
+ " inl workspace_root = workspace_root_external |> resultm.box |> resultm.unwrap_or_else id\n",
+ "\n",
+ " inl package_dir = new_code_path |> file_system.get_directory_name\n",
+ "\n",
+ " inl manifest_path =\n",
+ " match env with\n",
+ " | Pip => package_dir > \"requirements.txt\"\n",
+ " | Poetry => package_dir > \"pyproject.toml\"\n",
+ "\n",
+ " inl deps =\n",
+ " deps\n",
+ " |> am'.vec_map fun dep =>\n",
+ " inl dep = dep |> sm'.from_std_string\n",
+ " if dep |> sm'.contains \"=\"\n",
+ " then dep\n",
+ " elif dep |> sm'.ends_with \"]\"\n",
+ " then dep |> sm'.replace \"[\" $'$\"={{version=\\'*\\',features=[\"' |> fun x => $'$\"{!x}}}\"'\n",
+ " else $'$\"{!dep}=\\'*\\'\"'\n",
+ " |> am'.from_vec\n",
+ " |> fun x => x : _ i32 _\n",
+ " |> seq.of_array'\n",
+ " |> sm'.concat \"\\n\"\n",
+ " \n",
+ " inl exit_code, run_result =\n",
+ " if deps = \"\"\n",
+ " then 0, \"\"\n",
+ " else\n",
+ " inl manifest =\n",
+ " match env with\n",
+ " | Pip =>\n",
+ " deps\n",
+ " | Poetry =>\n",
+ " $'$\"[tool.poetry]\"'\n",
+ " +#. $'$\"name = \\\\\\\"test\\\\\\\"\"'\n",
+ " +#. $'$\"version = \\\\\\\"0.0.1\\\\\\\"\"'\n",
+ " +#. $'$\"description = \\\\\\\"\\\\\\\"\"'\n",
+ " +#. $'$\"authors = []\"'\n",
+ " +#. $'$\"\"'\n",
+ " +#. $'$\"[tool.poetry.dependencies]\"'\n",
+ " +#. $'$\"python=\\\\\\\"~3.12\\\\\\\"\"'\n",
+ " +#. $'$\"{!deps}\"'\n",
+ " +#. $'$\"\"'\n",
+ " +#. $'$\"[build-system]\"'\n",
+ " +#. $'$\"requires = [\\\\\\\"poetry-core\\\\\\\"]\"'\n",
+ " +#. $'$\"build-backend = \\\\\\\"poetry.core.masonry.api\\\\\\\"\"'\n",
+ "\n",
+ " manifest |> file_system.write_all_text_exists' manifest_path\n",
+ "\n",
+ " runtime.execution_options fun x => { x with\n",
+ " command =\n",
+ " match env with\n",
+ " | Pip => $'$\"pip install -r requirements.txt\"'\n",
+ " | Poetry => $'$\"poetry install\"'\n",
+ " working_directory = package_dir |> optionm'.some'\n",
+ " }\n",
+ " |> runtime.execute_with_options\n",
+ "\n",
+ " if exit_code <>. 0 then\n",
+ " trace Critical\n",
+ " fun () => \"spiral_builder.process_cuda / env install error\"\n",
+ " fun () => $'$\"env: {!env} / exit_code: {!exit_code} / new_code_path: {!new_code_path} / run_result: {!run_result}\"'\n",
+ " { extension = Some extension; code = None; output = None }\n",
+ " else\n",
+ " inl command = \n",
+ " match env with\n",
+ " | Pip => $'$\"python \\\\\\\"{!new_code_path}\\\\\\\"\"'\n",
+ " | Poetry => $'$\"poetry run python \\\\\\\"{!new_code_path}\\\\\\\"\"'\n",
+ " inl environment_variables =\n",
+ " ;[\n",
+ " \"TRACE_LEVEL\", \"Verbose\"\n",
+ " ]\n",
+ " inl exit_code, run_result =\n",
+ " runtime.execution_options fun x => { x with\n",
+ " command\n",
+ " environment_variables\n",
+ " working_directory = package_dir |> optionm'.some'\n",
+ " }\n",
+ " |> runtime.execute_with_options\n",
+ "\n",
+ " inl external_command =\n",
+ " inl vars =\n",
+ " a environment_variables\n",
+ " |> am.map fun k, v => $'$\"$env:{!k}=\\'\\'{!v}\\'\\'\"' : string\n",
+ " |> fun x => x : _ i32 _\n",
+ " |> seq.of_array\n",
+ " |> sm'.concat \";\"\n",
+ " $'$\"pwsh -c \\'{!vars}; {!command}\\'\"' : string\n",
+ " if exit_code = 0 then\n",
+ " inl output =\n",
+ " try\n",
+ " fun () =>\n",
+ " run_result\n",
+ " |> sm'.split \"\\n\"\n",
+ " |> fun x => a x : _ i32 _\n",
+ " |> seq.of_array\n",
+ " |> sm'.concat \"\\n\"\n",
+ " fun ex =>\n",
+ " trace Critical\n",
+ " fun () => \"spiral_builder.process_cuda / Exception\"\n",
+ " fun () => $'$\"ex: {!ex} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result} / {!_locals ()}\"'\n",
+ " None\n",
+ " |> optionm'.box\n",
+ " |> optionm'.unwrap\n",
+ "\n",
+ " { extension = Some extension; code = Some new_code; output = Some output }\n",
+ " else\n",
+ " trace Critical\n",
+ " fun () => \"spiral_builder.process_cuda / error\"\n",
+ " fun () => $'$\"exit_code: {!exit_code} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result}\"'\n",
+ " { extension = Some extension; code = None; output = None }"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## fsharp"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### process_fsharp"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "dotnet_interactive": {
+ "language": "spiral"
+ },
+ "polyglot_notebook": {
+ "kernelName": "spiral"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "inl process_fsharp { spi_path } =\n",
+ " inl extension = \"fsx\"\n",
+ " \n",
+ " inl new_code_path = spi_path\n",
+ " inl new_code = new_code_path |> file_system.read_all_text\n",
+ "\n",
+ " inl workspace_root_external = file_system.get_workspace_root_external ()\n",
+ " inl workspace_root = workspace_root_external |> resultm.box |> resultm.unwrap_or_else id\n",
+ " \n",
+ " inl supervisor_path = workspace_root > $\"apps/spiral/dist/Supervisor!(runtime.get_executable_suffix ())\"\n",
+ " inl code_dir = new_code_path |> file_system.get_directory_name\n",
+ " inl file_name = new_code_path |> file_system.get_file_name_without_extension\n",
+ " inl output_path = code_dir > $'$\"{!file_name}.{!extension}\"'\n",
+ " inl command = $'$\"{!supervisor_path} --build-file \\\\\\\"{!new_code_path}\\\\\\\" \\\\\\\"{!output_path}\\\\\\\"\"'\n",
+ " inl environment_variables =\n",
+ " ;[\n",
+ " \"TRACE_LEVEL\", \"Verbose\"\n",
+ " ]\n",
+ " inl exit_code, run_result =\n",
+ " runtime.execution_options fun x => { x with\n",
+ " command\n",
+ " environment_variables\n",
+ " working_directory = workspace_root_external |> resultm.box |> resultm.ok'\n",
+ " }\n",
+ " |> runtime.execute_with_options\n",
+ "\n",
+ " inl external_command =\n",
+ " inl vars =\n",
+ " a environment_variables\n",
+ " |> am.map fun k, v => $'$\"$env:{!k}=\\'\\'{!v}\\'\\'\"' : string\n",
+ " |> fun x => x : _ i32 _\n",
+ " |> seq.of_array\n",
+ " |> sm'.concat \";\"\n",
+ " $'$\"pwsh -c \\'{!vars}; {!command}\\'\"' : string\n",
+ " if exit_code = 0 then\n",
+ " inl output =\n",
+ " try\n",
+ " fun () =>\n",
+ " run_result\n",
+ " |> sm'.split \"\\n\"\n",
+ " |> fun x => a x : _ i32 _\n",
+ " |> seq.of_array\n",
+ " |> sm'.concat \"\\n\"\n",
+ " fun ex =>\n",
+ " trace Critical\n",
+ " fun () => \"spiral_builder.process_fsharp / Exception\"\n",
+ " fun () => $'$\"ex: {!ex} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result} / {!_locals ()}\"'\n",
+ " None\n",
+ " |> optionm'.box\n",
+ " |> optionm'.unwrap\n",
+ "\n",
+ " { extension = Some extension; code = Some new_code; output = Some output }\n",
+ " else\n",
+ " trace Critical\n",
+ " fun () => \"spiral_builder.process_fsharp / error\"\n",
+ " fun () => $'$\"exit_code: {!exit_code} / new_code_path: {!new_code_path} / external_command: {!external_command} / run_result: {!run_result}\"'\n",
+ " { extension = Some extension; code = None; output = None }"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -1561,18 +1852,66 @@
" fun () =>\n",
" match matches |> runtime.matches_subcommand |> optionm'.unbox with\n",
" | Some (subcommand, arg_matches)\n",
- " when (subcommand |> sm'.from_std_string) = (get_args () .fsharp |> fst) =>\n",
+ " when (subcommand |> sm'.from_std_string) = (get_args () .cuda |> fst) =>\n",
+ "\n",
+ " inl py_path =\n",
+ " arg_matches\n",
+ " |> runtime.matches_get_one ((get_args () .cuda |> snd).py_path |> fst)\n",
+ " |> optionm'.unbox\n",
+ " |> optionm.value\n",
+ " |> sm'.from_std_string\n",
+ "\n",
+ " inl env =\n",
+ " arg_matches\n",
+ " |> runtime.matches_get_one ((get_args () .cuda |> snd).env |> fst)\n",
+ " |> optionm'.unbox\n",
+ " |> optionm.map (\n",
+ " sm'.from_std_string\n",
+ " >> reflection.union_try_pick\n",
+ " )\n",
+ " |> optionm'.flatten\n",
+ " |> optionm'.default_value Pip\n",
+ "\n",
+ " inl deps : am'.vec sm'.std_string =\n",
+ " arg_matches\n",
+ " |> runtime.matches_get_many ((get_args () .cuda |> snd).deps |> fst)\n",
+ " |> optionm'.unbox\n",
+ " |> optionm'.default_value (;[] |> am'.to_vec)\n",
+ "\n",
+ " inl command_result =\n",
+ " process_cuda { py_path env deps }\n",
+ " |> fun { extension code output } =>\n",
+ " ;[\n",
+ " \"extension\", extension |> optionm'.default_value \"\"\n",
+ " \"code\", code |> optionm'.default_value \"\"\n",
+ " \"output\", output |> optionm'.default_value \"\"\n",
+ " ]\n",
+ "\n",
+ " ;[\n",
+ " \"command_result\",\n",
+ " command_result\n",
+ " |> am'.to_vec\n",
+ " |> am'.vec_map' fun k, v =>\n",
+ " new_pair (sm'.to_std_string k) (sm'.to_std_string v)\n",
+ " |> mapm.b_tree_map_from_vec_pairs\n",
+ " |> sm'.serialize\n",
+ " |> resultm.unwrap'\n",
+ " |> sm'.from_std_string\n",
+ " ]\n",
+ "\n",
+ " | Some (subcommand, arg_matches)\n",
+ " when (subcommand |> sm'.from_std_string) = (get_args () .fable |> fst) =>\n",
"\n",
" inl fs_path =\n",
" arg_matches\n",
- " |> runtime.matches_get_one ((get_args () .fsharp |> snd).fs_path |> fst)\n",
+ " |> runtime.matches_get_one ((get_args () .fable |> snd).fs_path |> fst)\n",
" |> optionm'.unbox\n",
" |> optionm.value\n",
" |> sm'.from_std_string\n",
"\n",
" inl command =\n",
" arg_matches\n",
- " |> runtime.matches_get_one ((get_args () .fsharp |> snd).command |> fst)\n",
+ " |> runtime.matches_get_one ((get_args () .fable |> snd).command |> fst)\n",
" |> optionm'.unbox\n",
" |> optionm.map sm'.from_std_string\n",
"\n",
@@ -1710,42 +2049,30 @@
{
"data": {
"text/plain": [
- "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: C:\\Users\\i574n\\AppData\\Local\\Temp\\!create_temp_path_\\spiral_builder_1031b725dff0ef2ac6d4ae07936cffd40a2b1ad2af9ed3f7f1776949ab19173f\\c6422374-71e4-07d4-0ba4-c3084b24fbba\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #2 file_system.create_dir / dir: c:\\home\\git\\polyglot\\target/polyglot/spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #3 file_system.create_dir / dir: c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\fable_modules\n",
- "00:00:00 \u001B[94m debug\u001B[39m #4 runtime.execute_with_options / file_name: dotnet / arguments: [\"fable\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892/spiral_builder.fsproj\", \"--optimize\", \"--lang\", \"rs\", \"--extension\", \".rs\", \"--outDir\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\", \"--define\", \"_WINDOWS\"] / options: (None, \"dotnet fable \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892/spiral_builder.fsproj\" --optimize --lang rs --extension .rs --outDir \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\" --define _WINDOWS\", Array(MutCell([])), None, None, true, None)\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #5 > Fable 4.17.0: F# to Rust compiler (status: alpha)\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #6 >\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #7 > Thanks to the contributor! @zaaack\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #8 > Stand with Ukraine! https://standwithukraine.com.ua\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #9 >\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #10 > Parsing ..\\..\\..\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\spiral_builder.fsproj...\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #11 > ..\\..\\..\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892> cmd /C dotnet restore spiral_builder.fable-temp.csproj -p:FABLE_COMPILER=true -p:FABLE_COMPILER_4=true -p:FABLE_COMPILER_RUST=true -p:_WINDOWS=true\n",
- "00:00:01 \u001B[90mverbose\u001B[39m #12 > Determining projects to restore...\n",
- "00:00:02 \u001B[90mverbose\u001B[39m #13 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\spiral_builder.fable-temp.csproj (in 1.12 sec).\n",
- "00:00:05 \u001B[90mverbose\u001B[39m #14 > ..\\..\\..\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892> cmd /C dotnet restore C:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892/spiral_builder.fsproj\n",
- "00:00:05 \u001B[90mverbose\u001B[39m #15 > Determining projects to restore...\n",
- "00:00:07 \u001B[90mverbose\u001B[39m #16 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\spiral_builder.fsproj (in 1.13 sec).\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #17 > Project and references (1 source files) parsed in 7785ms\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #18 >\n",
- "00:00:09 \u001B[90mverbose\u001B[39m #19 > Started Fable compilation...\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #20 >\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #21 > Fable compilation finished in 1323ms\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #22 >\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #23 > .\\..\\..\\..\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\spiral_builder.fs(1,1): 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!\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #24 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 1811\n",
- "00:00:10 \u001B[94m debug\u001B[39m #25 runtime.execute_with_options / file_name: cargo / arguments: [\"fmt\", \"--manifest-path\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\\\Cargo.toml\", \"--\"] / options: (None, \"cargo fmt --manifest-path \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\Cargo.toml\" --\", Array(MutCell([])), None, None, true, None)\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #26 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 0\n",
- "00:00:10 \u001B[94m debug\u001B[39m #27 runtime.execute_with_options / file_name: cargo / arguments: [\"+nightly\", \"run\", \"--manifest-path\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\\\Cargo.toml\"] / options: (None, \"cargo +nightly run --manifest-path \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\Cargo.toml\"\", Array(MutCell([(\"TRACE_LEVEL\", \"Verbose\"), (\"RUSTC_WRAPPER\", \"sccache\"), (\"RUSTFLAGS\", \"-C prefer-dynamic\")])), None, None, true, None)\n",
- "00:00:11 \u001B[90mverbose\u001B[39m #28 ! Locking 1 package to latest compatible version\n",
- "00:00:11 \u001B[90mverbose\u001B[39m #29 ! Adding spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892 v0.0.1 (C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892)\n",
- "00:00:11 \u001B[90mverbose\u001B[39m #30 ! Compiling fable_library_rust v0.1.0 (C:\\home\\git\\polyglot\\lib\\rust\\fable\\fable_modules\\fable-library-rust)\n",
- "00:00:13 \u001B[90mverbose\u001B[39m #31 ! Compiling spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892 v0.0.1 (C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892)\n",
- "00:00:13 \u001B[90mverbose\u001B[39m #32 ! Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.52s\n",
- "00:00:13 \u001B[90mverbose\u001B[39m #33 ! Running `c:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\spiral_builder\\target\\debug\\spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.exe`\n",
- "00:00:13 \u001B[90mverbose\u001B[39m #34 > -3\n",
- "00:00:13 \u001B[90mverbose\u001B[39m #35 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 961\n",
- "00:00:13 \u001B[90mverbose\u001B[39m #36 spiral_builder.process_rust / cleanup: UH3_1(\"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\../..\\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.d\", true, UH3_1(\"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\../..\\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.exe\", true, UH3_1(\"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\../..\\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.pdb\", true, UH3_1(\"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\../..\\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\", false, UH3_0))))\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: C:\\Users\\i574n\\AppData\\Local\\Temp\\!create_temp_path_\\spiral_builder_6e61566468b7f3be495bfb26e5387253967bdc549bab13be897a2f1e6e3fb26e\\c6422374-71e4-07d4-0ba4-c3084b24fbba\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #2 file_system.create_dir / dir: c:\\home\\git\\polyglot\\target/spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\n",
+ "00:00:00 \u001B[94m debug\u001B[39m #3 runtime.execute_with_options / file_name: dotnet / arguments: [\"fable\", \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892/spiral_builder.fsproj\", \"--optimize\", \"--lang\", \"rs\", \"--extension\", \".rs\", \"--outDir\", \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\", \"--define\", \"_WINDOWS\"] / options: (None, \"dotnet fable \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892/spiral_builder.fsproj\" --optimize --lang rs --extension .rs --outDir \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\" --define _WINDOWS\", Array(MutCell([])), None, None, true, None)\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #4 > Fable 4.17.0: F# to Rust compiler (status: alpha)\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #5 >\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #6 > Thanks to the contributor! @alfonsogarciacaro\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #7 > Stand with Ukraine! https://standwithukraine.com.ua\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #8 >\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #9 > Parsing ..\\..\\..\\target\\spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\spiral_builder.fsproj...\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #10 > Retrieving project options from cache, in case of issues run `dotnet fable clean` or try `--noCache` option.\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #11 > Project and references (1 source files) parsed in 227ms\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #12 >\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #13 > Skipped compilation because all generated files are up-to-date!\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #14 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 533\n",
+ "00:00:01 \u001B[94m debug\u001B[39m #15 runtime.execute_with_options / file_name: cargo / arguments: [\"fmt\", \"--manifest-path\", \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\\\Cargo.toml\", \"--\"] / options: (None, \"cargo fmt --manifest-path \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\Cargo.toml\" --\", Array(MutCell([])), None, None, true, None)\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #16 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 0\n",
+ "00:00:01 \u001B[94m debug\u001B[39m #17 runtime.execute_with_options / file_name: cargo / arguments: [\"+nightly\", \"run\", \"--manifest-path\", \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\\\Cargo.toml\"] / options: (None, \"cargo +nightly run --manifest-path \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\Cargo.toml\"\", Array(MutCell([(\"TRACE_LEVEL\", \"Verbose\"), (\"RUSTC_WRAPPER\", \"sccache\"), (\"RUSTFLAGS\", \"-C prefer-dynamic\")])), None, None, true, None)\n",
+ "00:00:02 \u001B[90mverbose\u001B[39m #18 ! Compiling fable_library_rust v0.1.0 (C:\\home\\git\\polyglot\\lib\\rust\\fable\\fable_modules\\fable-library-rust)\n",
+ "00:00:04 \u001B[90mverbose\u001B[39m #19 ! Compiling spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892 v0.0.1 (C:\\home\\git\\polyglot\\target\\spiral_builder\\spiral_builder\\packages\\bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892)\n",
+ "00:00:05 \u001B[90mverbose\u001B[39m #20 ! Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.57s\n",
+ "00:00:05 \u001B[90mverbose\u001B[39m #21 ! Running `c:\\home\\git\\polyglot\\target\\spiral_builder\\spiral_builder\\target\\debug\\spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.exe`\n",
+ "00:00:05 \u001B[90mverbose\u001B[39m #22 > -3\n",
+ "00:00:05 \u001B[90mverbose\u001B[39m #23 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 628\n",
+ "00:00:05 \u001B[90mverbose\u001B[39m #24 spiral_builder.process_rust / cleanup: UH3_1(\"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\../..\\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.d\", true, UH3_1(\"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\../..\\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.exe\", true, UH3_1(\"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\../..\\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892.pdb\", true, UH3_1(\"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\\../..\\target/debug/spiral_builder_bbba338a47ca28119f39303b7763a976cf95da9c277df176e65d83bd5db52892\", false, UH3_0))))\n",
"assert_eq / actual: \"rs\" / expected: \"rs\"\n",
"assert_eq / actual: \"-3\" / expected: \"-3\"\n"
]
@@ -1773,7 +2100,7 @@
"code |> file_system.write_all_text fs_path\n",
"\n",
"get_command ()\n",
- "|> runtime.command_get_matches_from ($'$\"_ fsharp -f \\\\\\\"{!fs_path}\\\\\\\" -c \\\\\\\"rust -d regex=\\'*\\'\\\\\\\"\"' |> runtime.split_args |> resultm.get)\n",
+ "|> runtime.command_get_matches_from ($'$\"_ fable -f \\\\\\\"{!fs_path}\\\\\\\" -c \\\\\\\"rust -d regex=\\'*\\'\\\\\\\"\"' |> runtime.split_args |> resultm.get)\n",
"|> run Verbose\n",
"|> async.block_on\n",
"|> resultm.unwrap'\n",
@@ -1814,94 +2141,28 @@
{
"data": {
"text/plain": [
- "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: C:\\Users\\i574n\\AppData\\Local\\Temp\\!create_temp_path_\\spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8\\af524e22-8e9a-5d18-99ed-bd86e1b74623\n",
- "00:00:00 \u001B[94m debug\u001B[39m #2 runtime.execute_with_options / file_name: dotnet / arguments: [\"repl\", \"--exit-after-run\", \"--run\", \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib\", \"--output-path\", \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb\"] / options: (None, \"dotnet repl --exit-after-run --run \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib\" --output-path \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb\"\", Array(MutCell([(\"TRACE_LEVEL\", \"Verbose\"), (\"AUTOMATION\", \"True\")])), None, None, false, None)\n",
- "> \n",
- "> ── fsharp ──────────────────────────────────────────────────────────────────────\n",
- "> 3 - 6\n",
- "> \n",
- "> ── fsharp - import ─────────────────────────────────────────────────────────────\n",
- "> #r \n",
- "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.A\n",
- "> spNetCore.Html.Abstractions.dll\"\n",
- "> #r \n",
- "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D\n",
- "> otNet.Interactive.dll\"\n",
- "> #r \n",
- "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D\n",
- "> otNet.Interactive.FSharp.dll\"\n",
- "> #r \n",
- "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D\n",
- "> otNet.Interactive.Formatting.dll\"\n",
- "> open System\n",
- "> open System.IO\n",
- "> open System.Text\n",
- "> open Microsoft.DotNet.Interactive.Formatting\n",
- "> \n",
- "> ── fsharp - import ─────────────────────────────────────────────────────────────\n",
- "> #r \n",
- "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D\n",
- "> otNet.Interactive.FSharp.dll\"\n",
- "> open Microsoft.DotNet.Interactive.FSharp.FSharpKernelHelpers\n",
- "> #r \n",
- "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D\n",
- "> otNet.Interactive.dll\"\n",
- "> open type Microsoft.DotNet.Interactive.Kernel\n",
- "> \n",
- "> ── fsharp - import ─────────────────────────────────────────────────────────────\n",
- "> Formatter.Register(fun(x: obj)(writer: TextWriter)->fprintfn writer \"%120A\" x)\n",
- "> \n",
- "> ── fsharp - import ─────────────────────────────────────────────────────────────\n",
- "> Formatter.Register(fun(x: System.Collections.IEnumerable)(writer: \n",
- "> TextWriter)->fprintfn writer \"%120A\" x)\n",
- "> \n",
- "> ╭─[ 4.29s - return value ]─────────────────────────────────────────────────────╮\n",
- "> │ -3 │\n",
- "> │
│\n",
- "> ╰──────────────────────────────────────────────────────────────────────────────╯\n",
- "00:00:06 \u001B[90mverbose\u001B[39m #3 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 4316\n",
- "00:00:06 \u001B[94m debug\u001B[39m #4 runtime.execute_with_options / file_name: jupyter / arguments: [\"nbconvert\", \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb\", \"--to\", \"html\", \"--HTMLExporter.theme=dark\"] / options: (None, \"jupyter nbconvert \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb\" --to html --HTMLExporter.theme=dark\", Array(MutCell([])), None, None, true, None)\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #5 ! [NbConvertApp] Converting notebook c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb to html\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #6 ! C:\\Users\\i574n\\scoop\\apps\\python\\current\\Lib\\site-packages\\nbformat\\__init__.py:93: MissingIDFieldWarning: Code 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.\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #7 ! validate(nb)\n",
- "00:00:09 \u001B[90mverbose\u001B[39m #8 ! [NbConvertApp] Writing 271490 bytes to c:\\Users\\i574n\\AppData\\Local\\Temp\\!create_temp_path_\\spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8\\af524e22-8e9a-5d18-99ed-bd86e1b74623\\test.dib.html\n",
- "00:00:09 \u001B[90mverbose\u001B[39m #9 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 915\n",
- "00:00:09 \u001B[94m debug\u001B[39m #10 spiral_builder.run / dib / jupyter nbconvert / exit_code: 0 / jupyter_result.Length: 915\n",
- "00:00:09 \u001B[94m debug\u001B[39m #11 runtime.execute_with_options / file_name: pwsh / arguments: [\"-c\", \"$counter = 1; $path = 'c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.html'; (Get-Content $path -Raw) -replace '(id=\\\\\\\"cell-id=)[a-fA-F0-9]{8}', { $_.Groups[1].Value + $counter++ } | Set-Content $path\"] / options: (None, \"pwsh -c \"$counter = 1; $path = 'c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_307a1245f2f92b45a75ae37594a623ec5dae98d7c01ddb9244683ef4e6cf3ff8/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.html'; (Get-Content $path -Raw) -replace '(id=\\\"cell-id=)[a-fA-F0-9]{8}', { $_.Groups[1].Value + $counter++ } | Set-Content $path\"\", Array(MutCell([])), None, None, true, None)\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #12 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 0\n",
- "00:00:10 \u001B[94m debug\u001B[39m #13 spiral_builder.run / dib / html cell ids / exit_code: 0 / pwsh_replace_html_result.Length: 0\n",
- "00:00:10 \u001B[94m debug\u001B[39m #14 spiral_builder.run / dib / exit_code: 0 / result.Length: 5290\n"
+ "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: C:\\Users\\i574n\\AppData\\Local\\Temp\\!create_temp_path_\\spiral_builder_69bad1f34c1f4debd82e31f261a7a9631f44027e2c9c5291f147860456d046fd\\c6422374-71e4-07d4-0ba4-c3084b24fbba\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #2 file_system.create_dir / dir: c:\\home\\git\\polyglot\\target/spiral_builder\\spiral_builder\\packages\\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\n",
+ "00:00:00 \u001B[94m debug\u001B[39m #3 spiral_builder.process_typescript / version: US39_1\n",
+ "00:00:00 \u001B[94m debug\u001B[39m #4 runtime.execute_with_options / file_name: dotnet / arguments: [\"fable\", \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8/spiral_builder.fsproj\", \"--optimize\", \"--lang\", \"ts\", \"--extension\", \".ts\", \"--outDir\", \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\", \"--define\", \"_WINDOWS\"] / options: (None, \"dotnet fable \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8/spiral_builder.fsproj\" --optimize --lang ts --extension .ts --outDir \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\" --define _WINDOWS\", Array(MutCell([])), None, None, true, None)\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #5 > Fable 4.17.0: F# to TypeScript compiler\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #6 > Minimum @fable-org/fable-library-ts version (when installed from npm): 1.4.0\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #7 >\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #8 > Thanks to the contributor! @stroborobo\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #9 > Stand with Ukraine! https://standwithukraine.com.ua\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #10 >\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #11 > Parsing ..\\..\\..\\target\\spiral_builder\\spiral_builder\\packages\\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\spiral_builder.fsproj...\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #12 > Retrieving project options from cache, in case of issues run `dotnet fable clean` or try `--noCache` option.\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #13 > Project and references (1 source files) parsed in 248ms\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #14 >\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #15 > Skipped compilation because all generated files are up-to-date!\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #16 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 593\n",
+ "00:00:01 \u001B[94m debug\u001B[39m #17 spiral_builder.process_typescript / new_code_path: c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\spiral_builder.ts\n",
+ "00:00:01 \u001B[94m debug\u001B[39m #18 runtime.execute_with_options / file_name: bun / arguments: [\"run\", \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\\\spiral_builder.ts\"] / options: (None, \"bun run \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\spiral_builder.ts\"\", Array(MutCell([(\"TRACE_LEVEL\", \"Verbose\")])), None, None, true, None)\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #19 > -3\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #20 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 2\n",
+ "assert_eq / actual: \"ts\" / expected: \"ts\"\n",
+ "assert_eq / actual: \"-3\" / expected: \"-3\"\n"
]
},
"metadata": {},
@@ -1910,34 +2171,45 @@
],
"source": [
"//// test\n",
- "///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream\n",
+ "///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io futures rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream\n",
"\n",
"types ()\n",
"\n",
- "inl file_name = \"test.dib\"\n",
- "inl code =\n",
- " \"#!meta\\n\\n{\\\"kernelInfo\\\":{\\\"defaultKernelName\\\":\\\"fsharp\\\",\\\"items\\\":[]}}\\n\\n#!fsharp\\n\\n3 - 6\\n\"\n",
+ "inl code = \"3 - 6 |> System.Console.WriteLine\\n\"\n",
+ "inl file_name = \"main.fs\"\n",
"\n",
"inl temp_dir, disposable =\n",
" (file_name, code)\n",
" |> sm'.format_debug\n",
" |> crypto.hash_text\n",
" |> file_system.create_temp_dir'\n",
- "inl path = temp_dir > file_name |> file_system.normalize_path\n",
+ "inl fs_path = temp_dir > file_name\n",
"\n",
- "code\n",
- "|> file_system.write_all_text path\n",
+ "code |> file_system.write_all_text fs_path\n",
"\n",
"get_command ()\n",
- "|> runtime.command_get_matches_from ($'$\"_ dib -p {!path}\"' |> runtime.split_args |> resultm.get)\n",
+ "|> runtime.command_get_matches_from ($'$\"_ fable -f \\\\\\\"{!fs_path}\\\\\\\" -c \\\\\\\"typescript\\\\\\\"\"' |> runtime.split_args |> resultm.get)\n",
"|> run Verbose\n",
"|> async.block_on\n",
"|> resultm.unwrap'\n",
- "|> __assert_string_contains false \"-3 \"\n",
- "\n",
- "$'$\"{!path}.html\"'\n",
- "|> file_system.read_all_text\n",
- "|> __assert_string_contains false \"\\\"cell-id=1\\\"\"\n",
+ "|> sm'.deserialize\n",
+ "|> resultm.unwrap'\n",
+ "|> mapm.get (\"command_result\" |> sm'.to_std_string)\n",
+ "|> optionm'.unwrap\n",
+ "|> sm'.from_std_string\n",
+ "|> sm'.deserialize\n",
+ "|> resultm.unwrap'\n",
+ "|> fun result =>\n",
+ " result\n",
+ " |> mapm.get (\"extension\" |> sm'.to_std_string)\n",
+ " |> optionm'.unwrap\n",
+ " |> sm'.from_std_string\n",
+ " |> _assert_eq \"ts\"\n",
+ " result\n",
+ " |> mapm.get (\"output\" |> sm'.to_std_string)\n",
+ " |> optionm'.unwrap\n",
+ " |> sm'.from_std_string\n",
+ " |> _assert_eq \"-3\"\n",
"\n",
"disposable |> use |> ignore"
]
@@ -1957,35 +2229,25 @@
{
"data": {
"text/plain": [
- "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: C:\\Users\\i574n\\AppData\\Local\\Temp\\!create_temp_path_\\spiral_builder_27533e216e0c3886a81aaa645ed7c3a89181214acc7bc6495fe9ce06e11a1c1f\\c6422374-71e4-07d4-0ba4-c3084b24fbba\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #2 file_system.create_dir / dir: c:\\home\\git\\polyglot\\target/polyglot/spiral_builder\\spiral_builder\\packages\\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\n",
- "00:00:00 \u001B[94m debug\u001B[39m #3 spiral_builder.process_typescript / version: US35_1\n",
- "00:00:00 \u001B[94m debug\u001B[39m #4 runtime.execute_with_options / file_name: dotnet / arguments: [\"fable\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8/spiral_builder.fsproj\", \"--optimize\", \"--lang\", \"ts\", \"--extension\", \".ts\", \"--outDir\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\", \"--define\", \"_WINDOWS\"] / options: (None, \"dotnet fable \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8/spiral_builder.fsproj\" --optimize --lang ts --extension .ts --outDir \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\" --define _WINDOWS\", Array(MutCell([])), None, None, true, None)\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #5 > Fable 4.17.0: F# to TypeScript compiler\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #6 > Minimum @fable-org/fable-library-ts version (when installed from npm): 1.4.0\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #7 >\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #8 > Thanks to the contributor! @dgchurchill\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #9 > Stand with Ukraine! https://standwithukraine.com.ua\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #10 >\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #11 > Parsing ..\\..\\..\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\spiral_builder.fsproj...\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #12 > ..\\..\\..\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8> cmd /C dotnet restore spiral_builder.fable-temp.csproj -p:FABLE_COMPILER=true -p:FABLE_COMPILER_4=true -p:FABLE_COMPILER_TYPESCRIPT=true -p:_WINDOWS=true\n",
- "00:00:01 \u001B[90mverbose\u001B[39m #13 > Determining projects to restore...\n",
- "00:00:02 \u001B[90mverbose\u001B[39m #14 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\spiral_builder.fable-temp.csproj (in 1.12 sec).\n",
- "00:00:04 \u001B[90mverbose\u001B[39m #15 > ..\\..\\..\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8> cmd /C dotnet restore C:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8/spiral_builder.fsproj\n",
- "00:00:05 \u001B[90mverbose\u001B[39m #16 > Determining projects to restore...\n",
- "00:00:07 \u001B[90mverbose\u001B[39m #17 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\spiral_builder.fsproj (in 1.14 sec).\n",
- "00:00:07 \u001B[90mverbose\u001B[39m #18 > Project and references (1 source files) parsed in 7062ms\n",
- "00:00:07 \u001B[90mverbose\u001B[39m #19 >\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #20 > Started Fable compilation...\n",
- "00:00:09 \u001B[90mverbose\u001B[39m #21 >\n",
- "00:00:09 \u001B[90mverbose\u001B[39m #22 > Fable compilation finished in 1286ms\n",
- "00:00:09 \u001B[90mverbose\u001B[39m #23 >\n",
- "00:00:09 \u001B[90mverbose\u001B[39m #24 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 1561\n",
- "00:00:09 \u001B[94m debug\u001B[39m #25 spiral_builder.process_typescript / new_code_path: c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\spiral_builder.ts\n",
- "00:00:09 \u001B[94m debug\u001B[39m #26 runtime.execute_with_options / file_name: bun / arguments: [\"run\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\\\spiral_builder.ts\"] / options: (None, \"bun run \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/702335b0756baa7db0d02dbbeaf9fc04cf2c3b7dbb45866c578c5109aaa8c4a8\\spiral_builder.ts\"\", Array(MutCell([(\"TRACE_LEVEL\", \"Verbose\")])), None, None, true, None)\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #27 > -3\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #28 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 2\n",
- "assert_eq / actual: \"ts\" / expected: \"ts\"\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: C:\\Users\\i574n\\AppData\\Local\\Temp\\!create_temp_path_\\spiral_builder_e1253471353f8348fca628165c2439fb8aba4f7776e68e5d96fad295f4046f69\\c6422374-71e4-07d4-0ba4-c3084b24fbba\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #2 file_system.create_dir / dir: c:\\home\\git\\polyglot\\target/spiral_builder\\spiral_builder\\packages\\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\n",
+ "00:00:00 \u001B[94m debug\u001B[39m #3 runtime.execute_with_options / file_name: dotnet / arguments: [\"fable\", \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce/spiral_builder.fsproj\", \"--optimize\", \"--lang\", \"py\", \"--extension\", \".py\", \"--outDir\", \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\", \"--define\", \"_WINDOWS\"] / options: (None, \"dotnet fable \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce/spiral_builder.fsproj\" --optimize --lang py --extension .py --outDir \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\" --define _WINDOWS\", Array(MutCell([])), None, None, true, None)\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #4 > Fable 4.17.0: F# to Python compiler (status: beta)\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #5 >\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #6 > Thanks to the contributor! @ncave\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #7 > Stand with Ukraine! https://standwithukraine.com.ua\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #8 >\n",
+ "00:00:00 \u001B[90mverbose\u001B[39m #9 > Parsing ..\\..\\..\\target\\spiral_builder\\spiral_builder\\packages\\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\spiral_builder.fsproj...\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #10 > Retrieving project options from cache, in case of issues run `dotnet fable clean` or try `--noCache` option.\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #11 > Project and references (1 source files) parsed in 308ms\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #12 >\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #13 > Skipped compilation because all generated files are up-to-date!\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #14 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 522\n",
+ "00:00:01 \u001B[94m debug\u001B[39m #15 spiral_builder.process_python / new_code_path: c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\spiral_builder.py\n",
+ "00:00:01 \u001B[94m debug\u001B[39m #16 runtime.execute_with_options / file_name: python / arguments: [\"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\\\spiral_builder.py\"] / options: (None, \"python \"c:/home/git/polyglot/target/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\spiral_builder.py\"\", Array(MutCell([(\"TRACE_LEVEL\", \"Verbose\")])), None, None, true, None)\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #17 > -3\n",
+ "00:00:01 \u001B[90mverbose\u001B[39m #18 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 2\n",
+ "assert_eq / actual: \"py\" / expected: \"py\"\n",
"assert_eq / actual: \"-3\" / expected: \"-3\"\n"
]
},
@@ -1999,8 +2261,8 @@
"\n",
"types ()\n",
"\n",
- "inl code = \"3 - 6 |> System.Console.WriteLine\\n\"\n",
"inl file_name = \"main.fs\"\n",
+ "inl code = \"3 - 6 |> System.Console.WriteLine\\n\"\n",
"\n",
"inl temp_dir, disposable =\n",
" (file_name, code)\n",
@@ -2012,7 +2274,7 @@
"code |> file_system.write_all_text fs_path\n",
"\n",
"get_command ()\n",
- "|> runtime.command_get_matches_from ($'$\"_ fsharp -f \\\\\\\"{!fs_path}\\\\\\\" -c \\\\\\\"typescript\\\\\\\"\"' |> runtime.split_args |> resultm.get)\n",
+ "|> runtime.command_get_matches_from ($'$\"_ fable -f \\\\\\\"{!fs_path}\\\\\\\" -c \\\\\\\"python\\\\\\\"\"' |> runtime.split_args |> resultm.get)\n",
"|> run Verbose\n",
"|> async.block_on\n",
"|> resultm.unwrap'\n",
@@ -2028,7 +2290,7 @@
" |> mapm.get (\"extension\" |> sm'.to_std_string)\n",
" |> optionm'.unwrap\n",
" |> sm'.from_std_string\n",
- " |> _assert_eq \"ts\"\n",
+ " |> _assert_eq \"py\"\n",
" result\n",
" |> mapm.get (\"output\" |> sm'.to_std_string)\n",
" |> optionm'.unwrap\n",
@@ -2053,35 +2315,94 @@
{
"data": {
"text/plain": [
- "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: C:\\Users\\i574n\\AppData\\Local\\Temp\\!create_temp_path_\\spiral_builder_3d09353ec45356208cfccf2a829270e4593baf0e19246944759dd82403cb47f0\\c6422374-71e4-07d4-0ba4-c3084b24fbba\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #2 file_system.create_dir / dir: c:\\home\\git\\polyglot\\target/polyglot/spiral_builder\\spiral_builder\\packages\\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #3 file_system.create_dir / dir: c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\fable_modules\n",
- "00:00:00 \u001B[94m debug\u001B[39m #4 runtime.execute_with_options / file_name: dotnet / arguments: [\"fable\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce/spiral_builder.fsproj\", \"--optimize\", \"--lang\", \"py\", \"--extension\", \".py\", \"--outDir\", \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\", \"--define\", \"_WINDOWS\"] / options: (None, \"dotnet fable \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce/spiral_builder.fsproj\" --optimize --lang py --extension .py --outDir \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\" --define _WINDOWS\", Array(MutCell([])), None, None, true, None)\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #5 > Fable 4.17.0: F# to Python compiler (status: beta)\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #6 >\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #7 > Thanks to the contributor! @psfblair\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #8 > Stand with Ukraine! https://standwithukraine.com.ua\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #9 >\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #10 > Parsing ..\\..\\..\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\spiral_builder.fsproj...\n",
- "00:00:00 \u001B[90mverbose\u001B[39m #11 > ..\\..\\..\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce> cmd /C dotnet restore spiral_builder.fable-temp.csproj -p:FABLE_COMPILER=true -p:FABLE_COMPILER_4=true -p:FABLE_COMPILER_PYTHON=true -p:_WINDOWS=true\n",
- "00:00:01 \u001B[90mverbose\u001B[39m #12 > Determining projects to restore...\n",
- "00:00:03 \u001B[90mverbose\u001B[39m #13 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\spiral_builder.fable-temp.csproj (in 1.53 sec).\n",
- "00:00:05 \u001B[90mverbose\u001B[39m #14 > ..\\..\\..\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce> cmd /C dotnet restore C:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce/spiral_builder.fsproj\n",
- "00:00:06 \u001B[90mverbose\u001B[39m #15 > Determining projects to restore...\n",
- "00:00:07 \u001B[90mverbose\u001B[39m #16 > Restored C:\\home\\git\\polyglot\\target\\polyglot\\spiral_builder\\spiral_builder\\packages\\cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\spiral_builder.fsproj (in 1.1 sec).\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #17 > Project and references (1 source files) parsed in 7604ms\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #18 >\n",
- "00:00:08 \u001B[90mverbose\u001B[39m #19 > Started Fable compilation...\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #20 >\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #21 > Fable compilation finished in 1326ms\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #22 >\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #23 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 1487\n",
- "00:00:10 \u001B[94m debug\u001B[39m #24 spiral_builder.process_python / new_code_path: c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\spiral_builder.py\n",
- "00:00:10 \u001B[94m debug\u001B[39m #25 runtime.execute_with_options / file_name: python / arguments: [\"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\\\spiral_builder.py\"] / options: (None, \"python \"c:/home/git/polyglot/target/polyglot/spiral_builder/spiral_builder/packages/cb8f3dd33197bb0bc95f09b3f3057a6844a0b70d75477350491883d14d8680ce\\spiral_builder.py\"\", Array(MutCell([(\"TRACE_LEVEL\", \"Verbose\")])), None, None, true, None)\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #26 > -3\n",
- "00:00:10 \u001B[90mverbose\u001B[39m #27 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 2\n",
- "assert_eq / actual: \"py\" / expected: \"py\"\n",
- "assert_eq / actual: \"-3\" / expected: \"-3\"\n"
+ "00:00:00 \u001B[90mverbose\u001B[39m #1 file_system.create_dir / dir: C:\\Users\\i574n\\AppData\\Local\\Temp\\!create_temp_path_\\spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc\\af524e22-8e9a-5d18-99ed-bd86e1b74623\n",
+ "00:00:00 \u001B[94m debug\u001B[39m #2 runtime.execute_with_options / file_name: dotnet / arguments: [\"repl\", \"--exit-after-run\", \"--run\", \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib\", \"--output-path\", \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb\"] / options: (None, \"dotnet repl --exit-after-run --run \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib\" --output-path \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb\"\", Array(MutCell([(\"TRACE_LEVEL\", \"Verbose\"), (\"AUTOMATION\", \"True\")])), None, None, false, None)\n",
+ "> \n",
+ "> ── fsharp ──────────────────────────────────────────────────────────────────────\n",
+ "> 3 - 6\n",
+ "> \n",
+ "> ── fsharp - import ─────────────────────────────────────────────────────────────\n",
+ "> #r \n",
+ "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.A\n",
+ "> spNetCore.Html.Abstractions.dll\"\n",
+ "> #r \n",
+ "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D\n",
+ "> otNet.Interactive.dll\"\n",
+ "> #r \n",
+ "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D\n",
+ "> otNet.Interactive.FSharp.dll\"\n",
+ "> #r \n",
+ "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D\n",
+ "> otNet.Interactive.Formatting.dll\"\n",
+ "> open System\n",
+ "> open System.IO\n",
+ "> open System.Text\n",
+ "> open Microsoft.DotNet.Interactive.Formatting\n",
+ "> \n",
+ "> ── fsharp - import ─────────────────────────────────────────────────────────────\n",
+ "> #r \n",
+ "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D\n",
+ "> otNet.Interactive.FSharp.dll\"\n",
+ "> open Microsoft.DotNet.Interactive.FSharp.FSharpKernelHelpers\n",
+ "> #r \n",
+ "> \"C:/Users/i574n/.nuget/packages/dotnet-repl/0.1.204/tools/net7.0/any/Microsoft.D\n",
+ "> otNet.Interactive.dll\"\n",
+ "> open type Microsoft.DotNet.Interactive.Kernel\n",
+ "> \n",
+ "> ── fsharp - import ─────────────────────────────────────────────────────────────\n",
+ "> Formatter.Register(fun(x: obj)(writer: TextWriter)->fprintfn writer \"%120A\" x)\n",
+ "> \n",
+ "> ── fsharp - import ─────────────────────────────────────────────────────────────\n",
+ "> Formatter.Register(fun(x: System.Collections.IEnumerable)(writer: \n",
+ "> TextWriter)->fprintfn writer \"%120A\" x)\n",
+ "> \n",
+ "> ╭─[ 5.53s - return value ]─────────────────────────────────────────────────────╮\n",
+ "> │ -3 │\n",
+ "> │
│\n",
+ "> ╰──────────────────────────────────────────────────────────────────────────────╯\n",
+ "00:00:08 \u001B[90mverbose\u001B[39m #3 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 4316\n",
+ "00:00:08 \u001B[94m debug\u001B[39m #4 runtime.execute_with_options / file_name: jupyter / arguments: [\"nbconvert\", \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb\", \"--to\", \"html\", \"--HTMLExporter.theme=dark\"] / options: (None, \"jupyter nbconvert \"c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb\" --to html --HTMLExporter.theme=dark\", Array(MutCell([])), None, None, true, None)\n",
+ "00:00:11 \u001B[90mverbose\u001B[39m #5 ! [NbConvertApp] Converting notebook c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.ipynb to html\n",
+ "00:00:11 \u001B[90mverbose\u001B[39m #6 ! C:\\Users\\i574n\\scoop\\apps\\python\\current\\Lib\\site-packages\\nbformat\\__init__.py:93: MissingIDFieldWarning: Code 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.\n",
+ "00:00:11 \u001B[90mverbose\u001B[39m #7 ! validate(nb)\n",
+ "00:00:12 \u001B[90mverbose\u001B[39m #8 ! [NbConvertApp] Writing 271490 bytes to c:\\Users\\i574n\\AppData\\Local\\Temp\\!create_temp_path_\\spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc\\af524e22-8e9a-5d18-99ed-bd86e1b74623\\test.dib.html\n",
+ "00:00:12 \u001B[90mverbose\u001B[39m #9 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 915\n",
+ "00:00:12 \u001B[94m debug\u001B[39m #10 spiral_builder.run / dib / jupyter nbconvert / exit_code: 0 / jupyter_result.Length: 915\n",
+ "00:00:12 \u001B[94m debug\u001B[39m #11 runtime.execute_with_options / file_name: pwsh / arguments: [\"-c\", \"$counter = 1; $path = 'c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.html'; (Get-Content $path -Raw) -replace '(id=\\\\\\\"cell-id=)[a-fA-F0-9]{8}', { $_.Groups[1].Value + $counter++ } | Set-Content $path\"] / options: (None, \"pwsh -c \"$counter = 1; $path = 'c:/Users/i574n/AppData/Local/Temp/!create_temp_path_/spiral_builder_669d5de9dd255ee5302f9ceb0e831ab1c55b9ace6ab5b2e7aae8021ef506fccc/af524e22-8e9a-5d18-99ed-bd86e1b74623/test.dib.html'; (Get-Content $path -Raw) -replace '(id=\\\"cell-id=)[a-fA-F0-9]{8}', { $_.Groups[1].Value + $counter++ } | Set-Content $path\"\", Array(MutCell([])), None, None, true, None)\n",
+ "00:00:14 \u001B[90mverbose\u001B[39m #12 runtime.execute_with_options / result / exit_code: 0 / std_trace.Length: 0\n",
+ "00:00:14 \u001B[94m debug\u001B[39m #13 spiral_builder.run / dib / html cell ids / exit_code: 0 / pwsh_replace_html_result.Length: 0\n",
+ "00:00:14 \u001B[94m debug\u001B[39m #14 spiral_builder.run / dib / exit_code: 0 / result.Length: 5290\n"
]
},
"metadata": {},
@@ -2090,45 +2411,34 @@
],
"source": [
"//// test\n",
- "///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io futures rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream\n",
+ "///! rust -d async-walkdir chrono clap encoding_rs encoding_rs_io rand rayon regex serde_json sha2 tokio['rt-multi-thread'] tokio-stream\n",
"\n",
"types ()\n",
"\n",
- "inl file_name = \"main.fs\"\n",
- "inl code = \"3 - 6 |> System.Console.WriteLine\\n\"\n",
+ "inl file_name = \"test.dib\"\n",
+ "inl code =\n",
+ " \"#!meta\\n\\n{\\\"kernelInfo\\\":{\\\"defaultKernelName\\\":\\\"fsharp\\\",\\\"items\\\":[]}}\\n\\n#!fsharp\\n\\n3 - 6\\n\"\n",
"\n",
"inl temp_dir, disposable =\n",
" (file_name, code)\n",
" |> sm'.format_debug\n",
" |> crypto.hash_text\n",
" |> file_system.create_temp_dir'\n",
- "inl fs_path = temp_dir > file_name\n",
+ "inl path = temp_dir > file_name |> file_system.normalize_path\n",
"\n",
- "code |> file_system.write_all_text fs_path\n",
+ "code\n",
+ "|> file_system.write_all_text path\n",
"\n",
"get_command ()\n",
- "|> runtime.command_get_matches_from ($'$\"_ fsharp -f \\\\\\\"{!fs_path}\\\\\\\" -c \\\\\\\"python\\\\\\\"\"' |> runtime.split_args |> resultm.get)\n",
+ "|> runtime.command_get_matches_from ($'$\"_ dib -p {!path}\"' |> runtime.split_args |> resultm.get)\n",
"|> run Verbose\n",
"|> async.block_on\n",
"|> resultm.unwrap'\n",
- "|> sm'.deserialize\n",
- "|> resultm.unwrap'\n",
- "|> mapm.get (\"command_result\" |> sm'.to_std_string)\n",
- "|> optionm'.unwrap\n",
- "|> sm'.from_std_string\n",
- "|> sm'.deserialize\n",
- "|> resultm.unwrap'\n",
- "|> fun result =>\n",
- " result\n",
- " |> mapm.get (\"extension\" |> sm'.to_std_string)\n",
- " |> optionm'.unwrap\n",
- " |> sm'.from_std_string\n",
- " |> _assert_eq \"py\"\n",
- " result\n",
- " |> mapm.get (\"output\" |> sm'.to_std_string)\n",
- " |> optionm'.unwrap\n",
- " |> sm'.from_std_string\n",
- " |> _assert_eq \"-3\"\n",
+ "|> __assert_string_contains false \"-3 \"\n",
+ "\n",
+ "$'$\"{!path}.html\"'\n",
+ "|> file_system.read_all_text\n",
+ "|> __assert_string_contains false \"\\\"cell-id=1\\\"\"\n",
"\n",
"disposable |> use |> ignore"
]
diff --git a/apps/spiral/builder/spiral_builder.fsx b/apps/spiral/builder/spiral_builder.fsx
index 58a1dc6d..262cc3df 100644
--- a/apps/spiral/builder/spiral_builder.fsx
+++ b/apps/spiral/builder/spiral_builder.fsx
@@ -421,6 +421,8 @@ type sha2_Sha256 = class end
module State = let mutable trace_state = None
type IOsEnviron = abstract environ: x: unit -> obj
type IPathJoin = abstract join: [] paths: string[] -> string
+type IFsExistsSync = abstract existsSync: path: string -> bool
+type IPathDirname = abstract dirname: path: string -> string
#if FABLE_COMPILER
[]
module System =
@@ -430,8 +432,6 @@ module System =
#endif
type ICryptoCreateHash = abstract createHash: x: string -> obj
type IHashlibSha256 = abstract sha256: x: unit -> obj
-type IFsExistsSync = abstract existsSync: path: string -> bool
-type IPathDirname = abstract dirname: path: string -> string
type Disposable (f : unit -> unit) = interface System.IDisposable with member _.Dispose () = f ()
type [] US0 =
| US0_0
@@ -458,115 +458,128 @@ and [] US4 =
and [] US5 =
| US5_0 of f0_0 : std_string_String
| US5_1
-and [] US6 =
- | US6_0 of f0_0 : (string [])
- | US6_1 of f1_0 : string
-and UH0 =
- | UH0_0
- | UH0_1 of string * UH0
-and [] US7 =
- | US7_0 of f0_0 : UH0 * f0_1 : string * f0_2 : System.Text.StringBuilder * f0_3 : int32 * f0_4 : int32
- | US7_1 of f1_0 : string
and [] US8 =
- | US8_0 of f0_0 : char * f0_1 : string * f0_2 : System.Text.StringBuilder * f0_3 : int32 * f0_4 : int32
- | US8_1 of f1_0 : string
+ | US8_0
+ | US8_1
+and [] US7 =
+ | US7_0 of f0_0 : US8
+ | US7_1
+and [] US6 =
+ | US6_0 of f0_0 : US7
+ | US6_1
and [] US9 =
- | US9_0 of f0_0 : char
+ | US9_0 of f0_0 : Vec
| US9_1
-and Mut4 = {mutable l0 : int32}
-and UH1 =
- | UH1_0
- | UH1_1 of char * UH1
and [] US10 =
- | US10_0 of f0_0 : string * f0_1 : string * f0_2 : System.Text.StringBuilder * f0_3 : int32 * f0_4 : int32
- | US10_1 of f1_0 : string
-and UH2 =
- | UH2_0
- | UH2_1 of (struct (string * System.Text.StringBuilder * int32 * int32) -> US10) * UH2
+ | US10_0
+ | US10_1
+ | US10_2
and [] US11 =
- | US11_0 of f0_0 : string * f0_1 : System.Text.StringBuilder * f0_2 : int32 * f0_3 : int32
- | US11_1 of f1_0 : string
+ | US11_0 of f0_0 : US10
+ | US11_1 of f1_0 : US10
+ | US11_2 of f2_0 : US10
+ | US11_3 of f3_0 : US10
+ | US11_4 of f4_0 : US10
and [] US12 =
- | US12_0 of f0_0 : (string [])
+ | US12_0 of f0_0 : string
| US12_1 of f1_0 : string
+and Mut4 = {mutable l0 : int32}
+and UH0 =
+ | UH0_0
+ | UH0_1 of char * UH0
+and [] US14 =
+ | US14_0
+ | US14_1
and [] US13 =
| US13_0
- | US13_1
+ | US13_1 of f1_0 : US14
| US13_2
-and [] US14 =
- | US14_0 of f0_0 : US13
- | US14_1 of f1_0 : US13
- | US14_2 of f2_0 : US13
- | US14_3 of f3_0 : US13
-and Mut5 = {mutable l0 : int32; mutable l1 : int32; mutable l2 : (string [])}
-and [] US16 =
- | US16_0
- | US16_1
and [] US15 =
- | US15_0
- | US15_1 of f1_0 : US16
- | US15_2
+ | US15_0 of f0_0 : (string [])
+ | US15_1 of f1_0 : string
+and UH1 =
+ | UH1_0
+ | UH1_1 of string * UH1
+and [] US16 =
+ | US16_0 of f0_0 : UH1 * f0_1 : string * f0_2 : System.Text.StringBuilder * f0_3 : int32 * f0_4 : int32
+ | US16_1 of f1_0 : string
and [] US17 =
- | US17_0 of f0_0 : std_sync_Arc>
- | US17_1 of f1_0 : std_string_String
+ | US17_0 of f0_0 : char * f0_1 : string * f0_2 : System.Text.StringBuilder * f0_3 : int32 * f0_4 : int32
+ | US17_1 of f1_0 : string
and [] US18 =
- | US18_0 of f0_0 : std_sync_Arc>>>
+ | US18_0 of f0_0 : char
| US18_1
and [] US19 =
- | US19_0 of f0_0 : std_string_String
- | US19_1 of f1_0 : std_string_String
+ | US19_0 of f0_0 : string * f0_1 : string * f0_2 : System.Text.StringBuilder * f0_3 : int32 * f0_4 : int32
+ | US19_1 of f1_0 : string
+and UH2 =
+ | UH2_0
+ | UH2_1 of (struct (string * System.Text.StringBuilder * int32 * int32) -> US19) * UH2
and [] US20 =
- | US20_0 of f0_0 : (std_sync_Arc> -> unit)
- | US20_1
+ | US20_0 of f0_0 : string * f0_1 : System.Text.StringBuilder * f0_2 : int32 * f0_3 : int32
+ | US20_1 of f1_0 : string
and [] US21 =
- | US21_0 of f0_0 : std_sync_Arc>
- | US21_1
+ | US21_0 of f0_0 : (string [])
+ | US21_1 of f1_0 : string
and [] US22 =
- | US22_0 of f0_0 : std_process_Output
+ | US22_0 of f0_0 : std_sync_Arc>
| US22_1 of f1_0 : std_string_String
and [] US23 =
- | US23_0 of f0_0 : (struct (bool * string * int32) -> Async)
+ | US23_0 of f0_0 : std_sync_Arc>>>
| US23_1
and [] US24 =
- | US24_0 of f0_0 : System.Threading.CancellationToken
- | US24_1
+ | US24_0 of f0_0 : std_string_String
+ | US24_1 of f1_0 : std_string_String
and [] US25 =
- | US25_0 of f0_0 : Vec
+ | US25_0 of f0_0 : (std_sync_Arc> -> unit)
| US25_1
and [] US26 =
- | US26_0
- | US26_1 of f1_0 : std_string_String
+ | US26_0 of f0_0 : std_sync_Arc>
+ | US26_1
and [] US27 =
- | US27_0 of f0_0 : chrono_DateTime
- | US27_1
+ | US27_0 of f0_0 : std_process_Output
+ | US27_1 of f1_0 : std_string_String
and [] US28 =
- | US28_0 of f0_0 : string
- | US28_1 of f1_0 : string
+ | US28_0 of f0_0 : int32
+ | US28_1
and [] US29 =
- | US29_0 of f0_0 : int32 * f0_1 : string
- | US29_1 of f1_0 : int32 * f1_1 : string
+ | US29_0 of f0_0 : (struct (bool * string * int32) -> Async)
+ | US29_1
and [] US30 =
- | US30_0 of f0_0 : std_collections_HashMap
+ | US30_0 of f0_0 : System.Threading.CancellationToken
| US30_1
+and Mut5 = {mutable l0 : int32; mutable l1 : int32; mutable l2 : (string [])}
and [] US31 =
- | US31_0 of f0_0 : US3
- | US31_1
-and UH3 =
- | UH3_0
- | UH3_1 of string * bool * UH3
+ | US31_0
+ | US31_1 of f1_0 : std_string_String
and [] US32 =
- | US32_0
+ | US32_0 of f0_0 : chrono_DateTime
| US32_1
- | US32_2
and [] US33 =
- | US33_0 of f0_0 : std_fs_FileType
- | US33_1 of f1_0 : std_string_String
+ | US33_0 of f0_0 : int32 * f0_1 : string
+ | US33_1 of f1_0 : int32 * f1_1 : string
and [] US34 =
- | US34_0 of f0_0 : async_walkdir_DirEntry
- | US34_1 of f1_0 : std_string_String
+ | US34_0 of f0_0 : std_collections_HashMap
+ | US34_1
and [] US35 =
- | US35_0 of f0_0 : string * f0_1 : string
+ | US35_0 of f0_0 : US3
| US35_1
+and UH3 =
+ | UH3_0
+ | UH3_1 of string * bool * UH3
+and [] US36 =
+ | US36_0
+ | US36_1
+ | US36_2
+and [] US37 =
+ | US37_0 of f0_0 : std_fs_FileType
+ | US37_1 of f1_0 : std_string_String
+and [] US38 =
+ | US38_0 of f0_0 : async_walkdir_DirEntry
+ | US38_1 of f1_0 : std_string_String
+and [] US39 =
+ | US39_0 of f0_0 : string * f0_1 : string
+ | US39_1
let rec method0 () : clap_Command =
let v0 : string = "command"
let v1 : string = "r#\"" + v0 + "\"#"
@@ -580,13 +593,13 @@ let rec method0 () : clap_Command =
let v9 : Ref> = Fable.Core.RustInterop.emitRustExpr () v8
let v10 : string = "clap::Command::new($0)"
let v11 : clap_Command = Fable.Core.RustInterop.emitRustExpr v9 v10
- let v12 : string = "fs-path"
+ let v12 : string = "spi-path"
let v13 : string = "r#\"" + v12 + "\"#"
let v14 : Ref> = Fable.Core.RustInterop.emitRustExpr () v13
let v15 : string = "clap::Arg::new($0)"
let v16 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v14 v15
let v17 : string = "$0.short($1)"
- let v18 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v16, 'f') v17
+ let v18 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v16, 's') v17
let v19 : string = "r#\"" + v12 + "\"#"
let v20 : Ref> = Fable.Core.RustInterop.emitRustExpr () v19
let v21 : string = "$0.long($1)"
@@ -595,257 +608,384 @@ let rec method0 () : clap_Command =
let v24 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v22, true) v23
let v25 : string = "clap::Command::arg($0, $1)"
let v26 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v11, v24) v25
- let v27 : string = "r#\"" + v0 + "\"#"
- let v28 : Ref> = Fable.Core.RustInterop.emitRustExpr () v27
- let v29 : string = "clap::Arg::new($0)"
- let v30 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v28 v29
- let v31 : string = "$0.short($1)"
- let v32 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v30, 'c') v31
- let v33 : string = "r#\"" + v0 + "\"#"
- let v34 : Ref> = Fable.Core.RustInterop.emitRustExpr () v33
- let v35 : string = "$0.long($1)"
- let v36 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v32, v34) v35
- let v37 : string = "clap::Command::arg($0, $1)"
- let v38 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v26, v36) v37
- let v39 : string = "clap::Command::subcommand($0, v38)"
- let v40 : clap_Command = Fable.Core.RustInterop.emitRustExpr v6 v39
- let v41 : string = "rust"
- let v42 : string = "r#\"" + v41 + "\"#"
- let v43 : Ref> = Fable.Core.RustInterop.emitRustExpr () v42
- let v44 : string = "clap::Command::new($0)"
- let v45 : clap_Command = Fable.Core.RustInterop.emitRustExpr v43 v44
- let v46 : string = "r#\"" + v12 + "\"#"
- let v47 : Ref> = Fable.Core.RustInterop.emitRustExpr () v46
- let v48 : string = "clap::Arg::new($0)"
- let v49 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v47 v48
- let v50 : string = "$0.short($1)"
- let v51 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v49, 'f') v50
- let v52 : string = "r#\"" + v12 + "\"#"
- let v53 : Ref> = Fable.Core.RustInterop.emitRustExpr () v52
- let v54 : string = "$0.long($1)"
- let v55 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v51, v53) v54
- let v56 : string = "$0.required($1)"
- let v57 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v55, true) v56
- let v58 : string = "clap::Command::arg($0, $1)"
- let v59 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v45, v57) v58
- let v60 : string = "NAME"
- let v61 : string = "r#\"" + v60 + "\"#"
- let v62 : Ref> = Fable.Core.RustInterop.emitRustExpr () v61
- let v63 : string = "VERSION"
- let v64 : string = "r#\"" + v63 + "\"#"
- let v65 : Ref> = Fable.Core.RustInterop.emitRustExpr () v64
- let v66 : (Ref> []) = [|v62; v65|]
- let v67 : unativeint = 1 |> unativeint
- let v68 : unativeint = 0 |> unativeint
- let v69 : bool = v68 = v68
- let v74 : clap_builder_ValueRange =
- if v69 then
- let v70 : string = "clap::builder::ValueRange::new(v67..)"
- let v71 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v70
- v71
+ let v27 : string = "clap::Command::subcommand($0, v26)"
+ let v28 : clap_Command = Fable.Core.RustInterop.emitRustExpr v6 v27
+ let v29 : string = "cuda"
+ let v30 : string = "r#\"" + v29 + "\"#"
+ let v31 : Ref> = Fable.Core.RustInterop.emitRustExpr () v30
+ let v32 : string = "clap::Command::new($0)"
+ let v33 : clap_Command = Fable.Core.RustInterop.emitRustExpr v31 v32
+ let v34 : string = "py-path"
+ let v35 : string = "r#\"" + v34 + "\"#"
+ let v36 : Ref> = Fable.Core.RustInterop.emitRustExpr () v35
+ let v37 : string = "clap::Arg::new($0)"
+ let v38 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v36 v37
+ let v39 : string = "$0.short($1)"
+ let v40 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v38, 'p') v39
+ let v41 : string = "r#\"" + v34 + "\"#"
+ let v42 : Ref> = Fable.Core.RustInterop.emitRustExpr () v41
+ let v43 : string = "$0.long($1)"
+ let v44 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v40, v42) v43
+ let v45 : string = "$0.required($1)"
+ let v46 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v44, true) v45
+ let v47 : string = "clap::Command::arg($0, $1)"
+ let v48 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v33, v46) v47
+ let v49 : string = "env"
+ let v50 : string = "r#\"" + v49 + "\"#"
+ let v51 : Ref> = Fable.Core.RustInterop.emitRustExpr () v50
+ let v52 : string = "clap::Arg::new($0)"
+ let v53 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v51 v52
+ let v54 : string = "$0.short($1)"
+ let v55 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v53, 'e') v54
+ let v56 : string = "r#\"" + v49 + "\"#"
+ let v57 : Ref> = Fable.Core.RustInterop.emitRustExpr () v56
+ let v58 : string = "$0.long($1)"
+ let v59 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v55, v57) v58
+ let v60 : string list = []
+ let v61 : string = "Poetry"
+ let v62 : string list = v61 :: v60
+ let v63 : string = "Pip"
+ let v64 : string list = v63 :: v62
+ let v65 : (string list -> (string [])) = List.toArray
+ let v66 : (string []) = v65 v64
+ let v67 : string = "$0.to_vec()"
+ let v68 : Vec = Fable.Core.RustInterop.emitRustExpr v66 v67
+ let v69 : string = "true; let _result : Vec<_> = v68.into_iter().map(|x| { //"
+ let v70 : bool = Fable.Core.RustInterop.emitRustExpr () v69
+ let v71 : string = "x"
+ let v72 : string = Fable.Core.RustInterop.emitRustExpr () v71
+ let v73 : string = "&*$0"
+ let v74 : Ref = Fable.Core.RustInterop.emitRustExpr v72 v73
+ let v75 : string = "String::from($0)"
+ let v76 : std_string_String = Fable.Core.RustInterop.emitRustExpr v74 v75
+ let v77 : string = "Box::new($0)"
+ let v78 : Box = Fable.Core.RustInterop.emitRustExpr v76 v77
+ let v79 : string = "Box::leak($0)"
+ let v80 : Ref>> = Fable.Core.RustInterop.emitRustExpr v78 v79
+ let v81 : string = "clap::builder::PossibleValue::new(&**$0)"
+ let v82 : clap_builder_PossibleValue = Fable.Core.RustInterop.emitRustExpr v80 v81
+ let v83 : string = "true; $0 }).collect::>()"
+ let v84 : bool = Fable.Core.RustInterop.emitRustExpr v82 v83
+ let v85 : string = "_result"
+ let v86 : Vec = Fable.Core.RustInterop.emitRustExpr () v85
+ let v87 : string = "Into::::into(clap::builder::PossibleValuesParser::new($0))"
+ let v88 : clap_builder_ValueParser = Fable.Core.RustInterop.emitRustExpr v86 v87
+ let v89 : string = "$0.value_parser($1)"
+ let v90 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v59, v88) v89
+ let v91 : string = "clap::Command::arg($0, $1)"
+ let v92 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v48, v90) v91
+ let v93 : string = "NAME"
+ let v94 : string = "r#\"" + v93 + "\"#"
+ let v95 : Ref> = Fable.Core.RustInterop.emitRustExpr () v94
+ let v96 : string = "VERSION"
+ let v97 : string = "r#\"" + v96 + "\"#"
+ let v98 : Ref> = Fable.Core.RustInterop.emitRustExpr () v97
+ let v99 : (Ref> []) = [|v95; v98|]
+ let v100 : unativeint = 1 |> unativeint
+ let v101 : unativeint = 0 |> unativeint
+ let v102 : bool = v101 = v101
+ let v107 : clap_builder_ValueRange =
+ if v102 then
+ let v103 : string = "clap::builder::ValueRange::new(v100..)"
+ let v104 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v103
+ v104
else
- let v72 : string = "clap::builder::ValueRange::new(v67..v68)"
- let v73 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v72
- v73
- let v75 : string = "deps"
- let v76 : string = "r#\"" + v75 + "\"#"
- let v77 : Ref> = Fable.Core.RustInterop.emitRustExpr () v76
- let v78 : string = "clap::Arg::new($0)"
- let v79 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v77 v78
- let v80 : string = "$0.short($1)"
- let v81 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v79, 'd') v80
- let v82 : string = "r#\"" + v75 + "\"#"
- let v83 : Ref> = Fable.Core.RustInterop.emitRustExpr () v82
- let v84 : string = "$0.long($1)"
- let v85 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v81, v83) v84
- let v86 : string = "$0.to_vec()"
- let v87 : Vec>> = Fable.Core.RustInterop.emitRustExpr v66 v86
- let v88 : string = "$0.value_names($1)"
- let v89 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v85, v87) v88
- let v90 : string = "$0.num_args($1)"
- let v91 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v89, v74) v90
- let v92 : string = "clap::ArgAction::Append"
- let v93 : clap_ArgAction = Fable.Core.RustInterop.emitRustExpr () v92
- let v94 : string = "$0.action($1)"
- let v95 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v91, v93) v94
- let v96 : string = "clap::Command::arg($0, $1)"
- let v97 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v59, v95) v96
- let v98 : string = "clap::Command::subcommand($0, v97)"
- let v99 : clap_Command = Fable.Core.RustInterop.emitRustExpr v40 v98
- let v100 : string = "dib"
- let v101 : string = "r#\"" + v100 + "\"#"
- let v102 : Ref> = Fable.Core.RustInterop.emitRustExpr () v101
- let v103 : string = "clap::Command::new($0)"
- let v104 : clap_Command = Fable.Core.RustInterop.emitRustExpr v102 v103
- let v105 : string = "path"
- let v106 : string = "r#\"" + v105 + "\"#"
- let v107 : Ref> = Fable.Core.RustInterop.emitRustExpr () v106
- let v108 : string = "clap::Arg::new($0)"
- let v109 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v107 v108
- let v110 : string = "$0.short($1)"
- let v111 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v109, 'p') v110
- let v112 : string = "r#\"" + v105 + "\"#"
- let v113 : Ref> = Fable.Core.RustInterop.emitRustExpr () v112
- let v114 : string = "$0.long($1)"
- let v115 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v111, v113) v114
- let v116 : string = "$0.required($1)"
- let v117 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v115, true) v116
- let v118 : string = "clap::Command::arg($0, $1)"
- let v119 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v104, v117) v118
- let v120 : string = "u8"
- let v121 : string = "clap::value_parser!(" + v120 + ").into()"
- let v122 : clap_builder_ValueParser = Fable.Core.RustInterop.emitRustExpr () v121
- let v123 : string = "retries"
- let v124 : string = "r#\"" + v123 + "\"#"
- let v125 : Ref> = Fable.Core.RustInterop.emitRustExpr () v124
- let v126 : string = "clap::Arg::new($0)"
- let v127 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v125 v126
- let v128 : string = "$0.short($1)"
- let v129 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v127, 'r') v128
- let v130 : string = "r#\"" + v123 + "\"#"
- let v131 : Ref> = Fable.Core.RustInterop.emitRustExpr () v130
- let v132 : string = "$0.long($1)"
- let v133 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v129, v131) v132
- let v134 : string = "$0.value_parser($1)"
- let v135 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v133, v122) v134
- let v136 : string = "clap::Command::arg($0, $1)"
- let v137 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v119, v135) v136
- let v138 : string = "working-directory"
+ let v105 : string = "clap::builder::ValueRange::new(v100..v101)"
+ let v106 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v105
+ v106
+ let v108 : string = "deps"
+ let v109 : string = "r#\"" + v108 + "\"#"
+ let v110 : Ref> = Fable.Core.RustInterop.emitRustExpr () v109
+ let v111 : string = "clap::Arg::new($0)"
+ let v112 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v110 v111
+ let v113 : string = "$0.short($1)"
+ let v114 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v112, 'd') v113
+ let v115 : string = "r#\"" + v108 + "\"#"
+ let v116 : Ref> = Fable.Core.RustInterop.emitRustExpr () v115
+ let v117 : string = "$0.long($1)"
+ let v118 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v114, v116) v117
+ let v119 : string = "$0.to_vec()"
+ let v120 : Vec>> = Fable.Core.RustInterop.emitRustExpr v99 v119
+ let v121 : string = "$0.value_names($1)"
+ let v122 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v118, v120) v121
+ let v123 : string = "$0.num_args($1)"
+ let v124 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v122, v107) v123
+ let v125 : string = "clap::ArgAction::Append"
+ let v126 : clap_ArgAction = Fable.Core.RustInterop.emitRustExpr () v125
+ let v127 : string = "$0.action($1)"
+ let v128 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v124, v126) v127
+ let v129 : string = "clap::Command::arg($0, $1)"
+ let v130 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v92, v128) v129
+ let v131 : string = "clap::Command::subcommand($0, v130)"
+ let v132 : clap_Command = Fable.Core.RustInterop.emitRustExpr v28 v131
+ let v133 : string = "fable"
+ let v134 : string = "r#\"" + v133 + "\"#"
+ let v135 : Ref> = Fable.Core.RustInterop.emitRustExpr () v134
+ let v136 : string = "clap::Command::new($0)"
+ let v137 : clap_Command = Fable.Core.RustInterop.emitRustExpr v135 v136
+ let v138 : string = "fs-path"
let v139 : string = "r#\"" + v138 + "\"#"
let v140 : Ref> = Fable.Core.RustInterop.emitRustExpr () v139
let v141 : string = "clap::Arg::new($0)"
let v142 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v140 v141
let v143 : string = "$0.short($1)"
- let v144 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v142, 'w') v143
+ let v144 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v142, 'f') v143
let v145 : string = "r#\"" + v138 + "\"#"
let v146 : Ref> = Fable.Core.RustInterop.emitRustExpr () v145
let v147 : string = "$0.long($1)"
let v148 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v144, v146) v147
- let v149 : string = "clap::Command::arg($0, $1)"
- let v150 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v137, v148) v149
- let v151 : string = "clap::Command::subcommand($0, v150)"
- let v152 : clap_Command = Fable.Core.RustInterop.emitRustExpr v99 v151
- let v153 : string = "typescript"
- let v154 : string = "r#\"" + v153 + "\"#"
- let v155 : Ref> = Fable.Core.RustInterop.emitRustExpr () v154
- let v156 : string = "clap::Command::new($0)"
- let v157 : clap_Command = Fable.Core.RustInterop.emitRustExpr v155 v156
- let v158 : string = "r#\"" + v12 + "\"#"
- let v159 : Ref> = Fable.Core.RustInterop.emitRustExpr () v158
- let v160 : string = "clap::Arg::new($0)"
- let v161 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v159 v160
- let v162 : string = "$0.short($1)"
- let v163 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v161, 'f') v162
- let v164 : string = "r#\"" + v12 + "\"#"
- let v165 : Ref> = Fable.Core.RustInterop.emitRustExpr () v164
- let v166 : string = "$0.long($1)"
- let v167 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v163, v165) v166
- let v168 : string = "$0.required($1)"
- let v169 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v167, true) v168
- let v170 : string = "clap::Command::arg($0, $1)"
- let v171 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v157, v169) v170
- let v172 : string = "r#\"" + v60 + "\"#"
+ let v149 : string = "$0.required($1)"
+ let v150 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v148, true) v149
+ let v151 : string = "clap::Command::arg($0, $1)"
+ let v152 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v137, v150) v151
+ let v153 : string = "r#\"" + v0 + "\"#"
+ let v154 : Ref> = Fable.Core.RustInterop.emitRustExpr () v153
+ let v155 : string = "clap::Arg::new($0)"
+ let v156 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v154 v155
+ let v157 : string = "$0.short($1)"
+ let v158 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v156, 'c') v157
+ let v159 : string = "r#\"" + v0 + "\"#"
+ let v160 : Ref> = Fable.Core.RustInterop.emitRustExpr () v159
+ let v161 : string = "$0.long($1)"
+ let v162 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v158, v160) v161
+ let v163 : string = "clap::Command::arg($0, $1)"
+ let v164 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v152, v162) v163
+ let v165 : string = "clap::Command::subcommand($0, v164)"
+ let v166 : clap_Command = Fable.Core.RustInterop.emitRustExpr v132 v165
+ let v167 : string = "rust"
+ let v168 : string = "r#\"" + v167 + "\"#"
+ let v169 : Ref> = Fable.Core.RustInterop.emitRustExpr () v168
+ let v170 : string = "clap::Command::new($0)"
+ let v171 : clap_Command = Fable.Core.RustInterop.emitRustExpr v169 v170
+ let v172 : string = "r#\"" + v138 + "\"#"
let v173 : Ref> = Fable.Core.RustInterop.emitRustExpr () v172
- let v174 : string = "r#\"" + v63 + "\"#"
- let v175 : Ref> = Fable.Core.RustInterop.emitRustExpr () v174
- let v176 : (Ref> []) = [|v173; v175|]
- let v177 : unativeint = 1 |> unativeint
- let v178 : unativeint = 0 |> unativeint
- let v179 : bool = v178 = v178
- let v184 : clap_builder_ValueRange =
- if v179 then
- let v180 : string = "clap::builder::ValueRange::new(v177..)"
- let v181 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v180
- v181
+ let v174 : string = "clap::Arg::new($0)"
+ let v175 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v173 v174
+ let v176 : string = "$0.short($1)"
+ let v177 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v175, 'f') v176
+ let v178 : string = "r#\"" + v138 + "\"#"
+ let v179 : Ref> = Fable.Core.RustInterop.emitRustExpr () v178
+ let v180 : string = "$0.long($1)"
+ let v181 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v177, v179) v180
+ let v182 : string = "$0.required($1)"
+ let v183 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v181, true) v182
+ let v184 : string = "clap::Command::arg($0, $1)"
+ let v185 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v171, v183) v184
+ let v186 : string = "r#\"" + v93 + "\"#"
+ let v187 : Ref> = Fable.Core.RustInterop.emitRustExpr () v186
+ let v188 : string = "r#\"" + v96 + "\"#"
+ let v189 : Ref> = Fable.Core.RustInterop.emitRustExpr () v188
+ let v190 : (Ref> []) = [|v187; v189|]
+ let v191 : unativeint = 1 |> unativeint
+ let v192 : unativeint = 0 |> unativeint
+ let v193 : bool = v192 = v192
+ let v198 : clap_builder_ValueRange =
+ if v193 then
+ let v194 : string = "clap::builder::ValueRange::new(v191..)"
+ let v195 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v194
+ v195
else
- let v182 : string = "clap::builder::ValueRange::new(v177..v178)"
- let v183 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v182
- v183
- let v185 : string = "r#\"" + v75 + "\"#"
- let v186 : Ref> = Fable.Core.RustInterop.emitRustExpr () v185
- let v187 : string = "clap::Arg::new($0)"
- let v188 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v186 v187
- let v189 : string = "$0.short($1)"
- let v190 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v188, 'd') v189
- let v191 : string = "r#\"" + v75 + "\"#"
- let v192 : Ref> = Fable.Core.RustInterop.emitRustExpr () v191
- let v193 : string = "$0.long($1)"
- let v194 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v190, v192) v193
- let v195 : string = "$0.to_vec()"
- let v196 : Vec>> = Fable.Core.RustInterop.emitRustExpr v176 v195
- let v197 : string = "$0.value_names($1)"
- let v198 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v194, v196) v197
- let v199 : string = "$0.num_args($1)"
- let v200 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v198, v184) v199
- let v201 : string = "clap::ArgAction::Append"
- let v202 : clap_ArgAction = Fable.Core.RustInterop.emitRustExpr () v201
- let v203 : string = "$0.action($1)"
- let v204 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v200, v202) v203
- let v205 : string = "clap::Command::arg($0, $1)"
- let v206 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v171, v204) v205
- let v207 : string = "clap::Command::subcommand($0, v206)"
- let v208 : clap_Command = Fable.Core.RustInterop.emitRustExpr v152 v207
- let v209 : string = "python"
- let v210 : string = "r#\"" + v209 + "\"#"
- let v211 : Ref> = Fable.Core.RustInterop.emitRustExpr () v210
- let v212 : string = "clap::Command::new($0)"
- let v213 : clap_Command = Fable.Core.RustInterop.emitRustExpr v211 v212
- let v214 : string = "r#\"" + v12 + "\"#"
- let v215 : Ref> = Fable.Core.RustInterop.emitRustExpr () v214
- let v216 : string = "clap::Arg::new($0)"
- let v217 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v215 v216
- let v218 : string = "$0.short($1)"
- let v219 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v217, 'f') v218
- let v220 : string = "r#\"" + v12 + "\"#"
- let v221 : Ref> = Fable.Core.RustInterop.emitRustExpr () v220
- let v222 : string = "$0.long($1)"
- let v223 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v219, v221) v222
- let v224 : string = "$0.required($1)"
- let v225 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v223, true) v224
- let v226 : string = "clap::Command::arg($0, $1)"
- let v227 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v213, v225) v226
- let v228 : string = "r#\"" + v60 + "\"#"
+ let v196 : string = "clap::builder::ValueRange::new(v191..v192)"
+ let v197 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v196
+ v197
+ let v199 : string = "r#\"" + v108 + "\"#"
+ let v200 : Ref> = Fable.Core.RustInterop.emitRustExpr () v199
+ let v201 : string = "clap::Arg::new($0)"
+ let v202 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v200 v201
+ let v203 : string = "$0.short($1)"
+ let v204 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v202, 'd') v203
+ let v205 : string = "r#\"" + v108 + "\"#"
+ let v206 : Ref> = Fable.Core.RustInterop.emitRustExpr () v205
+ let v207 : string = "$0.long($1)"
+ let v208 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v204, v206) v207
+ let v209 : string = "$0.to_vec()"
+ let v210 : Vec>> = Fable.Core.RustInterop.emitRustExpr v190 v209
+ let v211 : string = "$0.value_names($1)"
+ let v212 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v208, v210) v211
+ let v213 : string = "$0.num_args($1)"
+ let v214 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v212, v198) v213
+ let v215 : string = "clap::ArgAction::Append"
+ let v216 : clap_ArgAction = Fable.Core.RustInterop.emitRustExpr () v215
+ let v217 : string = "$0.action($1)"
+ let v218 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v214, v216) v217
+ let v219 : string = "clap::Command::arg($0, $1)"
+ let v220 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v185, v218) v219
+ let v221 : string = "clap::Command::subcommand($0, v220)"
+ let v222 : clap_Command = Fable.Core.RustInterop.emitRustExpr v166 v221
+ let v223 : string = "typescript"
+ let v224 : string = "r#\"" + v223 + "\"#"
+ let v225 : Ref> = Fable.Core.RustInterop.emitRustExpr () v224
+ let v226 : string = "clap::Command::new($0)"
+ let v227 : clap_Command = Fable.Core.RustInterop.emitRustExpr v225 v226
+ let v228 : string = "r#\"" + v138 + "\"#"
let v229 : Ref> = Fable.Core.RustInterop.emitRustExpr () v228
- let v230 : string = "r#\"" + v63 + "\"#"
- let v231 : Ref> = Fable.Core.RustInterop.emitRustExpr () v230
- let v232 : (Ref> []) = [|v229; v231|]
- let v233 : unativeint = 1 |> unativeint
- let v234 : unativeint = 0 |> unativeint
- let v235 : bool = v234 = v234
- let v240 : clap_builder_ValueRange =
- if v235 then
- let v236 : string = "clap::builder::ValueRange::new(v233..)"
- let v237 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v236
- v237
+ let v230 : string = "clap::Arg::new($0)"
+ let v231 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v229 v230
+ let v232 : string = "$0.short($1)"
+ let v233 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v231, 'f') v232
+ let v234 : string = "r#\"" + v138 + "\"#"
+ let v235 : Ref> = Fable.Core.RustInterop.emitRustExpr () v234
+ let v236 : string = "$0.long($1)"
+ let v237 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v233, v235) v236
+ let v238 : string = "$0.required($1)"
+ let v239 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v237, true) v238
+ let v240 : string = "clap::Command::arg($0, $1)"
+ let v241 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v227, v239) v240
+ let v242 : string = "r#\"" + v93 + "\"#"
+ let v243 : Ref> = Fable.Core.RustInterop.emitRustExpr () v242
+ let v244 : string = "r#\"" + v96 + "\"#"
+ let v245 : Ref> = Fable.Core.RustInterop.emitRustExpr () v244
+ let v246 : (Ref> []) = [|v243; v245|]
+ let v247 : unativeint = 1 |> unativeint
+ let v248 : unativeint = 0 |> unativeint
+ let v249 : bool = v248 = v248
+ let v254 : clap_builder_ValueRange =
+ if v249 then
+ let v250 : string = "clap::builder::ValueRange::new(v247..)"
+ let v251 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v250
+ v251
else
- let v238 : string = "clap::builder::ValueRange::new(v233..v234)"
- let v239 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v238
- v239
- let v241 : string = "r#\"" + v75 + "\"#"
- let v242 : Ref> = Fable.Core.RustInterop.emitRustExpr () v241
- let v243 : string = "clap::Arg::new($0)"
- let v244 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v242 v243
- let v245 : string = "$0.short($1)"
- let v246 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v244, 'd') v245
- let v247 : string = "r#\"" + v75 + "\"#"
- let v248 : Ref> = Fable.Core.RustInterop.emitRustExpr () v247
- let v249 : string = "$0.long($1)"
- let v250 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v246, v248) v249
- let v251 : string = "$0.to_vec()"
- let v252 : Vec>> = Fable.Core.RustInterop.emitRustExpr v232 v251
- let v253 : string = "$0.value_names($1)"
- let v254 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v250, v252) v253
- let v255 : string = "$0.num_args($1)"
- let v256 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v254, v240) v255
- let v257 : string = "clap::ArgAction::Append"
- let v258 : clap_ArgAction = Fable.Core.RustInterop.emitRustExpr () v257
- let v259 : string = "$0.action($1)"
- let v260 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v256, v258) v259
- let v261 : string = "clap::Command::arg($0, $1)"
- let v262 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v227, v260) v261
- let v263 : string = "clap::Command::subcommand($0, v262)"
- let v264 : clap_Command = Fable.Core.RustInterop.emitRustExpr v208 v263
- v264
+ let v252 : string = "clap::builder::ValueRange::new(v247..v248)"
+ let v253 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v252
+ v253
+ let v255 : string = "r#\"" + v108 + "\"#"
+ let v256 : Ref> = Fable.Core.RustInterop.emitRustExpr () v255
+ let v257 : string = "clap::Arg::new($0)"
+ let v258 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v256 v257
+ let v259 : string = "$0.short($1)"
+ let v260 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v258, 'd') v259
+ let v261 : string = "r#\"" + v108 + "\"#"
+ let v262 : Ref> = Fable.Core.RustInterop.emitRustExpr () v261
+ let v263 : string = "$0.long($1)"
+ let v264 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v260, v262) v263
+ let v265 : string = "$0.to_vec()"
+ let v266 : Vec>> = Fable.Core.RustInterop.emitRustExpr v246 v265
+ let v267 : string = "$0.value_names($1)"
+ let v268 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v264, v266) v267
+ let v269 : string = "$0.num_args($1)"
+ let v270 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v268, v254) v269
+ let v271 : string = "clap::ArgAction::Append"
+ let v272 : clap_ArgAction = Fable.Core.RustInterop.emitRustExpr () v271
+ let v273 : string = "$0.action($1)"
+ let v274 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v270, v272) v273
+ let v275 : string = "clap::Command::arg($0, $1)"
+ let v276 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v241, v274) v275
+ let v277 : string = "clap::Command::subcommand($0, v276)"
+ let v278 : clap_Command = Fable.Core.RustInterop.emitRustExpr v222 v277
+ let v279 : string = "python"
+ let v280 : string = "r#\"" + v279 + "\"#"
+ let v281 : Ref> = Fable.Core.RustInterop.emitRustExpr () v280
+ let v282 : string = "clap::Command::new($0)"
+ let v283 : clap_Command = Fable.Core.RustInterop.emitRustExpr v281 v282
+ let v284 : string = "r#\"" + v138 + "\"#"
+ let v285 : Ref> = Fable.Core.RustInterop.emitRustExpr () v284
+ let v286 : string = "clap::Arg::new($0)"
+ let v287 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v285 v286
+ let v288 : string = "$0.short($1)"
+ let v289 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v287, 'f') v288
+ let v290 : string = "r#\"" + v138 + "\"#"
+ let v291 : Ref> = Fable.Core.RustInterop.emitRustExpr () v290
+ let v292 : string = "$0.long($1)"
+ let v293 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v289, v291) v292
+ let v294 : string = "$0.required($1)"
+ let v295 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v293, true) v294
+ let v296 : string = "clap::Command::arg($0, $1)"
+ let v297 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v283, v295) v296
+ let v298 : string = "r#\"" + v93 + "\"#"
+ let v299 : Ref> = Fable.Core.RustInterop.emitRustExpr () v298
+ let v300 : string = "r#\"" + v96 + "\"#"
+ let v301 : Ref> = Fable.Core.RustInterop.emitRustExpr () v300
+ let v302 : (Ref> []) = [|v299; v301|]
+ let v303 : unativeint = 1 |> unativeint
+ let v304 : unativeint = 0 |> unativeint
+ let v305 : bool = v304 = v304
+ let v310 : clap_builder_ValueRange =
+ if v305 then
+ let v306 : string = "clap::builder::ValueRange::new(v303..)"
+ let v307 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v306
+ v307
+ else
+ let v308 : string = "clap::builder::ValueRange::new(v303..v304)"
+ let v309 : clap_builder_ValueRange = Fable.Core.RustInterop.emitRustExpr () v308
+ v309
+ let v311 : string = "r#\"" + v108 + "\"#"
+ let v312 : Ref> = Fable.Core.RustInterop.emitRustExpr () v311
+ let v313 : string = "clap::Arg::new($0)"
+ let v314 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v312 v313
+ let v315 : string = "$0.short($1)"
+ let v316 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v314, 'd') v315
+ let v317 : string = "r#\"" + v108 + "\"#"
+ let v318 : Ref> = Fable.Core.RustInterop.emitRustExpr () v317
+ let v319 : string = "$0.long($1)"
+ let v320 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v316, v318) v319
+ let v321 : string = "$0.to_vec()"
+ let v322 : Vec>> = Fable.Core.RustInterop.emitRustExpr v302 v321
+ let v323 : string = "$0.value_names($1)"
+ let v324 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v320, v322) v323
+ let v325 : string = "$0.num_args($1)"
+ let v326 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v324, v310) v325
+ let v327 : string = "clap::ArgAction::Append"
+ let v328 : clap_ArgAction = Fable.Core.RustInterop.emitRustExpr () v327
+ let v329 : string = "$0.action($1)"
+ let v330 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v326, v328) v329
+ let v331 : string = "clap::Command::arg($0, $1)"
+ let v332 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v297, v330) v331
+ let v333 : string = "clap::Command::subcommand($0, v332)"
+ let v334 : clap_Command = Fable.Core.RustInterop.emitRustExpr v278 v333
+ let v335 : string = "dib"
+ let v336 : string = "r#\"" + v335 + "\"#"
+ let v337 : Ref> = Fable.Core.RustInterop.emitRustExpr () v336
+ let v338 : string = "clap::Command::new($0)"
+ let v339 : clap_Command = Fable.Core.RustInterop.emitRustExpr v337 v338
+ let v340 : string = "path"
+ let v341 : string = "r#\"" + v340 + "\"#"
+ let v342 : Ref> = Fable.Core.RustInterop.emitRustExpr () v341
+ let v343 : string = "clap::Arg::new($0)"
+ let v344 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v342 v343
+ let v345 : string = "$0.short($1)"
+ let v346 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v344, 'p') v345
+ let v347 : string = "r#\"" + v340 + "\"#"
+ let v348 : Ref> = Fable.Core.RustInterop.emitRustExpr () v347
+ let v349 : string = "$0.long($1)"
+ let v350 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v346, v348) v349
+ let v351 : string = "$0.required($1)"
+ let v352 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v350, true) v351
+ let v353 : string = "clap::Command::arg($0, $1)"
+ let v354 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v339, v352) v353
+ let v355 : string = "u8"
+ let v356 : string = "clap::value_parser!(" + v355 + ").into()"
+ let v357 : clap_builder_ValueParser = Fable.Core.RustInterop.emitRustExpr () v356
+ let v358 : string = "retries"
+ let v359 : string = "r#\"" + v358 + "\"#"
+ let v360 : Ref> = Fable.Core.RustInterop.emitRustExpr () v359
+ let v361 : string = "clap::Arg::new($0)"
+ let v362 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v360 v361
+ let v363 : string = "$0.short($1)"
+ let v364 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v362, 'r') v363
+ let v365 : string = "r#\"" + v358 + "\"#"
+ let v366 : Ref> = Fable.Core.RustInterop.emitRustExpr () v365
+ let v367 : string = "$0.long($1)"
+ let v368 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v364, v366) v367
+ let v369 : string = "$0.value_parser($1)"
+ let v370 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v368, v357) v369
+ let v371 : string = "clap::Command::arg($0, $1)"
+ let v372 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v354, v370) v371
+ let v373 : string = "working-directory"
+ let v374 : string = "r#\"" + v373 + "\"#"
+ let v375 : Ref> = Fable.Core.RustInterop.emitRustExpr () v374
+ let v376 : string = "clap::Arg::new($0)"
+ let v377 : clap_Arg = Fable.Core.RustInterop.emitRustExpr v375 v376
+ let v378 : string = "$0.short($1)"
+ let v379 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v377, 'w') v378
+ let v380 : string = "r#\"" + v373 + "\"#"
+ let v381 : Ref> = Fable.Core.RustInterop.emitRustExpr () v380
+ let v382 : string = "$0.long($1)"
+ let v383 : clap_Arg = Fable.Core.RustInterop.emitRustExpr struct (v379, v381) v382
+ let v384 : string = "clap::Command::arg($0, $1)"
+ let v385 : clap_Command = Fable.Core.RustInterop.emitRustExpr struct (v372, v383) v384
+ let v386 : string = "clap::Command::subcommand($0, v385)"
+ let v387 : clap_Command = Fable.Core.RustInterop.emitRustExpr v334 v386
+ v387
and closure0 () () : unit =
let v0 : string = "true; () //"
let v1 : bool = Fable.Core.RustInterop.emitRustExpr () v0
@@ -927,7 +1067,7 @@ and method2 (v0 : string) : string =
v46
#endif
#if FABLE_COMPILER_TYPESCRIPT
- let v47 : string = "process.env[$0]"
+ let v47 : string = "process.env[$0] ?? \"\""
let v48 : string = Fable.Core.JsInterop.emitJsExpr v0 v47
v48
#endif
@@ -995,207 +1135,327 @@ and closure2 () (v0 : US0) : struct (Mut0 * Mut1 * Mut2 * int64 option * Mut3) =
#if FABLE_COMPILER_RUST && !WASM && !CONTRACT
let v2 : string = method1()
let v3 : string = method2(v2)
- let v4 : bool = "Verbose" = v3
- let v24 : US2 =
- if v4 then
- let v5 : US0 = US0_0
- US2_0(v5)
+ let v5 : bool = "Verbose" = v3
+ let v9 : US2 =
+ if v5 then
+ let v6 : US0 = US0_0
+ US2_0(v6)
else
- let v7 : bool = "Debug" = v3
- if v7 then
- let v8 : US0 = US0_1
- US2_0(v8)
- else
- let v10 : bool = "Info" = v3
- if v10 then
- let v11 : US0 = US0_2
- US2_0(v11)
+ US2_1
+ let v54 : US2 =
+ match v9 with
+ | US2_1 -> (* None *)
+ let v13 : bool = "Debug" = v3
+ let v17 : US2 =
+ if v13 then
+ let v14 : US0 = US0_1
+ US2_0(v14)
else
- let v13 : bool = "Warning" = v3
- if v13 then
- let v14 : US0 = US0_3
- US2_0(v14)
+ US2_1
+ match v17 with
+ | US2_1 -> (* None *)
+ let v21 : bool = "Info" = v3
+ let v25 : US2 =
+ if v21 then
+ let v22 : US0 = US0_2
+ US2_0(v22)
else
- let v16 : bool = "Critical" = v3
- if v16 then
- let v17 : US0 = US0_4
- US2_0(v17)
+ US2_1
+ match v25 with
+ | US2_1 -> (* None *)
+ let v29 : bool = "Warning" = v3
+ let v33 : US2 =
+ if v29 then
+ let v30 : US0 = US0_3
+ US2_0(v30)
else
US2_1
- let v25 : string = method4()
- let v26 : string = method2(v25)
- let v28 : bool = v26 = "True"
- let v34 : US1 =
- if v28 then
- let v29 : System.DateTime = System.DateTime.Now
- let v30 : (System.DateTime -> int64) = _.Ticks
- let v31 : int64 = v30 v29
- US1_0(v31)
+ match v33 with
+ | US2_1 -> (* None *)
+ let v37 : bool = "Critical" = v3
+ let v41 : US2 =
+ if v37 then
+ let v38 : US0 = US0_4
+ US2_0(v38)
+ else
+ US2_1
+ match v41 with
+ | US2_1 -> (* None *)
+ US2_1
+ | US2_0(v42) -> (* Some *)
+ US2_0(v42)
+ | US2_0(v34) -> (* Some *)
+ US2_0(v34)
+ | US2_0(v26) -> (* Some *)
+ US2_0(v26)
+ | US2_0(v18) -> (* Some *)
+ US2_0(v18)
+ | US2_0(v10) -> (* Some *)
+ US2_0(v10)
+ let v55 : string = method4()
+ let v56 : string = method2(v55)
+ let v58 : bool = v56 = "True"
+ let v64 : US1 =
+ if v58 then
+ let v59 : System.DateTime = System.DateTime.Now
+ let v60 : (System.DateTime -> int64) = _.Ticks
+ let v61 : int64 = v60 v59
+ US1_0(v61)
else
US1_1
- struct (v34, v24)
+ struct (v64, v54)
#endif
#if FABLE_COMPILER_RUST && WASM
- let v35 : US1 = US1_1
- let v36 : US2 = US2_1
- struct (v35, v36)
+ let v65 : US1 = US1_1
+ let v66 : US2 = US2_1
+ struct (v65, v66)
#endif
#if FABLE_COMPILER_RUST && CONTRACT
- let v37 : US1 = US1_1
- let v38 : US2 = US2_1
- struct (v37, v38)
+ let v67 : US1 = US1_1
+ let v68 : US2 = US2_1
+ struct (v67, v68)
#endif
#if FABLE_COMPILER_TYPESCRIPT
- let v39 : string = method1()
- let v40 : string = method2(v39)
- let v41 : bool = "Verbose" = v40
- let v61 : US2 =
- if v41 then
- let v42 : US0 = US0_0
- US2_0(v42)
+ let v69 : string = method1()
+ let v70 : string = method2(v69)
+ let v72 : bool = "Verbose" = v70
+ let v76 : US2 =
+ if v72 then
+ let v73 : US0 = US0_0
+ US2_0(v73)
else
- let v44 : bool = "Debug" = v40
- if v44 then
- let v45 : US0 = US0_1
- US2_0(v45)
- else
- let v47 : bool = "Info" = v40
- if v47 then
- let v48 : US0 = US0_2
- US2_0(v48)
+ US2_1
+ let v121 : US2 =
+ match v76 with
+ | US2_1 -> (* None *)
+ let v80 : bool = "Debug" = v70
+ let v84 : US2 =
+ if v80 then
+ let v81 : US0 = US0_1
+ US2_0(v81)
else
- let v50 : bool = "Warning" = v40
- if v50 then
- let v51 : US0 = US0_3
- US2_0(v51)
+ US2_1
+ match v84 with
+ | US2_1 -> (* None *)
+ let v88 : bool = "Info" = v70
+ let v92 : US2 =
+ if v88 then
+ let v89 : US0 = US0_2
+ US2_0(v89)
else
- let v53 : bool = "Critical" = v40
- if v53 then
- let v54 : US0 = US0_4
- US2_0(v54)
+ US2_1
+ match v92 with
+ | US2_1 -> (* None *)
+ let v96 : bool = "Warning" = v70
+ let v100 : US2 =
+ if v96 then
+ let v97 : US0 = US0_3
+ US2_0(v97)
else
US2_1
- let v62 : string = method4()
- let v63 : string = method2(v62)
- let v65 : bool = v63 = "True"
- let v71 : US1 =
- if v65 then
- let v66 : System.DateTime = System.DateTime.Now
- let v67 : (System.DateTime -> int64) = _.Ticks
- let v68 : int64 = v67 v66
- US1_0(v68)
+ match v100 with
+ | US2_1 -> (* None *)
+ let v104 : bool = "Critical" = v70
+ let v108 : US2 =
+ if v104 then
+ let v105 : US0 = US0_4
+ US2_0(v105)
+ else
+ US2_1
+ match v108 with
+ | US2_1 -> (* None *)
+ US2_1
+ | US2_0(v109) -> (* Some *)
+ US2_0(v109)
+ | US2_0(v101) -> (* Some *)
+ US2_0(v101)
+ | US2_0(v93) -> (* Some *)
+ US2_0(v93)
+ | US2_0(v85) -> (* Some *)
+ US2_0(v85)
+ | US2_0(v77) -> (* Some *)
+ US2_0(v77)
+ let v122 : string = method4()
+ let v123 : string = method2(v122)
+ let v125 : bool = v123 = "True"
+ let v131 : US1 =
+ if v125 then
+ let v126 : System.DateTime = System.DateTime.Now
+ let v127 : (System.DateTime -> int64) = _.Ticks
+ let v128 : int64 = v127 v126
+ US1_0(v128)
else
US1_1
- struct (v71, v61)
+ struct (v131, v121)
#endif
#if FABLE_COMPILER_PYTHON
- let v72 : string = method1()
- let v73 : string = method2(v72)
- let v74 : bool = "Verbose" = v73
- let v94 : US2 =
- if v74 then
- let v75 : US0 = US0_0
- US2_0(v75)
+ let v132 : string = method1()
+ let v133 : string = method2(v132)
+ let v135 : bool = "Verbose" = v133
+ let v139 : US2 =
+ if v135 then
+ let v136 : US0 = US0_0
+ US2_0(v136)
else
- let v77 : bool = "Debug" = v73
- if v77 then
- let v78 : US0 = US0_1
- US2_0(v78)
- else
- let v80 : bool = "Info" = v73
- if v80 then
- let v81 : US0 = US0_2
- US2_0(v81)
+ US2_1
+ let v184 : US2 =
+ match v139 with
+ | US2_1 -> (* None *)
+ let v143 : bool = "Debug" = v133
+ let v147 : US2 =
+ if v143 then
+ let v144 : US0 = US0_1
+ US2_0(v144)
else
- let v83 : bool = "Warning" = v73
- if v83 then
- let v84 : US0 = US0_3
- US2_0(v84)
+ US2_1
+ match v147 with
+ | US2_1 -> (* None *)
+ let v151 : bool = "Info" = v133
+ let v155 : US2 =
+ if v151 then
+ let v152 : US0 = US0_2
+ US2_0(v152)
else
- let v86 : bool = "Critical" = v73
- if v86 then
- let v87 : US0 = US0_4
- US2_0(v87)
+ US2_1
+ match v155 with
+ | US2_1 -> (* None *)
+ let v159 : bool = "Warning" = v133
+ let v163 : US2 =
+ if v159 then
+ let v160 : US0 = US0_3
+ US2_0(v160)
else
US2_1
- let v95 : string = method4()
- let v96 : string = method2(v95)
- let v98 : bool = v96 = "True"
- let v104 : US1 =
- if v98 then
- let v99 : System.DateTime = System.DateTime.Now
- let v100 : (System.DateTime -> int64) = _.Ticks
- let v101 : int64 = v100 v99
- US1_0(v101)
+ match v163 with
+ | US2_1 -> (* None *)
+ let v167 : bool = "Critical" = v133
+ let v171 : US2 =
+ if v167 then
+ let v168 : US0 = US0_4
+ US2_0(v168)
+ else
+ US2_1
+ match v171 with
+ | US2_1 -> (* None *)
+ US2_1
+ | US2_0(v172) -> (* Some *)
+ US2_0(v172)
+ | US2_0(v164) -> (* Some *)
+ US2_0(v164)
+ | US2_0(v156) -> (* Some *)
+ US2_0(v156)
+ | US2_0(v148) -> (* Some *)
+ US2_0(v148)
+ | US2_0(v140) -> (* Some *)
+ US2_0(v140)
+ let v185 : string = method4()
+ let v186 : string = method2(v185)
+ let v188 : bool = v186 = "True"
+ let v194 : US1 =
+ if v188 then
+ let v189 : System.DateTime = System.DateTime.Now
+ let v190 : (System.DateTime -> int64) = _.Ticks
+ let v191 : int64 = v190 v189
+ US1_0(v191)
else
US1_1
- struct (v104, v94)
+ struct (v194, v184)
#endif
#else
- let v105 : string = method1()
- let v106 : string = method2(v105)
- let v107 : bool = "Verbose" = v106
- let v127 : US2 =
- if v107 then
- let v108 : US0 = US0_0
- US2_0(v108)
+ let v195 : string = method1()
+ let v196 : string = method2(v195)
+ let v198 : bool = "Verbose" = v196
+ let v202 : US2 =
+ if v198 then
+ let v199 : US0 = US0_0
+ US2_0(v199)
else
- let v110 : bool = "Debug" = v106
- if v110 then
- let v111 : US0 = US0_1
- US2_0(v111)
- else
- let v113 : bool = "Info" = v106
- if v113 then
- let v114 : US0 = US0_2
- US2_0(v114)
+ US2_1
+ let v247 : US2 =
+ match v202 with
+ | US2_1 -> (* None *)
+ let v206 : bool = "Debug" = v196
+ let v210 : US2 =
+ if v206 then
+ let v207 : US0 = US0_1
+ US2_0(v207)
else
- let v116 : bool = "Warning" = v106
- if v116 then
- let v117 : US0 = US0_3
- US2_0(v117)
+ US2_1
+ match v210 with
+ | US2_1 -> (* None *)
+ let v214 : bool = "Info" = v196
+ let v218 : US2 =
+ if v214 then
+ let v215 : US0 = US0_2
+ US2_0(v215)
else
- let v119 : bool = "Critical" = v106
- if v119 then
- let v120 : US0 = US0_4
- US2_0(v120)
+ US2_1
+ match v218 with
+ | US2_1 -> (* None *)
+ let v222 : bool = "Warning" = v196
+ let v226 : US2 =
+ if v222 then
+ let v223 : US0 = US0_3
+ US2_0(v223)
else
US2_1
- let v128 : string = method4()
- let v129 : string = method2(v128)
- let v131 : bool = v129 = "True"
- let v137 : US1 =
- if v131 then
- let v132 : System.DateTime = System.DateTime.Now
- let v133 : (System.DateTime -> int64) = _.Ticks
- let v134 : int64 = v133 v132
- US1_0(v134)
+ match v226 with
+ | US2_1 -> (* None *)
+ let v230 : bool = "Critical" = v196
+ let v234 : US2 =
+ if v230 then
+ let v231 : US0 = US0_4
+ US2_0(v231)
+ else
+ US2_1
+ match v234 with
+ | US2_1 -> (* None *)
+ US2_1
+ | US2_0(v235) -> (* Some *)
+ US2_0(v235)
+ | US2_0(v227) -> (* Some *)
+ US2_0(v227)
+ | US2_0(v219) -> (* Some *)
+ US2_0(v219)
+ | US2_0(v211) -> (* Some *)
+ US2_0(v211)
+ | US2_0(v203) -> (* Some *)
+ US2_0(v203)
+ let v248 : string = method4()
+ let v249 : string = method2(v248)
+ let v251 : bool = v249 = "True"
+ let v257 : US1 =
+ if v251 then
+ let v252 : System.DateTime = System.DateTime.Now
+ let v253 : (System.DateTime -> int64) = _.Ticks
+ let v254 : int64 = v253 v252
+ US1_0(v254)
else
US1_1
- struct (v137, v127)
+ struct (v257, v247)
#endif
|> fun x -> _v1 <- Some x
- let struct (v138 : US1, v139 : US2) = match _v1 with Some x -> x | None -> failwith "base.run_target / _v1=None"
- let v140 : Mut1 = {l0 = true} : Mut1
- let v141 : Mut0 = {l0 = 0L} : Mut0
- let v144 : US0 =
- match v139 with
+ let struct (v258 : US1, v259 : US2) = match _v1 with Some x -> x | None -> failwith "base.run_target / _v1=None"
+ let v260 : Mut1 = {l0 = true} : Mut1
+ let v261 : Mut0 = {l0 = 0L} : Mut0
+ let v264 : US0 =
+ match v259 with
| US2_1 -> (* None *)
v0
- | US2_0(v142) -> (* Some *)
- v142
- let v145 : Mut2 = {l0 = v144} : Mut2
- let v146 : (string -> unit) = closure3()
- let v147 : Mut3 = {l0 = v146} : Mut3
- let v152 : int64 option =
- match v138 with
+ | US2_0(v262) -> (* Some *)
+ v262
+ let v265 : Mut2 = {l0 = v264} : Mut2
+ let v266 : (string -> unit) = closure3()
+ let v267 : Mut3 = {l0 = v266} : Mut3
+ let v272 : int64 option =
+ match v258 with
| US1_1 -> (* None *)
- let v150 : int64 option = None
- v150
- | US1_0(v148) -> (* Some *)
- let v149 : int64 option = Some v148
- v149
- struct (v141, v140, v145, v152, v147)
+ let v270 : int64 option = None
+ v270
+ | US1_0(v268) -> (* Some *)
+ let v269 : int64 option = Some v268
+ v269
+ struct (v261, v260, v265, v272, v267)
and closure4 () () : string =
let v0 : string = $"spiral_builder.main"
v0
@@ -1446,151 +1706,222 @@ and closure7 (v0 : US0, v1 : (unit -> string), v2 : (unit -> string)) () : strin
#endif
|> fun x -> _v10 <- Some x
let v147 : string = match _v10 with Some x -> x | None -> failwith "base.run_target / _v10=None"
- let v157 : string =
+ let v150 : bool =
match v0 with
- | US0_4 -> (* Critical *)
- let v152 : string = "Critical"
- v152
- | US0_1 -> (* Debug *)
- let v149 : string = "Debug"
- v149
- | US0_2 -> (* Info *)
- let v150 : string = "Info"
- v150
| US0_0 -> (* Verbose *)
- let v148 : string = "Verbose"
- v148
- | US0_3 -> (* Warning *)
- let v151 : string = "Warning"
- v151
- let v158 : (unit -> string) = v157.ToLower
- let v159 : string = v158 ()
- let v160 : string = v159.PadLeft (7, ' ')
- let v161 : bool = true
- let mutable _v161 : string option = None
+ true
+ | _ ->
+ false
+ let v154 : US3 =
+ if v150 then
+ let v151 : string = "Verbose"
+ US3_0(v151)
+ else
+ US3_1
+ let v203 : US3 =
+ match v154 with
+ | US3_1 -> (* None *)
+ let v159 : bool =
+ match v0 with
+ | US0_1 -> (* Debug *)
+ true
+ | _ ->
+ false
+ let v163 : US3 =
+ if v159 then
+ let v160 : string = "Debug"
+ US3_0(v160)
+ else
+ US3_1
+ match v163 with
+ | US3_1 -> (* None *)
+ let v168 : bool =
+ match v0 with
+ | US0_2 -> (* Info *)
+ true
+ | _ ->
+ false
+ let v172 : US3 =
+ if v168 then
+ let v169 : string = "Info"
+ US3_0(v169)
+ else
+ US3_1
+ match v172 with
+ | US3_1 -> (* None *)
+ let v177 : bool =
+ match v0 with
+ | US0_3 -> (* Warning *)
+ true
+ | _ ->
+ false
+ let v181 : US3 =
+ if v177 then
+ let v178 : string = "Warning"
+ US3_0(v178)
+ else
+ US3_1
+ match v181 with
+ | US3_1 -> (* None *)
+ let v186 : bool =
+ match v0 with
+ | US0_4 -> (* Critical *)
+ true
+ | _ ->
+ false
+ let v190 : US3 =
+ if v186 then
+ let v187 : string = "Critical"
+ US3_0(v187)
+ else
+ US3_1
+ match v190 with
+ | US3_1 -> (* None *)
+ US3_1
+ | US3_0(v191) -> (* Some *)
+ US3_0(v191)
+ | US3_0(v182) -> (* Some *)
+ US3_0(v182)
+ | US3_0(v173) -> (* Some *)
+ US3_0(v173)
+ | US3_0(v164) -> (* Some *)
+ US3_0(v164)
+ | US3_0(v155) -> (* Some *)
+ US3_0(v155)
+ let v207 : string =
+ match v203 with
+ | US3_1 -> (* None *)
+ failwith "Option does not have a value."
+ | US3_0(v204) -> (* Some *)
+ v204
+ let v208 : (unit -> string) = v207.ToLower
+ let v209 : string = v208 ()
+ let v210 : string = v209.PadLeft (7, ' ')
+ let v211 : bool = true
+ let mutable _v211 : string option = None
#if FABLE_COMPILER || WASM || CONTRACT
#if FABLE_COMPILER_RUST && !WASM && !CONTRACT
- let v176 : Ref =
+ let v226 : Ref =
match v0 with
| US0_4 -> (* Critical *)
- let v170 : string = "inline_colorization::color_bright_red"
- let v171 : Ref = Fable.Core.RustInterop.emitRustExpr () v170
- v171
+ let v220 : string = "inline_colorization::color_bright_red"
+ let v221 : Ref = Fable.Core.RustInterop.emitRustExpr () v220
+ v221
| US0_1 -> (* Debug *)
- let v164 : string = "inline_colorization::color_bright_blue"
- let v165 : Ref = Fable.Core.RustInterop.emitRustExpr () v164
- v165
+ let v214 : string = "inline_colorization::color_bright_blue"
+ let v215 : Ref = Fable.Core.RustInterop.emitRustExpr () v214
+ v215
| US0_2 -> (* Info *)
- let v166 : string = "inline_colorization::color_bright_green"
- let v167 : Ref = Fable.Core.RustInterop.emitRustExpr () v166
- v167
+ let v216 : string = "inline_colorization::color_bright_green"
+ let v217 : Ref = Fable.Core.RustInterop.emitRustExpr () v216
+ v217
| US0_0 -> (* Verbose *)
- let v162 : string = "inline_colorization::color_bright_black"
- let v163 : Ref = Fable.Core.RustInterop.emitRustExpr () v162
- v163
+ let v212 : string = "inline_colorization::color_bright_black"
+ let v213 : Ref = Fable.Core.RustInterop.emitRustExpr () v212
+ v213
| US0_3 -> (* Warning *)
- let v168 : string = "inline_colorization::color_yellow"
- let v169 : Ref = Fable.Core.RustInterop.emitRustExpr () v168
- v169
- let v177 : string = "&*$0"
- let v178 : Ref = Fable.Core.RustInterop.emitRustExpr v160 v177
- let v179 : string = "inline_colorization::color_reset"
- let v180 : Ref = Fable.Core.RustInterop.emitRustExpr () v179
- let v181 : string = "\"{v176}{v178}{v180}\""
- let v182 : string = @$"format!(" + v181 + ")"
- let v183 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v182
- let v184 : string = "fable_library_rust::String_::fromString($0)"
- let v185 : string = Fable.Core.RustInterop.emitRustExpr v183 v184
- v185
+ let v218 : string = "inline_colorization::color_yellow"
+ let v219 : Ref = Fable.Core.RustInterop.emitRustExpr () v218
+ v219
+ let v227 : string = "&*$0"
+ let v228 : Ref = Fable.Core.RustInterop.emitRustExpr v210 v227
+ let v229 : string = "inline_colorization::color_reset"
+ let v230 : Ref = Fable.Core.RustInterop.emitRustExpr () v229
+ let v231 : string = "\"{v226}{v228}{v230}\""
+ let v232 : string = @$"format!(" + v231 + ")"
+ let v233 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v232
+ let v234 : string = "fable_library_rust::String_::fromString($0)"
+ let v235 : string = Fable.Core.RustInterop.emitRustExpr v233 v234
+ v235
#endif
#if FABLE_COMPILER_RUST && WASM
- let v200 : Ref =
+ let v250 : Ref =
match v0 with
| US0_4 -> (* Critical *)
- let v194 : string = "inline_colorization::color_bright_red"
- let v195 : Ref = Fable.Core.RustInterop.emitRustExpr () v194
- v195
+ let v244 : string = "inline_colorization::color_bright_red"
+ let v245 : Ref = Fable.Core.RustInterop.emitRustExpr () v244
+ v245
| US0_1 -> (* Debug *)
- let v188 : string = "inline_colorization::color_bright_blue"
- let v189 : Ref = Fable.Core.RustInterop.emitRustExpr () v188
- v189
+ let v238 : string = "inline_colorization::color_bright_blue"
+ let v239 : Ref = Fable.Core.RustInterop.emitRustExpr () v238
+ v239
| US0_2 -> (* Info *)
- let v190 : string = "inline_colorization::color_bright_green"
- let v191 : Ref = Fable.Core.RustInterop.emitRustExpr () v190
- v191
+ let v240 : string = "inline_colorization::color_bright_green"
+ let v241 : Ref = Fable.Core.RustInterop.emitRustExpr () v240
+ v241
| US0_0 -> (* Verbose *)
- let v186 : string = "inline_colorization::color_bright_black"
- let v187 : Ref = Fable.Core.RustInterop.emitRustExpr () v186
- v187
+ let v236 : string = "inline_colorization::color_bright_black"
+ let v237 : Ref = Fable.Core.RustInterop.emitRustExpr () v236
+ v237
| US0_3 -> (* Warning *)
- let v192 : string = "inline_colorization::color_yellow"
- let v193 : Ref = Fable.Core.RustInterop.emitRustExpr () v192
- v193
- let v201 : string = "&*$0"
- let v202 : Ref = Fable.Core.RustInterop.emitRustExpr v160 v201
- let v203 : string = "inline_colorization::color_reset"
- let v204 : Ref = Fable.Core.RustInterop.emitRustExpr () v203
- let v205 : string = "\"{v200}{v202}{v204}\""
- let v206 : string = @$"format!(" + v205 + ")"
- let v207 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v206
- let v208 : string = "fable_library_rust::String_::fromString($0)"
- let v209 : string = Fable.Core.RustInterop.emitRustExpr v207 v208
- v209
- #endif
-#if FABLE_COMPILER_RUST && CONTRACT
- let v224 : Ref =
+ let v242 : string = "inline_colorization::color_yellow"
+ let v243 : Ref = Fable.Core.RustInterop.emitRustExpr () v242
+ v243
+ let v251 : string = "&*$0"
+ let v252 : Ref = Fable.Core.RustInterop.emitRustExpr v210 v251
+ let v253 : string = "inline_colorization::color_reset"
+ let v254 : Ref = Fable.Core.RustInterop.emitRustExpr () v253
+ let v255 : string = "\"{v250}{v252}{v254}\""
+ let v256 : string = @$"format!(" + v255 + ")"
+ let v257 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v256
+ let v258 : string = "fable_library_rust::String_::fromString($0)"
+ let v259 : string = Fable.Core.RustInterop.emitRustExpr v257 v258
+ v259
+ #endif
+#if FABLE_COMPILER_RUST && CONTRACT
+ let v274 : Ref =
match v0 with
| US0_4 -> (* Critical *)
- let v218 : string = "inline_colorization::color_bright_red"
- let v219 : Ref = Fable.Core.RustInterop.emitRustExpr () v218
- v219
+ let v268 : string = "inline_colorization::color_bright_red"
+ let v269 : Ref = Fable.Core.RustInterop.emitRustExpr () v268
+ v269
| US0_1 -> (* Debug *)
- let v212 : string = "inline_colorization::color_bright_blue"
- let v213 : Ref = Fable.Core.RustInterop.emitRustExpr () v212
- v213
+ let v262 : string = "inline_colorization::color_bright_blue"
+ let v263 : Ref = Fable.Core.RustInterop.emitRustExpr () v262
+ v263
| US0_2 -> (* Info *)
- let v214 : string = "inline_colorization::color_bright_green"
- let v215 : Ref = Fable.Core.RustInterop.emitRustExpr () v214
- v215
+ let v264 : string = "inline_colorization::color_bright_green"
+ let v265 : Ref = Fable.Core.RustInterop.emitRustExpr () v264
+ v265
| US0_0 -> (* Verbose *)
- let v210 : string = "inline_colorization::color_bright_black"
- let v211 : Ref = Fable.Core.RustInterop.emitRustExpr () v210
- v211
+ let v260 : string = "inline_colorization::color_bright_black"
+ let v261 : Ref = Fable.Core.RustInterop.emitRustExpr () v260
+ v261
| US0_3 -> (* Warning *)
- let v216 : string = "inline_colorization::color_yellow"
- let v217 : Ref = Fable.Core.RustInterop.emitRustExpr () v216
- v217
- let v225 : string = "&*$0"
- let v226 : Ref = Fable.Core.RustInterop.emitRustExpr v160 v225
- let v227 : string = "inline_colorization::color_reset"
- let v228 : Ref = Fable.Core.RustInterop.emitRustExpr () v227
- let v229 : string = "\"{v224}{v226}{v228}\""
- let v230 : string = @$"format!(" + v229 + ")"
- let v231 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v230
- let v232 : string = "fable_library_rust::String_::fromString($0)"
- let v233 : string = Fable.Core.RustInterop.emitRustExpr v231 v232
- v233
+ let v266 : string = "inline_colorization::color_yellow"
+ let v267 : Ref = Fable.Core.RustInterop.emitRustExpr () v266
+ v267
+ let v275 : string = "&*$0"
+ let v276 : Ref = Fable.Core.RustInterop.emitRustExpr v210 v275
+ let v277 : string = "inline_colorization::color_reset"
+ let v278 : Ref = Fable.Core.RustInterop.emitRustExpr () v277
+ let v279 : string = "\"{v274}{v276}{v278}\""
+ let v280 : string = @$"format!(" + v279 + ")"
+ let v281 : std_string_String = Fable.Core.RustInterop.emitRustExpr () v280
+ let v282 : string = "fable_library_rust::String_::fromString($0)"
+ let v283 : string = Fable.Core.RustInterop.emitRustExpr v281 v282
+ v283
#endif
#if FABLE_COMPILER_TYPESCRIPT
- v160
+ v210
#endif
#if FABLE_COMPILER_PYTHON
- v160
+ v210
#endif
#else
- v160
+ v210
#endif
- |> fun x -> _v161 <- Some x
- let v234 : string = match _v161 with Some x -> x | None -> failwith "base.run_target / _v161=None"
- let v235 : int64 = v5.l0
- let v236 : string = $"{v147} {v234} #{v235} %s{v1 ()} / %s{v2 ()}"
- let v237 : (char []) = [||]
- let v238 : string = v236.TrimStart v237
- let v239 : (char []) = [|' '; '/'|]
- let v240 : string = v238.TrimEnd v239
- v240
+ |> fun x -> _v211 <- Some x
+ let v284 : string = match _v211 with Some x -> x | None -> failwith "base.run_target / _v211=None"
+ let v285 : int64 = v5.l0
+ let v286 : string = $"{v147} {v284} #{v285} %s{v1 ()} / %s{v2 ()}"
+ let v287 : (char []) = [||]
+ let v288 : string = v286.TrimStart v287
+ let v289 : (char []) = [|' '; '/'|]
+ let v290 : string = v288.TrimEnd v289
+ v290
and method9 (v0 : US0, v1 : (unit -> string)) : unit =
let v2 : (US0 -> struct (Mut0 * Mut1 * Mut2 * int64 option * Mut3)) = closure2()
let v3 : US0 = US0_0
@@ -1659,952 +1990,362 @@ and closure8 () (v0 : Ref) : std_string_String =
let v2 : std_string_String = Fable.Core.RustInterop.emitRustExpr v0 v1
v2
and method11 () : string =
- let v0 : string = "fs-path"
+ let v0 : string = "py-path"
v0
and method12 () : string =
- let v0 : string = "command"
+ let v0 : string = "env"
v0
-and method15 (v0 : char, v1 : int64) : bool =
- let v2 : bool = v1 >= 4L
- if v2 then
- false
- else
- let v3 : bool = v1 = 0L
- let v19 : US9 =
- if v3 then
- US9_0('\\')
- else
- let v5 : int64 = v1 - 1L
- let v6 : bool = v5 = 0L
- if v6 then
- US9_0('`')
- else
- let v8 : int64 = v5 - 1L
- let v9 : bool = v8 = 0L
- if v9 then
- US9_0('"')
- else
- let v11 : int64 = v8 - 1L
- let v12 : bool = v11 = 0L
- if v12 then
- US9_0(' ')
- else
- let v14 : int64 = v11 - 1L
- US9_1
- let v23 : char =
- match v19 with
- | US9_1 -> (* None *)
- failwith "Option does not have a value."
- | US9_0(v20) -> (* Some *)
- v20
- let v24 : bool = v0 = v23
- if v24 then
+and method13 () : string =
+ let v0 : string = "deps"
+ v0
+and method16 (v0 : string) : string =
+ v0
+and method15 (v0 : string, v1 : string) : struct (string * string) =
+ let v2 : string = method16(v0)
+ struct (v1, v2)
+and method14 (v0 : string, v1 : string) : string =
+ let v2 : bool = true
+ let mutable _v2 : string option = None
+
+#if FABLE_COMPILER || WASM || CONTRACT
+
+#if FABLE_COMPILER_RUST && !WASM && !CONTRACT
+ let v3 : string = "&*$0"
+ let v4 : Ref = Fable.Core.RustInterop.emitRustExpr v0 v3
+ let v5 : string = "String::from($0)"
+ let v6 : std_string_String = Fable.Core.RustInterop.emitRustExpr v4 v5
+ let v7 : string = "std::path::PathBuf::from($0)"
+ let v8 : std_path_PathBuf = Fable.Core.RustInterop.emitRustExpr v6 v7
+ let v9 : string = "&*$0"
+ let v10 : Ref = Fable.Core.RustInterop.emitRustExpr v1 v9
+ let v11 : string = "String::from($0)"
+ let v12 : std_string_String = Fable.Core.RustInterop.emitRustExpr v10 v11
+ let v13 : string = "$0.join($1)"
+ let v14 : std_path_PathBuf = Fable.Core.RustInterop.emitRustExpr struct (v8, v12) v13
+ let v15 : string = "$0.display()"
+ let v16 : std_path_Display = Fable.Core.RustInterop.emitRustExpr v14 v15
+ let v17 : bool = true
+ let mutable _v17 : std_string_String option = None
+
+#if FABLE_COMPILER || WASM || CONTRACT
+
+#if FABLE_COMPILER_RUST && !WASM && !CONTRACT
+ let v18 : string = "format!(\"{}\", $0)"
+ let v19 : std_string_String = Fable.Core.RustInterop.emitRustExpr v16 v18
+ v19
+ #endif
+#if FABLE_COMPILER_RUST && WASM
+ let v20 : string = "format!(\"{}\", $0)"
+ let v21 : std_string_String = Fable.Core.RustInterop.emitRustExpr v16 v20
+ v21
+ #endif
+#if FABLE_COMPILER_RUST && CONTRACT
+ let v22 : string = "format!(\"{}\", $0)"
+ let v23 : std_string_String = Fable.Core.RustInterop.emitRustExpr v16 v22
+ v23
+ #endif
+#if FABLE_COMPILER_TYPESCRIPT
+ let v24 : std_string_String = null |> unbox
+ v24
+ #endif
+#if FABLE_COMPILER_PYTHON
+ let v25 : std_string_String = null |> unbox
+ v25
+ #endif
+#else
+ let v26 : std_string_String = null |> unbox
+ v26
+ #endif
+ |> fun x -> _v17 <- Some x
+ let v27 : std_string_String = match _v17 with Some x -> x | None -> failwith "base.run_target / _v17=None"
+ let v28 : string = "fable_library_rust::String_::fromString($0)"
+ let v29 : string = Fable.Core.RustInterop.emitRustExpr v27 v28
+ v29
+ #endif
+#if FABLE_COMPILER_RUST && WASM
+ let v30 : US10 = US10_1
+ let v31 : US11 = US11_2(v30)
+ let v32 : string = $"file_system.(>) / target: {v31} / a: {v0} / b: {v1}"
+ let v33 : string = failwith v32
+ v33
+ #endif
+#if FABLE_COMPILER_RUST && CONTRACT
+ let v34 : string = null |> unbox
+ v34
+ #endif
+#if FABLE_COMPILER_TYPESCRIPT
+ let v35 : string = "path"
+ let v36 : IPathJoin = Fable.Core.JsInterop.importAll v35
+ let struct (v37 : string, v38 : string) = method15(v1, v0)
+ let v39 : string = "v36.join($0, $1)"
+ let v40 : string = Fable.Core.JsInterop.emitJsExpr struct (v37, v38) v39
+ v40
+ #endif
+#if FABLE_COMPILER_PYTHON
+ let v41 : US10 = US10_0
+ let v42 : US11 = US11_4(v41)
+ let v43 : string = $"file_system.(>) / target: {v42} / a: {v0} / b: {v1}"
+ let v44 : string = failwith v43
+ v44
+ #endif
+#else
+ let v45 : string = System.IO.Path.Combine (v0, v1)
+ v45
+ #endif
+ |> fun x -> _v2 <- Some x
+ let v46 : string = match _v2 with Some x -> x | None -> failwith "base.run_target / _v2=None"
+ v46
+and method18 (v0 : string) : bool =
+ let v1 : bool = true
+ let mutable _v1 : bool option = None
+
+#if FABLE_COMPILER || WASM || CONTRACT
+
+#if FABLE_COMPILER_RUST && !WASM && !CONTRACT
+ let v2 : string = "&*$0"
+ let v3 : Ref = Fable.Core.RustInterop.emitRustExpr v0 v2
+ let v4 : string = "String::from($0)"
+ let v5 : std_string_String = Fable.Core.RustInterop.emitRustExpr v3 v4
+ let v6 : string = "std::path::PathBuf::from($0)"
+ let v7 : std_path_PathBuf = Fable.Core.RustInterop.emitRustExpr v5 v6
+ let v8 : string = "$0.exists()"
+ let v9 : bool = Fable.Core.RustInterop.emitRustExpr v7 v8
+ let v15 : bool =
+ if v9 then
true
else
- let v25 : int64 = v1 + 1L
- method15(v0, v25)
-and method16 (v0 : int32, v1 : Mut4) : bool =
- let v2 : int32 = v1.l0
- let v3 : bool = v2 < v0
- v3
-and closure10 (v0 : char) (v1 : UH1) : UH1 =
- UH1_1(v0, v1)
-and closure9 () (v0 : char) : (UH1 -> UH1) =
- closure10(v0)
-and method17 () : (char -> (UH1 -> UH1)) =
- closure9()
-and method18 (v0 : UH1, v1 : System.Text.StringBuilder, v2 : int32, v3 : int32) : struct (System.Text.StringBuilder * int32 * int32) =
- match v0 with
- | UH1_1(v4, v5) -> (* Cons *)
- let v6 : bool = '\n' = v4
- let struct (v9 : int32, v10 : int32) =
- if v6 then
- let v7 : int32 = v3 + 1
- struct (1, v7)
- else
- let v8 : int32 = v2 + 1
- struct (v8, v3)
- let v17 : System.Text.StringBuilder =
- if v6 then
- let v11 : (unit -> System.Text.StringBuilder) = v1.Clear
- let v12 : System.Text.StringBuilder = v11 ()
- v1
+ let v10 : string = "$0.is_dir()"
+ let v11 : bool = Fable.Core.RustInterop.emitRustExpr v7 v10
+ if v11 then
+ true
else
- let v13 : (char -> string) = _.ToString()
- let v14 : string = v13 v4
- let v15 : (string -> System.Text.StringBuilder) = v1.Append
- let v16 : System.Text.StringBuilder = v15 v14
- v1
- method18(v5, v17, v9, v10)
- | UH1_0 -> (* Nil *)
- struct (v1, v2, v3)
-and method19 (v0 : string, v1 : string, v2 : System.Text.StringBuilder, v3 : int32, v4 : int32) : US10 =
- let v5 : bool = "" = v1
- let v57 : US8 =
- if v5 then
- let v6 : char list = []
- let v7 : char list = ' ' :: v6
- let v8 : char list = '"' :: v7
- let v9 : char list = '`' :: v8
- let v10 : char list = '\\' :: v9
- let v11 : (char list -> (char [])) = List.toArray
- let v12 : (char []) = v11 v10
- let v13 : string = $"parsing.none_of / unexpected end of input / chars: %A{v12} / s: %A{struct (v2, v3, v4)}"
- US8_1(v13)
+ let v12 : string = "$0.is_symlink()"
+ let v13 : bool = Fable.Core.RustInterop.emitRustExpr v7 v12
+ v13
+ v15
+ #endif
+#if FABLE_COMPILER_RUST && WASM
+ let v16 : bool = null |> unbox
+ v16
+ #endif
+#if FABLE_COMPILER_RUST && CONTRACT
+ let v17 : bool = null |> unbox
+ v17
+ #endif
+#if FABLE_COMPILER_TYPESCRIPT
+ let v18 : string = "fs"
+ let v19 : IFsExistsSync = Fable.Core.JsInterop.importAll v18
+ let v20 : string = "$0.existsSync($1)"
+ let v21 : bool = Fable.Core.JsInterop.emitJsExpr struct (v19, v0) v20
+ v21
+ #endif
+#if FABLE_COMPILER_PYTHON
+ let v22 : bool = null |> unbox
+ v22
+ #endif
+#else
+ let v23 : (string -> bool) = System.IO.Directory.Exists
+ let v24 : bool = v23 v0
+ v24
+ #endif
+ |> fun x -> _v1 <- Some x
+ let v25 : bool = match _v1 with Some x -> x | None -> failwith "base.run_target / _v1=None"
+ v25
+and method20 (v0 : string) : string option =
+ let v1 : bool = true
+ let mutable _v1 : US3 option = None
+
+#if FABLE_COMPILER || WASM || CONTRACT
+
+#if FABLE_COMPILER_RUST && !WASM && !CONTRACT
+ let v2 : string = "&*$0"
+ let v3 : Ref = Fable.Core.RustInterop.emitRustExpr v0 v2
+ let v4 : string = "String::from($0)"
+ let v5 : std_string_String = Fable.Core.RustInterop.emitRustExpr v3 v4
+ let v6 : string = "std::path::PathBuf::from($0)"
+ let v7 : std_path_PathBuf = Fable.Core.RustInterop.emitRustExpr v5 v6
+ let v8 : string = "$0.parent().map(std::path::PathBuf::from)"
+ let v9 : std_path_PathBuf option = Fable.Core.RustInterop.emitRustExpr v7 v8
+ let v10 : string = "$0?"
+ let v11 : std_path_PathBuf = Fable.Core.RustInterop.emitRustExpr v9 v10
+ let v12 : string = "$0.display()"
+ let v13 : std_path_Display = Fable.Core.RustInterop.emitRustExpr v11 v12
+ let v14 : bool = true
+ let mutable _v14 : std_string_String option = None
+
+#if FABLE_COMPILER || WASM || CONTRACT
+
+#if FABLE_COMPILER_RUST && !WASM && !CONTRACT
+ let v15 : string = "format!(\"{}\", $0)"
+ let v16 : std_string_String = Fable.Core.RustInterop.emitRustExpr v13 v15
+ v16
+ #endif
+#if FABLE_COMPILER_RUST && WASM
+ let v17 : string = "format!(\"{}\", $0)"
+ let v18 : std_string_String = Fable.Core.RustInterop.emitRustExpr v13 v17
+ v18
+ #endif
+#if FABLE_COMPILER_RUST && CONTRACT
+ let v19 : string = "format!(\"{}\", $0)"
+ let v20 : std_string_String = Fable.Core.RustInterop.emitRustExpr v13 v19
+ v20
+ #endif
+#if FABLE_COMPILER_TYPESCRIPT
+ let v21 : std_string_String = null |> unbox
+ v21
+ #endif
+#if FABLE_COMPILER_PYTHON
+ let v22 : std_string_String = null |> unbox
+ v22
+ #endif
+#else
+ let v23 : std_string_String = null |> unbox
+ v23
+ #endif
+ |> fun x -> _v14 <- Some x
+ let v24 : std_string_String = match _v14 with Some x -> x | None -> failwith "base.run_target / _v14=None"
+ let v25 : string = "fable_library_rust::String_::fromString($0)"
+ let v26 : string = Fable.Core.RustInterop.emitRustExpr v24 v25
+ let v27 : US3 = US3_0(v26)
+ v27
+ #endif
+#if FABLE_COMPILER_RUST && WASM
+ let v28 : US3 = null |> unbox
+ v28
+ #endif
+#if FABLE_COMPILER_RUST && CONTRACT
+ let v29 : US3 = null |> unbox
+ v29
+ #endif
+#if FABLE_COMPILER_TYPESCRIPT
+ let v30 : string = "path"
+ let v31 : IPathDirname = Fable.Core.JsInterop.importAll v30
+ let v32 : string = "v31.dirname($0)"
+ let v33 : string = Fable.Core.JsInterop.emitJsExpr v0 v32
+ let v34 : US3 = US3_0(v33)
+ v34
+ #endif
+#if FABLE_COMPILER_PYTHON
+ let v35 : US3 = null |> unbox
+ v35
+ #endif
+#else
+ let v36 : (string -> System.IO.DirectoryInfo) = System.IO.Directory.GetParent
+ let v37 : System.IO.DirectoryInfo = v36 v0
+ let v38 : System.IO.DirectoryInfo = null |> unbox
+ let v39 : bool = v37 = v38
+ let v50 : US3 =
+ if v39 then
+ US3_1
else
- let v15 : char = v1.[int 0]
- let v16 : (string -> int32) = String.length
- let v17 : int32 = v16 v1
- let v18 : (int32 -> int32) = int32
- let v19 : int32 = v18 1
- let v20 : (int32 -> int32) = int32
- let v21 : int32 = v20 v17
- let v22 : string = v1.[int v19..int v21]
- let v23 : int64 = 0L
- let v24 : bool = method15(v15, v23)
- let v25 : bool = v24 = false
- if v25 then
- let v26 : (char -> string) = _.ToString()
- let v27 : string = v26 v15
- let v28 : int32 = v27.Length
- let v29 : (char []) = Array.zeroCreate (v28)
- let v30 : Mut4 = {l0 = 0} : Mut4
- while method16(v28, v30) do
- let v32 : int32 = v30.l0
- let v33 : char = v27.[int v32]
- v29.[int v32] <- v33
- let v34 : int32 = v32 + 1
- v30.l0 <- v34
- ()
- let v35 : ((char []) -> char list) = Array.toList
- let v36 : char list = v35 v29
- let v37 : ((char -> (UH1 -> UH1)) -> (char list -> (UH1 -> UH1))) = List.foldBack
- let v38 : (char -> (UH1 -> UH1)) = method17()
- let v39 : (char list -> (UH1 -> UH1)) = v37 v38
- let v40 : (UH1 -> UH1) = v39 v36
- let v41 : UH1 = UH1_0
- let v42 : UH1 = v40 v41
- let struct (v43 : System.Text.StringBuilder, v44 : int32, v45 : int32) = method18(v42, v2, v3, v4)
- US8_0(v15, v22, v43, v44, v45)
- else
- let v47 : char list = []
- let v48 : char list = ' ' :: v47
- let v49 : char list = '"' :: v48
- let v50 : char list = '`' :: v49
- let v51 : char list = '\\' :: v50
- let v52 : (char list -> (char [])) = List.toArray
- let v53 : (char []) = v52 v51
- let v54 : string = $"parsing.none_of / unexpected char: '{v15}' / chars: %A{v53} / s: %A{struct (v2, v3, v4)}"
- US8_1(v54)
- match v57 with
- | US8_1(v67) -> (* Error *)
- US10_0(v0, v1, v2, v3, v4)
- | US8_0(v58, v59, v60, v61, v62) -> (* Ok *)
- let v63 : (char -> string) = _.ToString()
- let v64 : string = v63 v58
- let v65 : string = v0 + v64
- method19(v65, v59, v60, v61, v62)
-and method21 (v0 : char, v1 : int64) : bool =
- let v2 : bool = v1 >= 3L
- if v2 then
- false
+ let v41 : bool = true
+ let mutable _v41 : string option = None
+
+#if FABLE_COMPILER || WASM || CONTRACT
+
+#if FABLE_COMPILER_RUST && !WASM && !CONTRACT
+ let v42 : string = null |> unbox
+ v42
+ #endif
+#if FABLE_COMPILER_RUST && WASM
+ let v43 : string = null |> unbox
+ v43
+ #endif
+#if FABLE_COMPILER_RUST && CONTRACT
+ let v44 : string = null |> unbox
+ v44
+ #endif
+#if FABLE_COMPILER_TYPESCRIPT
+ let v45 : string = null |> unbox
+ v45
+ #endif
+#if FABLE_COMPILER_PYTHON
+ let v46 : string = null |> unbox
+ v46
+ #endif
+#else
+ let v47 : string = v37.FullName
+ v47
+ #endif
+ |> fun x -> _v41 <- Some x
+ let v48 : string = match _v41 with Some x -> x | None -> failwith "base.run_target / _v41=None"
+ US3_0(v48)
+ v50
+ #endif
+ |> fun x -> _v1 <- Some x
+ let v51 : US3 = match _v1 with Some x -> x | None -> failwith "base.run_target / _v1=None"
+ match v51 with
+ | US3_1 -> (* None *)
+ let v54 : string option = None
+ v54
+ | US3_0(v52) -> (* Some *)
+ let v53 : string option = Some v52
+ v53
+and closure9 () (v0 : string) : string option =
+ method20(v0)
+and method19 () : (string -> string option) =
+ closure9()
+and method21 (v0 : string, v1 : string, v2 : string) : string =
+ let v3 : string = method14(v2, v0)
+ let v4 : bool = method18(v3)
+ if v4 then
+ v2
else
- let v3 : bool = v1 = 0L
- let v15 : US9 =
- if v3 then
- US9_0('\\')
- else
- let v5 : int64 = v1 - 1L
- let v6 : bool = v5 = 0L
- if v6 then
- US9_0('`')
- else
- let v8 : int64 = v5 - 1L
- let v9 : bool = v8 = 0L
- if v9 then
- US9_0('"')
- else
- let v11 : int64 = v8 - 1L
- US9_1
- let v19 : char =
- match v15 with
- | US9_1 -> (* None *)
- failwith "Option does not have a value."
- | US9_0(v16) -> (* Some *)
- v16
- let v20 : bool = v0 = v19
- if v20 then
- true
- else
- let v21 : int64 = v1 + 1L
- method21(v0, v21)
-and closure11 () struct (v0 : string, v1 : System.Text.StringBuilder, v2 : int32, v3 : int32) : US10 =
- let v4 : bool = "" = v0
- let v60 : US8 =
- if v4 then
- let v5 : string = $"parsing.p_char / unexpected end of input / s: %A{struct (v1, v2, v3)}"
- US8_1(v5)
- else
- let v7 : char = v0.[int 0]
- let v8 : bool = v7 = '\\'
- if v8 then
- let v9 : (string -> int32) = String.length
- let v10 : int32 = v9 v0
- let v11 : (int32 -> int32) = int32
- let v12 : int32 = v11 1
- let v13 : (int32 -> int32) = int32
- let v14 : int32 = v13 v10
- let v15 : string = v0.[int v12..int v14]
- let v16 : (char -> string) = _.ToString()
- let v17 : string = v16 v7
- let v18 : int32 = v17.Length
- let v19 : (char []) = Array.zeroCreate (v18)
- let v20 : Mut4 = {l0 = 0} : Mut4
- while method16(v18, v20) do
- let v22 : int32 = v20.l0
- let v23 : char = v17.[int v22]
- v19.[int v22] <- v23
- let v24 : int32 = v22 + 1
- v20.l0 <- v24
- ()
- let v25 : ((char []) -> char list) = Array.toList
- let v26 : char list = v25 v19
- let v27 : ((char -> (UH1 -> UH1)) -> (char list -> (UH1 -> UH1))) = List.foldBack
- let v28 : (char -> (UH1 -> UH1)) = method17()
- let v29 : (char list -> (UH1 -> UH1)) = v27 v28
- let v30 : (UH1 -> UH1) = v29 v26
- let v31 : UH1 = UH1_0
- let v32 : UH1 = v30 v31
- let struct (v33 : System.Text.StringBuilder, v34 : int32, v35 : int32) = method18(v32, v1, v2, v3)
- US8_0(v7, v15, v33, v34, v35)
- else
- let v37 : (string -> int32) = String.length
- let v38 : int32 = v37 v0
- let v39 : string = "\n"
- let v40 : int32 = v0.IndexOf v39
- let v41 : int32 = v40 - 1
- let v42 : bool = -2 = v41
- let v43 : int32 =
- if v42 then
- v38
- else
- v41
- let v44 : (int32 -> int32) = int32
- let v45 : int32 = v44 0
- let v46 : (int32 -> int32) = int32
- let v47 : int32 = v46 v43
- let v48 : string = v0.[int v45..int v47]
- let v49 : string = $"parsing.p_char / expected: '{'\\'}' / line: {v3} / col: {v2}
-{v1}{v48}"
- let v50 : int32 = v2 - 1
- let v51 : (int32 -> (string -> string)) = String.replicate
- let v52 : (string -> string) = v51 v50
- let v53 : string = " "
- let v54 : string = v52 v53
- let v55 : string = "^"
- let v56 : string = v54 + v55
- let v57 : string = $"{v49}
-{v56}
-"
- US8_1(v57)
- let v102 : US8 =
- match v60 with
- | US8_1(v99) -> (* Error *)
- US8_1(v99)
- | US8_0(v61, v62, v63, v64, v65) -> (* Ok *)
- let v66 : bool = "" = v62
- if v66 then
- let v67 : string = $"parsing.any_char / unexpected end of input / s: %A{struct (v63, v64, v65)}"
- US8_1(v67)
- else
- let v69 : char = v62.[int 0]
- let v70 : (string -> int32) = String.length
- let v71 : int32 = v70 v62
- let v72 : (int32 -> int32) = int32
- let v73 : int32 = v72 1
- let v74 : (int32 -> int32) = int32
- let v75 : int32 = v74 v71
- let v76 : string = v62.[int v73..int v75]
- let v77 : (char -> string) = _.ToString()
- let v78 : string = v77 v69
- let v79 : int32 = v78.Length
- let v80 : (char []) = Array.zeroCreate (v79)
- let v81 : Mut4 = {l0 = 0} : Mut4
- while method16(v79, v81) do
- let v83 : int32 = v81.l0
- let v84 : char = v78.[int v83]
- v80.[int v83] <- v84
- let v85 : int32 = v83 + 1
- v81.l0 <- v85
- ()
- let v86 : ((char []) -> char list) = Array.toList
- let v87 : char list = v86 v80
- let v88 : ((char -> (UH1 -> UH1)) -> (char list -> (UH1 -> UH1))) = List.foldBack
- let v89 : (char -> (UH1 -> UH1)) = method17()
- let v90 : (char list -> (UH1 -> UH1)) = v88 v89
- let v91 : (UH1 -> UH1) = v90 v87
- let v92 : UH1 = UH1_0
- let v93 : UH1 = v91 v92
- let struct (v94 : System.Text.StringBuilder, v95 : int32, v96 : int32) = method18(v93, v63, v64, v65)
- US8_0(v69, v76, v94, v95, v96)
- match v102 with
- | US8_1(v110) -> (* Error *)
- US10_1(v110)
- | US8_0(v103, v104, v105, v106, v107) -> (* Ok *)
- let v108 : string = $"{'\\'}{v103}"
- US10_0(v108, v104, v105, v106, v107)
-and closure12 () struct (v0 : string, v1 : System.Text.StringBuilder, v2 : int32, v3 : int32) : US10 =
- let v4 : bool = "" = v0
- let v60 : US8 =
- if v4 then
- let v5 : string = $"parsing.p_char / unexpected end of input / s: %A{struct (v1, v2, v3)}"
- US8_1(v5)
- else
- let v7 : char = v0.[int 0]
- let v8 : bool = v7 = '`'
- if v8 then
- let v9 : (string -> int32) = String.length
- let v10 : int32 = v9 v0
- let v11 : (int32 -> int32) = int32
- let v12 : int32 = v11 1
- let v13 : (int32 -> int32) = int32
- let v14 : int32 = v13 v10
- let v15 : string = v0.[int v12..int v14]
- let v16 : (char -> string) = _.ToString()
- let v17 : string = v16 v7
- let v18 : int32 = v17.Length
- let v19 : (char []) = Array.zeroCreate (v18)
- let v20 : Mut4 = {l0 = 0} : Mut4
- while method16(v18, v20) do
- let v22 : int32 = v20.l0
- let v23 : char = v17.[int v22]
- v19.[int v22] <- v23
- let v24 : int32 = v22 + 1
- v20.l0 <- v24
- ()
- let v25 : ((char []) -> char list) = Array.toList
- let v26 : char list = v25 v19
- let v27 : ((char -> (UH1 -> UH1)) -> (char list -> (UH1 -> UH1))) = List.foldBack
- let v28 : (char -> (UH1 -> UH1)) = method17()
- let v29 : (char list -> (UH1 -> UH1)) = v27 v28
- let v30 : (UH1 -> UH1) = v29 v26
- let v31 : UH1 = UH1_0
- let v32 : UH1 = v30 v31
- let struct (v33 : System.Text.StringBuilder, v34 : int32, v35 : int32) = method18(v32, v1, v2, v3)
- US8_0(v7, v15, v33, v34, v35)
- else
- let v37 : (string -> int32) = String.length
- let v38 : int32 = v37 v0
- let v39 : string = "\n"
- let v40 : int32 = v0.IndexOf v39
- let v41 : int32 = v40 - 1
- let v42 : bool = -2 = v41
- let v43 : int32 =
- if v42 then
- v38
- else
- v41
- let v44 : (int32 -> int32) = int32
- let v45 : int32 = v44 0
- let v46 : (int32 -> int32) = int32
- let v47 : int32 = v46 v43
- let v48 : string = v0.[int v45..int v47]
- let v49 : string = $"parsing.p_char / expected: '{'`'}' / line: {v3} / col: {v2}
-{v1}{v48}"
- let v50 : int32 = v2 - 1
- let v51 : (int32 -> (string -> string)) = String.replicate
- let v52 : (string -> string) = v51 v50
- let v53 : string = " "
- let v54 : string = v52 v53
- let v55 : string = "^"
- let v56 : string = v54 + v55
- let v57 : string = $"{v49}
-{v56}
-"
- US8_1(v57)
- let v102 : US8 =
- match v60 with
- | US8_1(v99) -> (* Error *)
- US8_1(v99)
- | US8_0(v61, v62, v63, v64, v65) -> (* Ok *)
- let v66 : bool = "" = v62
- if v66 then
- let v67 : string = $"parsing.any_char / unexpected end of input / s: %A{struct (v63, v64, v65)}"
- US8_1(v67)
- else
- let v69 : char = v62.[int 0]
- let v70 : (string -> int32) = String.length
- let v71 : int32 = v70 v62
- let v72 : (int32 -> int32) = int32
- let v73 : int32 = v72 1
- let v74 : (int32 -> int32) = int32
- let v75 : int32 = v74 v71
- let v76 : string = v62.[int v73..int v75]
- let v77 : (char -> string) = _.ToString()
- let v78 : string = v77 v69
- let v79 : int32 = v78.Length
- let v80 : (char []) = Array.zeroCreate