Supervisor (Polyglot)¶
In [ ]:
#r @"../../../../../../../.nuget/packages/fsharp.control.asyncseq/3.2.1/lib/netstandard2.1/FSharp.Control.AsyncSeq.dll"
#r @"../../../../../../../.nuget/packages/system.reactive/6.0.1-preview.1/lib/net6.0/System.Reactive.dll"
#r @"../../../../../../../.nuget/packages/system.reactive.linq/6.0.1-preview.1/lib/netstandard2.0/System.Reactive.Linq.dll"
#r @"../../../../../../../.nuget/packages/argu/6.2.4/lib/netstandard2.0/Argu.dll"
#r @"../../../../../../../.nuget/packages/microsoft.aspnetcore.http.connections.common/7.0.0/lib/net7.0/Microsoft.AspNetCore.Http.Connections.Common.dll"
#r @"../../../../../../../.nuget/packages/microsoft.aspnetcore.http.connections.client/7.0.0/lib/net7.0/Microsoft.AspNetCore.Http.Connections.Client.dll"
#r @"../../../../../../../.nuget/packages/microsoft.aspnetcore.signalr.common/7.0.0/lib/net7.0/Microsoft.AspNetCore.SignalR.Common.dll"
#r @"../../../../../../../.nuget/packages/microsoft.aspnetcore.signalr.client/7.0.0/lib/net7.0/Microsoft.AspNetCore.SignalR.Client.dll"
#r @"../../../../../../../.nuget/packages/microsoft.aspnetcore.signalr.client.core/7.0.0/lib/net7.0/Microsoft.AspNetCore.SignalR.Client.Core.dll"
#r @"../../../../../../../.nuget/packages/fsharp.json/0.4.1/lib/netstandard2.0/FSharp.Json.dll"
In [ ]:
#!import ../../lib/fsharp/Notebooks.dib
#!import ../../lib/fsharp/Testing.dib
In [ ]:
#!import ../../lib/fsharp/Common.fs
#!import ../../lib/fsharp/CommonFSharp.fs
#!import ../../lib/fsharp/Async.fs
#!import ../../lib/fsharp/AsyncSeq.fs
#!import ../../lib/fsharp/Runtime.fs
#!import ../../lib/fsharp/FileSystem.fs
In [ ]:
#if !INTERACTIVE
open Lib
#endif
In [ ]:
open Common
open SpiralFileSystem.Operators
open Microsoft.AspNetCore.SignalR.Client
sendJson¶
In [ ]:
let sendJson (port : int) (json : string) = async {
let host = "127.0.0.1"
let! portOpen = SpiralNetworking.test_port_open host port
if portOpen then
try
let connection = HubConnectionBuilder().WithUrl($"http://{host}:{port}").Build()
do! connection.StartAsync () |> Async.AwaitTask
let! result = connection.InvokeAsync<string> ("ClientToServerMsg", json) |> Async.AwaitTask
do! connection.StopAsync () |> Async.AwaitTask
trace Verbose (fun () -> $"Supervisor.sendJson / port: {port} / json: {json |> SpiralSm.ellipsis_end 200} / result: {result |> Option.ofObj |> Option.map (SpiralSm.ellipsis_end 200)}") _locals
return Some result
with ex ->
trace Critical (fun () -> $"Supervisor.sendJson / port: {port} / json: {json |> SpiralSm.ellipsis_end 200} / ex: {ex |> SpiralSm.format_exception}") _locals
return None
else
trace Debug (fun () -> $"Supervisor.sendJson / port: {port} / error: port not open") _locals
return None
}
sendObj¶
In [ ]:
let sendObj port obj =
obj
|> System.Text.Json.JsonSerializer.Serialize
|> sendJson port
VSCPos¶
In [ ]:
type VSCPos = {| line : int; character : int |}
VSCRange¶
In [ ]:
type VSCRange = VSCPos * VSCPos
RString¶
In [ ]:
type RString = VSCRange * string
TracedError¶
In [ ]:
type TracedError = {| trace : string list; message : string |}
ClientErrorsRes¶
In [ ]:
type ClientErrorsRes =
| FatalError of string
| TracedError of TracedError
| PackageErrors of {| uri : string; errors : RString list |}
| TokenizerErrors of {| uri : string; errors : RString list |}
| ParserErrors of {| uri : string; errors : RString list |}
| TypeErrors of {| uri : string; errors : RString list |}
workspaceRoot¶
In [ ]:
let workspaceRoot = SpiralFileSystem.get_workspace_root ()
awaitCompiler¶
In [ ]:
let awaitCompiler port cancellationToken = async {
let host = "127.0.0.1"
let struct (ct, disposable) = cancellationToken |> SpiralThreading.new_disposable_token
let! ct = ct |> SpiralAsync.merge_cancellation_token_with_default_async
let compiler = MailboxProcessor.Start (fun inbox -> async {
let! availablePort = SpiralNetworking.get_available_port (Some 180) host port
if availablePort <> port then
inbox.Post (port, false)
else
let compilerPath =
workspaceRoot </> "deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release"
|> System.IO.Path.GetFullPath
let dllPath = compilerPath </> "Spiral.dll"
let! exitCode, result =
SpiralRuntime.execution_options (fun x ->
{ x with
l0 = $@"dotnet ""{dllPath}"" --port {availablePort} --default-int i32 --default-float f64"
l1 = Some ct
l3 = Some (fun struct (_, line, _) -> async {
if line |> SpiralSm.contains $"System.IO.IOException: Failed to bind to address http://{host}:{port}: address already in use." then
inbox.Post (port, false)
if line |> SpiralSm.contains $"Server bound to: http://localhost:{availablePort}" then
let rec loop retry = async {
do!
SpiralNetworking.wait_for_port_access (Some 100) true host availablePort
|> Async.runWithTimeoutAsync 500
|> Async.Ignore
let _locals () = $"port: {availablePort} / retry: {retry} / {_locals ()}"
try
let pingObj = {| Ping = true |}
let! pingResult = pingObj |> sendObj availablePort
trace Verbose (fun () -> $"Supervisor.awaitCompiler / Ping / result: '%A{pingResult}'") _locals
match pingResult with
| Some _ -> inbox.Post (availablePort, true)
| None -> do! loop (retry + 1)
with ex ->
trace Verbose (fun () -> $"Supervisor.awaitCompiler / Ping / ex: {ex |> SpiralSm.format_exception}") _locals
do! loop (retry + 1)
}
do! loop 1
})
l6 = Some workspaceRoot
}
)
|> SpiralRuntime.execute_with_options_async
trace Debug (fun () -> $"Supervisor.awaitCompiler / exitCode: {exitCode} / result: {result}") _locals
disposable.Dispose ()
}, ct)
let! serverPort, managed = compiler.Receive ()
let connection = HubConnectionBuilder().WithUrl($"http://{host}:{serverPort}").Build ()
do! connection.StartAsync () |> Async.AwaitTask
let event = Event<_> ()
let disposable' = connection.On<string> ("ServerToClientMsg", event.Trigger)
let stream =
FSharp.Control.AsyncSeq.unfoldAsync
(fun () -> async {
let! msg = event.Publish |> Async.AwaitEvent
return Some (msg |> FSharp.Json.Json.deserialize<ClientErrorsRes>, ())
})
()
let disposable' =
new_disposable (fun () ->
async {
disposable'.Dispose ()
do! connection.StopAsync () |> Async.AwaitTask
disposable.Dispose ()
if managed
then do!
SpiralNetworking.wait_for_port_access (Some 100) false host serverPort
|> Async.runWithTimeoutAsync 1500
|> Async.Ignore
}
|> Async.RunSynchronously
)
return
serverPort,
stream,
ct,
disposable'
}
getFilePathFromUri¶
In [ ]:
let getFilePathFromUri uri =
match System.Uri.TryCreate (uri, System.UriKind.Absolute) with
| true, uri -> uri.AbsolutePath |> System.IO.Path.GetFullPath
| _ -> failwith "invalid uri"
getCompilerPort¶
In [ ]:
let getCompilerPort () =
13805
serialize_obj¶
In [ ]:
let serializeObj obj =
try
obj
|> FSharp.Json.Json.serialize
|> SpiralSm.replace "\\\\" "\\"
|> SpiralSm.replace "\\r\\n" "\n"
|> SpiralSm.replace "\\n" "\n"
with ex ->
trace Critical (fun () -> "Supervisor.serialize_obj / obj: %A{obj}") _locals
""
Backend¶
In [ ]:
type Backend =
| Fsharp
| Cuda
buildFile¶
In [ ]:
let buildFile backend timeout port cancellationToken path =
let rec loop retry = async {
let fullPath = path |> System.IO.Path.GetFullPath |> SpiralFileSystem.normalize_path
let fileDir = fullPath |> System.IO.Path.GetDirectoryName
let fileName = fullPath |> System.IO.Path.GetFileNameWithoutExtension
let! code = fullPath |> SpiralFileSystem.read_all_text_async
let stream, disposable = fileDir |> FileSystem.watchDirectory (fun _ -> true)
use _ = disposable
let struct (token, disposable) = SpiralThreading.new_disposable_token cancellationToken
use _ = disposable
let port = port |> Option.defaultWith getCompilerPort
let! serverPort, errors, ct, disposable = awaitCompiler port (Some token)
use _ = disposable
let outputFileName =
match backend with
| Fsharp -> $"{fileName}.fsx"
| Cuda -> $"{fileName}.py"
let outputContentSeq =
stream
|> FSharp.Control.AsyncSeq.chooseAsync (function
| _, (FileSystem.FileSystemChange.Changed (path, Some text))
when (path |> System.IO.Path.GetFileName) = outputFileName
->
// fileDir </> path |> SpiralFileSystem.read_all_text_retry_async
text |> Some |> Async.init
| _ -> None |> Async.init
)
|> FSharp.Control.AsyncSeq.map (fun content ->
Some (content |> SpiralSm.replace "\r\n" "\n"), None
)
let printErrorData (data : {| uri : string; errors : RString list |}) =
let fileName = data.uri |> System.IO.Path.GetFileName
let errors =
data.errors
|> List.map snd
|> SpiralSm.concat "\n"
$"{fileName}:\n{errors}"
let errorsSeq =
errors
|> FSharp.Control.AsyncSeq.choose (fun error ->
match error with
| FatalError message ->
Some (message, error)
| TracedError data ->
Some (data.message, error)
| PackageErrors data when data.errors |> List.isEmpty |> not ->
Some (data |> printErrorData, error)
| TokenizerErrors data when data.errors |> List.isEmpty |> not ->
Some (data |> printErrorData, error)
| ParserErrors data when data.errors |> List.isEmpty |> not ->
Some (data |> printErrorData, error)
| TypeErrors data when data.errors |> List.isEmpty |> not ->
Some (data |> printErrorData, error)
| _ -> None
)
|> FSharp.Control.AsyncSeq.map (fun (message, error) ->
None, Some (message, error)
)
let timerSeq =
500
|> FSharp.Control.AsyncSeq.intervalMs
|> FSharp.Control.AsyncSeq.map (fun _ -> None, None)
let outputSeq =
[ outputContentSeq; errorsSeq; timerSeq ]
|> FSharp.Control.AsyncSeq.mergeAll
let! outputChild =
((None, [], 0), outputSeq)
||> FSharp.Control.AsyncSeq.scan (
fun (outputContentResult, errors, typeErrorCount) (outputContent, error) ->
trace Debug (fun () -> $"Supervisor.buildFile / AsyncSeq.scan / path: {path} / errors: {errors |> serializeObj} / outputContentResult: {outputContentResult} / typeErrorCount: {typeErrorCount} / retry: {retry} / error: {error} / outputContent:\n{outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 1500}") _locals
match outputContent, error with
| Some outputContent, None -> Some outputContent, errors, typeErrorCount
| None, Some (_, FatalError "File main has a type error somewhere in its path.") ->
outputContentResult, errors, typeErrorCount + 1
| None, Some error -> outputContentResult, error :: errors, typeErrorCount
| None, None when typeErrorCount >= 1 ->
outputContentResult, errors, typeErrorCount + 1
| _ -> outputContentResult, errors, typeErrorCount
)
|> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (outputContent, errors, typeErrorCount) ->
trace Debug (fun () -> $"Supervisor.buildFile / takeWhileInclusive / path: {path} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount} / retry: {retry} / outputContent:\n{outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 1500}") _locals
#if INTERACTIVE
let errorWait = 2
#else
let errorWait = 2
#endif
match outputContent, errors with
| None, [] when typeErrorCount > errorWait -> false
| None, [] -> true
| _ -> false
)
|> FSharp.Control.AsyncSeq.tryLast
|> Async.withCancellationToken ct
|> Async.catch
|> Async.runWithTimeoutAsync timeout
|> Async.StartChild
// do! Async.Sleep 60
let fullPathUri = fullPath |> SpiralFileSystem.normalize_path |> SpiralFileSystem.new_file_uri
let fileOpenObj = {| FileOpen = {| uri = fullPathUri; spiText = code |} |}
let! _fileOpenResult = fileOpenObj |> sendObj serverPort
// do! Async.Sleep 60
let backendId =
match backend with
| Fsharp -> "Fsharp"
| Cuda -> "Python + Cuda"
let buildFileObj = {| BuildFile = {| uri = fullPathUri; backend = backendId |} |}
let! _buildFileResult = buildFileObj |> sendObj serverPort
let! result, typeErrorCount =
outputChild
|> Async.map (function
| Some (Ok (Some (outputCode, errors, typeErrorCount))) ->
(outputCode, errors |> List.distinct |> List.rev), typeErrorCount
| Some (Error ex) ->
trace Critical (fun () -> $"Supervisor.buildFile / error: {ex |> SpiralSm.format_exception} / retry: {retry}") _locals
(None, []), 0
| _ -> (None, []), 0
)
match result with
| None, _ when typeErrorCount > 0 && retry = 0 ->
return! loop (retry + 1)
| _ ->
if fileDir |> SpiralSm.starts_with (workspaceRoot </> "target") then
let fileDirUri = fileDir |> SpiralFileSystem.normalize_path |> SpiralFileSystem.new_file_uri
let fileDeleteObj = {| FileDelete = {| uris = [| fileDirUri |] |} |}
let! _fileDeleteResult = fileDeleteObj |> sendObj serverPort
()
let outputPath = fileDir </> outputFileName
return outputPath, result
}
loop 0
SpiralInput¶
In [ ]:
type SpiralInput =
| Spi of string * string option
| Spir of string
persistCode¶
In [ ]:
let persistCode (input: {| backend : Backend option; input: SpiralInput; packages: string [] |}) = async {
let targetDir = workspaceRoot </> "target/spiral_Eval"
let packagesDir = targetDir </> "packages"
let hashHex = $"%A{input.backend}%A{input.input}" |> SpiralCrypto.hash_text
let packageDir = packagesDir </> hashHex
packageDir |> System.IO.Directory.CreateDirectory |> ignore
let moduleName = "main"
let spirModule, spiModule =
match input.input with
| Spi (_spi, Some _spir) -> true, true
| Spi (_spi, None) -> false, true
| Spir _spir -> true, false
|> fun (spir, spi) ->
(if spir then $"{moduleName}_real*-" else ""),
if spi then moduleName else ""
let libLinkTargetPath = workspaceRoot </> "../spiral/lib/spiral"
let libLinkPath = packageDir </> "spiral"
let packagesModule =
input.packages
|> Array.map (fun package ->
let path = workspaceRoot </> package
let packageName = path |> System.IO.Path.GetFileName
let libLinkPath = packageDir </> packageName
libLinkPath |> SpiralFileSystem.link_directory path
$"{packageName}-"
)
|> String.concat "\n "
let packageDir' =
if input.packages |> Array.isEmpty
then workspaceRoot </> "../spiral/lib"
else
libLinkPath |> SpiralFileSystem.link_directory libLinkTargetPath
packageDir
let spiprojPath = packageDir </> "package.spiproj"
let spiprojCode =
$"""packageDir: {packageDir'}
packages:
|core-
spiral-
{packagesModule}
modules:
{spirModule}
{spiModule}
"""
do! spiprojCode |> SpiralFileSystem.write_all_text_exists spiprojPath
let spirPath = packageDir </> $"{moduleName}_real.spir"
let spiPath = packageDir </> $"{moduleName}.spi"
let spirCode, spiCode =
match input.input with
| Spi (spi, Some spir) -> Some spir, Some spi
| Spi (spi, None) -> None, Some spi
| Spir spir -> Some spir, None
match spirCode with
| Some spir -> do! spir |> SpiralFileSystem.write_all_text_exists spirPath
| None -> ()
match spiCode with
| Some spi -> do! spi |> SpiralFileSystem.write_all_text_exists spiPath
| None -> ()
let spiralPath =
match input.input with
| Spi _ -> spiPath
| Spir _ -> spirPath
match input.backend with
| None -> return spiralPath, None
| Some backend ->
let outputFileName =
let fileName =
match input.input with
| Spi _ -> moduleName
| Spir _ -> $"{moduleName}_real"
match backend with
| Fsharp -> $"{fileName}.fsx"
| Cuda -> $"{fileName}.py"
let outputPath = packageDir </> outputFileName
if outputPath |> System.IO.File.Exists |> not
then return spiralPath, None
else
let! oldCode = spiralPath |> SpiralFileSystem.read_all_text_async
if oldCode <> (spiCode |> Option.defaultValue (spirCode |> Option.defaultValue ""))
then return spiralPath, None
else
let! outputCode = outputPath |> SpiralFileSystem.read_all_text_async
return spiralPath, Some (outputPath, outputCode |> SpiralSm.replace "\r\n" "\n")
}
buildCode¶
In [ ]:
let buildCode backend packages isCache timeout cancellationToken input = async {
let! mainPath, outputCache =
persistCode {| input = input; backend = Some backend; packages = packages |}
match outputCache with
| Some (outputPath, outputCode) when isCache -> return mainPath, (outputPath, Some outputCode), []
| _ ->
let! outputPath, (outputCode, errors) = mainPath |> buildFile backend timeout None cancellationToken
return mainPath, (outputPath, outputCode), errors
}
In [ ]:
//// test
"""inl app () =
console.write_line "text"
1i32
inl main () =
app
|> dyn
|> ignore
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 15000 None
|> Async.runWithTimeout 15000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some """let rec closure1 () () : unit =
let v0 : (string -> unit) = System.Console.WriteLine
let v1 : string = "text"
v0 v1
and closure0 () () : int32 =
let v0 : unit = ()
let v1 : (unit -> unit) = closure1()
let v2 : unit = (fun () -> v1 (); v0) ()
1
let v0 : (unit -> int32) = closure0()
()
""",
[]
)
)
00:00:08 v #1 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:06 d #1 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:09 v #2 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:06 v #2 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:06 v #3 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:06 v #4 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:09 v #3 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #4 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #5 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #6 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #7 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #8 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #9 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #10 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #11 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #12 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #13 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #14 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #15 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #16 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #17 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #18 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #19 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #20 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #21 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #22 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #23 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #24 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #25 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #26 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #27 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #28 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #29 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:07 v #5 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:09 v #30 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #31 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #32 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:09 v #33 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:04 v #1 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:04 v #2 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:07 v #6 > Server bound to: http://localhost:13805 00:00:04 d #3 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:04 d #4 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:04 d #5 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:04 v #6 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl app () =\n console.write_line \u0022text\u0022\n 1i32\n\ninl main ...et/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi"}} / result: 00:00:04 v #7 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi"}} / result: 00:00:04 d #8 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:04 d #9 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:05 d #10 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:05 d #11 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:05 d #12 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:05 d #13 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:06 d #14 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:06 d #15 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:06 d #16 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:06 d #17 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:07 d #18 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: let rec closure1 () () : unit = let v0 : (string -> unit) = System.Console.WriteLine let v1 : string = "text" v0 v1 and closure0 () () : int32 = let v0 : unit = () let v1 : (unit -> unit) = closure1() let v2 : unit = (fun () -> v1 (); v0) () 1 let v0 : (unit -> int32) = closure0() () 00:00:07 d #19 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: let rec closure1 () () : unit = let v0 : (string -> unit) = System.Console.WriteLine let v1 : string = "text" v0 v1 and closure0 () () : int32 = let v0 : unit = () let v1 : (unit -> unit) = closure1() let v2 : unit = (fun () -> v1 (); v0) () 1 let v0 : (unit -> int32) = closure0() () 00:00:07 v #20 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/22ccd04317d5605c65f81c7f777766f357e85dc69f2d6d04b9dc60aebd08a0d6"]}} / result: 00:00:12 v #34 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:07 d #21 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (Some "let rec closure1 () () : unit = let v0 : (string -> unit) = System.Console.WriteLine let v1 : string = "text" v0 v1 and closure0 () () : int32 = let v0 : unit = () let v1 : (unit -> unit) = closure1() let v2 : unit = (fun () -> v1 (); v0) () 1 let v0 : (unit -> int32) = closure0() () ", [])
In [ ]:
//// test
""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[ "Cannot find `main` in file main." ]
)
)
00:00:12 v #35 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:10 d #7 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:13 v #36 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:10 v #8 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:10 v #9 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:13 v #37 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:10 v #10 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:13 v #38 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #39 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #40 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #41 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #42 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #43 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #44 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #45 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #46 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #47 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #48 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #49 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #50 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #51 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #52 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #53 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #54 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #55 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #56 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #57 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #58 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #59 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:10 v #11 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:13 v #60 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #61 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #62 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:13 v #63 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:08 v #22 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:08 v #23 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:11 v #12 > Server bound to: http://localhost:13805 00:00:08 d #24 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:08 d #25 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:08 d #26 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:08 v #27 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi"}} / result: 00:00:08 v #28 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi"}} / result: 00:00:08 d #29 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:08 d #30 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:09 d #31 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:09 d #32 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:09 d #33 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:09 d #34 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:10 d #35 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:10 d #36 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:10 d #37 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:10 d #38 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:11 d #39 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((Cannot find `main` in file main., FatalError "Cannot find `main` in file main.")) / outputContent: 00:00:11 d #40 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa/main.spi / errors: [ [ "Cannot find `main` in file main.", { "FatalError": "Cannot find `main` in file main." } ] ] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:11 v #41 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a65342ccc7da0da967b18d8e705d0260e9a932e5e68c0feb33db55c4d28170aa"]}} / result: 00:00:16 v #64 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 d #42 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["Cannot find `main` in file main."])
In [ ]:
//// test
"""inl main () =
1i32 / 0i32
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[ "An attempt to divide by zero has been detected at compile time." ]
)
)
00:00:16 v #65 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:14 d #13 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:16 v #66 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:14 v #14 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:14 v #15 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:14 v #16 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:16 v #67 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #68 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #69 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #70 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #71 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #72 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #73 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #74 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #75 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #76 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #77 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #78 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #79 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #80 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #81 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #82 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #83 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #84 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #85 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #86 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #87 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #88 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #89 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #90 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #91 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #92 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:14 v #17 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:16 v #93 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #94 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:16 v #95 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:11 v #43 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:11 v #44 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:14 v #18 > Server bound to: http://localhost:13805 00:00:11 d #45 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:11 d #46 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:11 d #47 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:11 v #48 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n 1i32 / 0i32\n","uri":"file:///home/runner/work/polyglot/p...et/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi"}} / result: 00:00:11 v #49 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi"}} / result: 00:00:12 d #50 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:12 d #51 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:12 d #52 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:12 d #53 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:13 d #54 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:13 d #55 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:13 d #56 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:13 d #57 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:14 d #58 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:14 d #59 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:14 d #60 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((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: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi. inl main () = ^ "; "Error trace on line: 2, column: 5 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi. 1i32 / 0i32 ^ "] })) / outputContent: 00:00:14 d #61 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi / 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: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi. inl main () = ^ ", "Error trace on line: 2, column: 5 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2/main.spi. 1i32 / 0i32 ^ " ] } } ] ] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:14 v #62 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/fef9812d9b06b75b1ab26589e52c6d6ff05910b73ead9e8c4f27f88d2a5cdfb2"]}} / result: 00:00:19 v #96 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:14 d #63 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["An attempt to divide by zero has been detected at compile time."])
In [ ]:
//// test
"""inl main () =
1 + ""
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[
"main.spi:
Constraint satisfaction error.
Got: string
Fails to satisfy: number"
]
)
)
00:00:19 v #97 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:17 d #19 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:19 v #98 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:19 v #99 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:17 v #20 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:17 v #21 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:17 v #22 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:20 v #100 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #101 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #102 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #103 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #104 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #105 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #106 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #107 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #108 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #109 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #110 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #111 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #112 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #113 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #114 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #115 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #116 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #117 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #118 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #119 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #120 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #121 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:17 v #23 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:20 v #122 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #123 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #124 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:15 v #64 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:15 v #65 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:18 v #24 > Server bound to: http://localhost:13805 00:00:15 d #66 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:15 d #67 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:15 d #68 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:15 v #69 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n 1 \u002B \u0022\u0022\n","uri":"file:///home/runner/work/...et/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi"}} / result: 00:00:15 v #70 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi"}} / result: 00:00:15 d #71 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:15 d #72 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:16 d #73 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:16 d #74 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:16 d #75 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:16 d #76 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:17 d #77 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:17 d #78 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:17 d #79 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((File main has a type error somewhere in its path., FatalError "File main has a type error somewhere in its path.")) / outputContent: 00:00:17 d #80 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / typeErrorCount: 1 / retry: 0 / outputContent: 00:00:17 d #81 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / outputContentResult: / typeErrorCount: 1 / retry: 0 / error: Some((main.spi: Constraint satisfaction error. Got: string Fails to satisfy: number, TypeErrors { errors = [(({ character = 8 line = 1 }, { character = 10 line = 1 }), "Constraint satisfaction error. Got: string Fails to satisfy: number")] uri = "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi" })) / outputContent: 00:00:17 d #82 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [ [ "main.spi: Constraint satisfaction error. Got: string Fails to satisfy: number", { "TypeErrors": { "errors": [ [ [ { "character": 8, "line": 1 }, { "character": 10, "line": 1 } ], "Constraint satisfaction error. Got: string Fails to satisfy: number" ] ], "uri": "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi" } } ] ] / typeErrorCount: 1 / retry: 0 / outputContent: 00:00:22 v #125 networking.test_port_open / { port = 13806; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:17 d #83 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / typeErrorCount: 0 / retry: 1 / outputContent: 00:00:17 d #84 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 1 / error: / outputContent: 00:00:17 d #85 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / typeErrorCount: 0 / retry: 1 / outputContent: 00:00:17 v #86 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n 1 \u002B \u0022\u0022\n","uri":"file:///home/runner/work/...et/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi"}} / result: 00:00:17 v #87 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi"}} / result: 00:00:17 d #88 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 1 / error: Some((main.spi: Constraint satisfaction error. Got: string Fails to satisfy: number, TypeErrors { errors = [(({ character = 8 line = 1 }, { character = 10 line = 1 }), "Constraint satisfaction error. Got: string Fails to satisfy: number")] uri = "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi" })) / outputContent: 00:00:17 d #89 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi / errors: [ [ "main.spi: Constraint satisfaction error. Got: string Fails to satisfy: number", { "TypeErrors": { "errors": [ [ [ { "character": 8, "line": 1 }, { "character": 10, "line": 1 } ], "Constraint satisfaction error. Got: string Fails to satisfy: number" ] ], "uri": "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0/main.spi" } } ] ] / typeErrorCount: 0 / retry: 1 / outputContent: 00:00:17 v #90 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c030f84f8e553befcbdd9aabeace67685221d91a46e3655199e42df713504aa0"]}} / result: 00:00:17 d #91 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite 00:00:22 v #126 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:17 d #92 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["main.spi: Constraint satisfaction error. Got: string Fails to satisfy: number"])
In [ ]:
//// test
"""inl main () =
x + y
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[
"main.spi:
Unbound variable: x.
Unbound variable: y."
]
)
)
00:00:22 v #127 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 d #25 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:23 v #128 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 v #26 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:20 v #27 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:20 v #28 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:23 v #129 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #130 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #131 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #132 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #133 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #134 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #135 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #136 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #137 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #138 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #139 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #140 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #141 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #142 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #143 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #144 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #145 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #146 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #147 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #148 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #149 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #150 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #151 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:21 v #29 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:23 v #152 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #153 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #154 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #155 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:18 v #93 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:18 v #94 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:21 v #30 > Server bound to: http://localhost:13805 00:00:18 d #95 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:18 d #96 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:18 d #97 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:18 v #98 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n x \u002B y\n","uri":"file:///home/runner/work/polyglot/po...et/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi"}} / result: 00:00:18 v #99 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi"}} / result: 00:00:18 d #100 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:18 d #101 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:19 d #102 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:19 d #103 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:19 d #104 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:19 d #105 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:20 d #106 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:20 d #107 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:20 d #108 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((File main has a type error somewhere in its path., FatalError "File main has a type error somewhere in its path.")) / outputContent: 00:00:20 d #109 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / typeErrorCount: 1 / retry: 0 / outputContent: 00:00:20 d #110 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / outputContentResult: / typeErrorCount: 1 / retry: 0 / error: Some((main.spi: Unbound variable: x. Unbound variable: y., TypeErrors { errors = [(({ character = 4 line = 1 }, { character = 5 line = 1 }), "Unbound variable: x."); (({ character = 8 line = 1 }, { character = 9 line = 1 }), "Unbound variable: y.")] uri = "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi" })) / outputContent: 00:00:20 d #111 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [ [ "main.spi: Unbound variable: x. Unbound variable: y.", { "TypeErrors": { "errors": [ [ [ { "character": 4, "line": 1 }, { "character": 5, "line": 1 } ], "Unbound variable: x." ], [ [ { "character": 8, "line": 1 }, { "character": 9, "line": 1 } ], "Unbound variable: y." ] ], "uri": "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi" } } ] ] / typeErrorCount: 1 / retry: 0 / outputContent: 00:00:25 v #156 networking.test_port_open / { port = 13806; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 d #112 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / typeErrorCount: 0 / retry: 1 / outputContent: 00:00:20 d #113 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 1 / error: / outputContent: 00:00:20 d #114 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / typeErrorCount: 0 / retry: 1 / outputContent: 00:00:20 v #115 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () =\n x \u002B y\n","uri":"file:///home/runner/work/polyglot/po...et/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi"}} / result: 00:00:20 v #116 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi"}} / result: 00:00:20 d #117 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 1 / error: Some((main.spi: Unbound variable: x. Unbound variable: y., TypeErrors { errors = [(({ character = 4 line = 1 }, { character = 5 line = 1 }), "Unbound variable: x."); (({ character = 8 line = 1 }, { character = 9 line = 1 }), "Unbound variable: y.")] uri = "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi" })) / outputContent: 00:00:20 d #118 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi / errors: [ [ "main.spi: Unbound variable: x. Unbound variable: y.", { "TypeErrors": { "errors": [ [ [ { "character": 4, "line": 1 }, { "character": 5, "line": 1 } ], "Unbound variable: x." ], [ [ { "character": 8, "line": 1 }, { "character": 9, "line": 1 } ], "Unbound variable: y." ] ], "uri": "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1/main.spi" } } ] ] / typeErrorCount: 0 / retry: 1 / outputContent: 00:00:20 v #119 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/6cdeec507f9de5ba9c8429cfa7049b777a622aa3bf7333b151c767fde35dc5d1"]}} / result: 00:00:20 d #120 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite 00:00:25 v #157 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:20 d #121 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["main.spi: Unbound variable: x. Unbound variable: y."])
In [ ]:
//// test
"""
inl main () =
real
inl unbox_real forall a. (obj : a) : a =
typecase obj with
| _ => obj
unbox_real ()
()
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[ "Cannot apply a forall with a term." ]
)
)
00:00:25 v #158 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 d #31 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:26 v #159 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #32 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:26 v #160 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 v #33 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:23 v #34 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:26 v #161 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #162 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #163 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #164 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #165 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #166 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #167 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #168 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #169 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #170 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #171 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #172 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #173 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #174 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #175 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #176 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #177 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #178 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #179 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #180 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #181 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #182 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:24 v #35 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:26 v #183 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #184 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #185 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 v #186 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:21 v #122 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:21 v #123 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:24 v #36 > Server bound to: http://localhost:13805 00:00:21 d #124 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:21 d #125 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:21 d #126 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:21 v #127 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl main () =\n real\n inl unbox_real forall a. (obj : a) : a =\...et/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi"}} / result: 00:00:21 v #128 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi"}} / result: 00:00:21 d #129 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:21 d #130 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:22 d #131 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:22 d #132 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:22 d #133 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:22 d #134 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:23 d #135 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:23 d #136 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:23 d #137 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((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: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. inl main () = ^ "; "Error trace on line: 4, column: 9 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. inl unbox_real forall a. (obj : a) : a = ^ "; "Error trace on line: 7, column: 9 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. unbox_real () ^ "] })) / outputContent: 00:00:23 d #138 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi / 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: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. inl main () = ^ ", "Error trace on line: 4, column: 9 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. inl unbox_real forall a. (obj : a) : a = ^ ", "Error trace on line: 7, column: 9 in module: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a/main.spi. unbox_real () ^ " ] } } ] ] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:23 v #139 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/667528659dc2e5af51a6ec17f1774bd7ffff5b5a47e4e117eec78e740987f29a"]}} / result: 00:00:29 v #187 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:23 d #140 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["Cannot apply a forall with a term."])
In [ ]:
//// test
"""
inl main () =
real
inl unbox_real forall a. (obj : a) : a =
typecase obj with
| _ => obj
unbox_real `i32 1
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[ "The main function should not have a forall." ]
)
)
00:00:29 v #188 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:26 d #37 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:29 v #189 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #38 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:29 v #190 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #39 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:27 v #40 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:29 v #191 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #192 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #193 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #194 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #195 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #196 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #197 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #198 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #199 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #200 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #201 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #202 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #203 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #204 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #205 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #206 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #207 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #208 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #209 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #210 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #211 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #212 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #41 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:29 v #213 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #214 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:29 v #215 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:24 v #141 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:24 v #142 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:27 v #42 > Server bound to: http://localhost:13805 00:00:24 d #143 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:24 d #144 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:24 d #145 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:24 v #146 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl main () =\n real\n inl unbox_real forall a. (obj : a) : a =\...et/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi"}} / result: 00:00:24 v #147 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi"}} / result: 00:00:25 d #148 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:25 d #149 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:25 d #150 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:25 d #151 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:26 d #152 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:26 d #153 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:26 d #154 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:26 d #155 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:27 d #156 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((The main function should not have a forall., TracedError { message = "The main function should not have a forall." trace = [] })) / outputContent: 00:00:27 d #157 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f/main.spi / errors: [ [ "The main function should not have a forall.", { "TracedError": { "message": "The main function should not have a forall.", "trace": [] } } ] ] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:27 v #158 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/0ba44c42df309b790acdf4f9fc55fcc7912380f5dd2d90fad118bad793251c4f"]}} / result: 00:00:32 v #216 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 d #159 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["The main function should not have a forall."])
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
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some "0.3325000000000001\n",
[]
)
)
00:00:32 v #217 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 d #43 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:32 v #218 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #44 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:30 v #45 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:30 v #46 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:32 v #219 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #220 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #221 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #222 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #223 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #224 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #225 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #226 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #227 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #228 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #229 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #230 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #231 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #232 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #233 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #234 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #235 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #236 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #237 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #238 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #239 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #240 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #241 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 v #47 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:32 v #242 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:32 v #243 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:33 v #244 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:27 v #160 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:27 v #161 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:30 v #48 > Server bound to: http://localhost:13805 00:00:27 d #162 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:27 d #163 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:27 d #164 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:27 v #165 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi"}} / result: 00:00:27 v #166 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi"}} / result: 00:00:28 d #167 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:28 d #168 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:28 d #169 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:28 d #170 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:29 d #171 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:29 d #172 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:29 d #173 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:29 d #174 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:30 d #175 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:30 d #176 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:30 d #177 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 0.3325000000000001 00:00:30 d #178 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 0.3325000000000001 00:00:30 v #179 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/c127414de2a2a92d9fd93ea5a8e9312a6aad9129ffd3cbd56ac7f0327106f1db"]}} / result: 00:00:35 v #245 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:30 d #180 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (Some "0.3325000000000001 ", [])
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
"""
|> fun code -> Spi (code, None)
|> buildCode Cuda [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some @"kernel = r""""""
""""""
class static_array():
def __init__(self, length):
self.ptr = []
for _ in range(length):
self.ptr.append(None)
def __getitem__(self, index):
assert 0 <= index < len(self.ptr), ""The get index needs to be in range.""
return self.ptr[index]
def __setitem__(self, index, value):
assert 0 <= index < len(self.ptr), ""The set index needs to be in range.""
self.ptr[index] = value
class static_array_list(static_array):
def __init__(self, length):
super().__init__(length)
self.length = 0
def __getitem__(self, index):
assert 0 <= index < self.length, ""The get index needs to be in range.""
return self.ptr[index]
def __setitem__(self, index, value):
assert 0 <= index < self.length, ""The set index needs to be in range.""
self.ptr[index] = value
def push(self,value):
assert (self.length < len(self.ptr)), ""The length before pushing has to be less than the maximum length of the array.""
self.ptr[self.length] = value
self.length += 1
def pop(self):
assert (0 < self.length), ""The length before popping has to be greater than 0.""
self.length -= 1
return self.ptr[self.length]
def unsafe_set_length(self,i):
assert 0 <= i <= len(self.ptr), ""The new length has to be in range.""
self.length = i
class dynamic_array(static_array):
pass
class dynamic_array_list(static_array_list):
def length_(self): return self.length
import cupy as cp
import numpy as np
from dataclasses import dataclass
from typing import NamedTuple, Union, Callable, Tuple
i8 = int; i16 = int; i32 = int; i64 = int; u8 = int; u16 = int; u32 = int; u64 = int; f32 = float; f64 = float; char = str; string = str
cuda = False
def main_body():
return 0.3325000000000001
def main():
r = main_body()
if cuda: cp.cuda.get_current_stream().synchronize() # This line is here so the `__trap()` calls on the kernel aren't missed.
return r
if __name__ == '__main__': result = main(); None if result is None else print(result)
",
[]
)
)
00:00:35 v #246 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:33 d #49 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:36 v #247 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #248 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:33 v #50 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:33 v #51 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:33 v #52 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:36 v #249 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #250 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #251 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #252 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #253 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #254 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #255 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #256 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #257 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #258 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #259 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #260 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #261 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #262 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #263 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #264 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #265 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #266 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #267 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #268 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #269 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #270 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #53 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:36 v #271 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #272 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 v #273 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:31 v #181 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:31 v #182 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:34 v #54 > Server bound to: http://localhost:13805 00:00:31 d #183 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:31 d #184 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:31 d #185 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:31 v #186 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi"}} / result: 00:00:31 v #187 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Python \u002B Cuda","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi"}} / result: 00:00:31 d #188 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:31 d #189 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:32 d #190 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:32 d #191 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:32 d #192 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:32 d #193 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:33 d #194 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:33 d #195 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:33 d #196 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:33 d #197 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:33 d #198 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: kernel = r""" """ class static_array(): def __init__(self, length): self.ptr = [] for _ in range(length): self.ptr.append(None) def __getitem__(self, index): assert 0 <= index < len(self.ptr), "The get index needs to be in range." return self.ptr[index] def __setitem__(self, index, value): assert 0 <= index < len(self.ptr), "The set index needs to be in range." self.ptr[index] = value class static_array_list(static_array): def __init__(self, length): super().__init__(length) self.length = 0 def __getitem__(self, index): assert 0 <= index < self.length, "The get index needs to be in range." return self.ptr[index] d...nge." self.length = i class dynamic_array(static_array): pass class dynamic_array_list(static_array_list): def length_(self): return self.length import cupy as cp import numpy as np from dataclasses import dataclass from typing import NamedTuple, Union, Callable, Tuple i8 = int; i16 = int; i32 = int; i64 = int; u8 = int; u16 = int; u32 = int; u64 = int; f32 = float; f64 = float; char = str; string = str cuda = False def main_body(): return 0.3325000000000001 def main(): r = main_body() if cuda: cp.cuda.get_current_stream().synchronize() # This line is here so the `__trap()` calls on the kernel aren't missed. return r if __name__ == '__main__': result = main(); None if result is None else print(result) 00:00:33 d #199 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: kernel = r""" """ class static_array(): def __init__(self, length): self.ptr = [] for _ in range(length): self.ptr.append(None) def __getitem__(self, index): assert 0 <= index < len(self.ptr), "The get index needs to be in range." return self.ptr[index] def __setitem__(self, index, value): assert 0 <= index < len(self.ptr), "The set index needs to be in range." self.ptr[index] = value class static_array_list(static_array): def __init__(self, length): super().__init__(length) self.length = 0 def __getitem__(self, index): assert 0 <= index < self.length, "The get index needs to be in range." return self.ptr[index] d...nge." self.length = i class dynamic_array(static_array): pass class dynamic_array_list(static_array_list): def length_(self): return self.length import cupy as cp import numpy as np from dataclasses import dataclass from typing import NamedTuple, Union, Callable, Tuple i8 = int; i16 = int; i32 = int; i64 = int; u8 = int; u16 = int; u32 = int; u64 = int; f32 = float; f64 = float; char = str; string = str cuda = False def main_body(): return 0.3325000000000001 def main(): r = main_body() if cuda: cp.cuda.get_current_stream().synchronize() # This line is here so the `__trap()` calls on the kernel aren't missed. return r if __name__ == '__main__': result = main(); None if result is None else print(result) 00:00:33 v #200 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/ca288d6928a8e761855210f25f97fdc056ee1f21be4a24b26e8533ec368831c8"]}} / result: 00:00:39 v #274 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:33 d #201 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (Some "kernel = r""" """ class static_array(): def __init__(self, length): self.ptr = [] for _ in range(length): self.ptr.append(None) def __getitem__(self, index): assert 0 <= index < len(self.ptr), "The get index needs to be in range." return self.ptr[index] def __setitem__(self, index, value): assert 0 <= index < len(self.ptr), "The set index needs to be in range." self.ptr[index] = value class static_array_list(static_array): def __init__(self, length): super().__init__(length) self.length = 0 def __getitem__(self, index): assert 0 <= index < self.length, "The get index needs to be in range." return self.ptr[index] def __setitem__(self, index, value): assert 0 <= index < self.length, "The set index needs to be in range." self.ptr[index] = value def push(self,value): assert (self.length < len(self.ptr)), "The length before pushing has to be less than the maximum length of the array." self.ptr[self.length] = value self.length += 1 def pop(self): assert (0 < self.length), "The length before popping has to be greater than 0." self.length -= 1 return self.ptr[self.length] def unsafe_set_length(self,i): assert 0 <= i <= len(self.ptr), "The new length has to be in range." self.length = i class dynamic_array(static_array): pass class dynamic_array_list(static_array_list): def length_(self): return self.length import cupy as cp import numpy as np from dataclasses import dataclass from typing import NamedTuple, Union, Callable, Tuple i8 = int; i16 = int; i32 = int; i64 = int; u8 = int; u16 = int; u32 = int; u64 = int; f32 = float; f64 = float; char = str; string = str cuda = False def main_body(): return 0.3325000000000001 def main(): r = main_body() if cuda: cp.cuda.get_current_stream().synchronize() # This line is here so the `__trap()` calls on the kernel aren't missed. return r if __name__ == '__main__': result = main(); None if result is None else print(result) ", [])
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.01 (fun x => x ** 2) 0 1
"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
Some "0.33332500000000004\n",
[]
)
)
// |> _assertEqual None
// |> fun x -> printfn $"{x.ToDisplayString ()}"
00:00:39 v #275 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:36 d #55 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:39 v #276 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #56 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:37 v #57 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:37 v #58 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:39 v #277 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #278 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #279 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #280 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #281 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #282 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #283 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #284 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #285 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #286 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #287 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #288 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #289 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #290 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #291 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #292 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #293 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #294 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #295 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #296 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #297 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #298 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #299 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #59 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:39 v #300 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #301 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #302 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:39 v #303 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:34 v #202 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:34 v #203 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:37 v #60 > Server bound to: http://localhost:13805 00:00:34 d #204 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:34 d #205 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:34 d #206 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:34 v #207 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"\ninl init_series start end inc =\n inl total : f64 = conv ((end - start)...et/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi"}} / result: 00:00:34 v #208 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi"}} / result: 00:00:35 d #209 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:35 d #210 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:35 d #211 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:35 d #212 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:36 d #213 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:36 d #214 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:36 d #215 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:36 d #216 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:37 d #217 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:37 d #218 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:37 d #219 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 0.33332500000000004 00:00:37 d #220 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 0.33332500000000004 00:00:37 v #221 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2acc44d97e6b50ce3caf39a0b93135633484d22c3ef6e7797ce64875a41451f4"]}} / result: 00:00:42 v #304 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 d #222 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (Some "0.33332500000000004 ", [])
In [ ]:
//// test
"""inl rec main () = main"""
|> fun code -> Spi (code, None)
|> buildCode Fsharp [||] false 10000 None
|> Async.runWithTimeout 10000
|> Option.map (fun (_, (_, outputContent), errors) -> outputContent, errors |> List.map fst)
|> _assertEqual (
Some (
None,
[
"main.spi:
Recursive metavariables are not allowed. A metavar cannot be unified with a type that has itself.
Got: 'a
Expected: () -> 'a"
]
)
)
// |> _assertEqual None
// |> fun x -> printfn $"{x.ToDisplayString ()}"
00:00:42 v #305 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:40 d #61 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:42 v #306 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:40 v #62 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:40 v #63 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:42 v #307 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:40 v #64 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:42 v #308 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #309 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #310 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #311 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #312 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #313 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #314 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #315 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #316 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #317 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #318 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #319 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #320 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #321 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #322 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #323 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #324 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #325 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #326 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #327 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #328 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #329 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:40 v #65 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:43 v #330 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #331 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #332 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:37 v #223 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:37 v #224 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:40 v #66 > Server bound to: http://localhost:13805 00:00:38 d #225 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:38 d #226 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:38 d #227 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:38 v #228 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl rec main () = main","uri":"file:///home/runner/work/polyglot/polyglot/ta...et/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi"}} / result: 00:00:38 v #229 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi"}} / result: 00:00:38 d #230 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:38 d #231 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:39 d #232 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:39 d #233 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:39 d #234 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:39 d #235 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:40 d #236 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: / outputContent: 00:00:40 d #237 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / typeErrorCount: 0 / retry: 0 / outputContent: 00:00:40 d #238 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 0 / error: Some((File main has a type error somewhere in its path., FatalError "File main has a type error somewhere in its path.")) / outputContent: 00:00:40 d #239 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / typeErrorCount: 1 / retry: 0 / outputContent: 00:00:40 d #240 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / outputContentResult: / typeErrorCount: 1 / retry: 0 / error: Some((main.spi: Recursive metavariables are not allowed. A metavar cannot be unified with a type that has itself. Got: 'a Expected: () -> 'a, TypeErrors { errors = [(({ character = 18 line = 0 }, { character = 22 line = 0 }), "Recursive metavariables are not allowed. A metavar cannot be unified with a type that has itself. Got: 'a Expected: () -> 'a")] uri = "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi" })) / outputContent: 00:00:40 d #241 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [ [ "main.spi: Recursive metavariables are not allowed. A metavar cannot be unified with a type that has itself. Got: 'a Expected: () -> 'a", { "TypeErrors": { "errors": [ [ [ { "character": 18, "line": 0 }, { "character": 22, "line": 0 } ], "Recursive metavariables are not allowed. A metavar cannot be unified with a type that has itself. Got: 'a Expected: () -> 'a" ] ], "uri": "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi" } } ] ] / typeErrorCount: 1 / retry: 0 / outputContent: 00:00:45 v #333 networking.test_port_open / { port = 13806; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:40 d #242 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / typeErrorCount: 0 / retry: 1 / outputContent: 00:00:40 d #243 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 1 / error: / outputContent: 00:00:40 d #244 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / typeErrorCount: 0 / retry: 1 / outputContent: 00:00:40 v #245 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl rec main () = main","uri":"file:///home/runner/work/polyglot/polyglot/ta...et/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi"}} / result: 00:00:40 v #246 Supervisor.sendJson / port: 13805 / json: {"BuildFile":{"backend":"Fsharp","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi"}} / result: 00:00:40 d #247 Supervisor.buildFile / AsyncSeq.scan / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [] / outputContentResult: / typeErrorCount: 0 / retry: 1 / error: Some((main.spi: Recursive metavariables are not allowed. A metavar cannot be unified with a type that has itself. Got: 'a Expected: () -> 'a, TypeErrors { errors = [(({ character = 18 line = 0 }, { character = 22 line = 0 }), "Recursive metavariables are not allowed. A metavar cannot be unified with a type that has itself. Got: 'a Expected: () -> 'a")] uri = "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi" })) / outputContent: 00:00:40 d #248 Supervisor.buildFile / takeWhileInclusive / path: /home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi / errors: [ [ "main.spi: Recursive metavariables are not allowed. A metavar cannot be unified with a type that has itself. Got: 'a Expected: () -> 'a", { "TypeErrors": { "errors": [ [ [ { "character": 18, "line": 0 }, { "character": 22, "line": 0 } ], "Recursive metavariables are not allowed. A metavar cannot be unified with a type that has itself. Got: 'a Expected: () -> 'a" ] ], "uri": "file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7/main.spi" } } ] ] / typeErrorCount: 0 / retry: 1 / outputContent: 00:00:40 v #249 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/883e0123fe6304a9501da46e85facc39c4ac4e3dbb77895f8ccd4581901ee2b7"]}} / result: 00:00:40 d #250 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite 00:00:45 v #334 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:40 d #251 FileSystem.watchWithFilter / Disposing watch stream / filter: FileName, LastWrite Some (None, ["main.spi: Recursive metavariables are not allowed. A metavar cannot be unified with a type that has itself. Got: 'a Expected: () -> 'a"])
getFileTokenRange¶
In [ ]:
let getFileTokenRange port cancellationToken path = async {
let fullPath = path |> System.IO.Path.GetFullPath
let! code = fullPath |> SpiralFileSystem.read_all_text_async
let lines = code |> SpiralSm.split "\n"
let struct (token, disposable) = SpiralThreading.new_disposable_token cancellationToken
use _ = disposable
let port = port |> Option.defaultWith getCompilerPort
let! serverPort, _errors, ct, disposable = awaitCompiler port (Some token)
use _ = disposable
let fullPathUri = fullPath |> SpiralFileSystem.normalize_path |> SpiralFileSystem.new_file_uri
let fileOpenObj = {| FileOpen = {| uri = fullPathUri; spiText = code |} |}
let! _fileOpenResult = fileOpenObj |> sendObj serverPort
// do! Async.Sleep 60
let fileTokenRangeObj =
{|
FileTokenRange =
{|
uri = fullPathUri
range =
[|
{|
line = 0
character = 0
|}
{|
line = lines.Length - 1
character = lines.[lines.Length - 1].Length
|}
|]
|}
|}
let! fileTokenRangeResult =
fileTokenRangeObj
|> sendObj serverPort
|> Async.withCancellationToken ct
let fileDir = fullPath |> System.IO.Path.GetDirectoryName
if fileDir |> SpiralSm.starts_with (workspaceRoot </> "target") then
let fileDirUri = fileDir |> SpiralFileSystem.normalize_path |> SpiralFileSystem.new_file_uri
let fileDeleteObj = {| FileDelete = {| uris = [| fileDirUri |] |} |}
let! _fileDeleteResult = fileDeleteObj |> sendObj serverPort
()
return fileTokenRangeResult |> Option.map FSharp.Json.Json.deserialize<int array>
}
getCodeTokenRange¶
In [ ]:
let getCodeTokenRange cancellationToken code = async {
let! mainPath, _ =
persistCode {| input = Spi (code, None); backend = None; packages = [||] |}
let codeDir = mainPath |> System.IO.Path.GetDirectoryName
let tokensPath = codeDir </> "tokens.json"
let! tokens = async {
if tokensPath |> System.IO.File.Exists |> not
then return None
else
let! text = tokensPath |> SpiralFileSystem.read_all_text_async
return
if text.Length > 2
then text |> FSharp.Json.Json.deserialize<int array> |> Some
else None
}
match tokens with
| Some tokens ->
return tokens |> Some
| None -> return! mainPath |> getFileTokenRange None cancellationToken
}
In [ ]:
//// test
"""inl main () = ()"""
|> getCodeTokenRange None
|> Async.runWithTimeout 10000
|> Option.flatten
|> _assertEqual (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 |])
00:00:45 v #335 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 d #67 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:45 v #336 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #68 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:43 v #69 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:43 v #70 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:45 v #337 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #338 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #339 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #340 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #341 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #342 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #343 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #344 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #345 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #346 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #347 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #348 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #349 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #350 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #351 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #352 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #353 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #354 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #355 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #356 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:46 v #357 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:46 v #358 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:46 v #359 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #71 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:46 v #360 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:46 v #361 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:46 v #362 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:40 v #252 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:40 v #253 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:43 v #72 > Server bound to: http://localhost:13805 00:00:40 v #254 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = ()","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e/main.spi"}} / result: 00:00:41 v #255 Supervisor.sendJson / port: 13805 / json: {"FileTokenRange":{"range":[{"character":0,"line":0},{"character":16,"line":0}],"uri":"file:///home/...et/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e/main.spi"}} / result: 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 ]) 00:00:41 v #256 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e"]}} / result: 00:00:46 v #363 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 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|]
In [ ]:
//// test
"""inl main () = 1i32"""
|> getCodeTokenRange None
|> Async.runWithTimeout 10000
|> Option.flatten
|> _assertEqual (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 |])
00:00:46 v #364 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:44 d #73 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:47 v #365 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:44 v #74 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:44 v #75 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:47 v #366 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:44 v #76 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:47 v #367 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #368 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #369 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #370 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #371 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #372 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #373 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #374 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #375 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #376 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #377 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #378 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #379 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #380 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #381 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #382 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #383 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #384 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #385 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #386 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #387 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #388 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #389 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:45 v #77 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:47 v #390 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #391 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:47 v #392 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:42 v #257 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:42 v #258 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:45 v #78 > Server bound to: http://localhost:13805 00:00:42 v #259 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = 1i32","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/5370829508ddefc7386d6b4d280722b47d97cb925585525bee733a187ff8f18b/main.spi"}} / result: 00:00:43 v #260 Supervisor.sendJson / port: 13805 / json: {"FileTokenRange":{"range":[{"character":0,"line":0},{"character":18,"line":0}],"uri":"file:///home/...et/spiral_Eval/packages/5370829508ddefc7386d6b4d280722b47d97cb925585525bee733a187ff8f18b/main.spi"}} / result: 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 ]) 00:00:43 v #261 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/5370829508ddefc7386d6b4d280722b47d97cb925585525bee733a187ff8f18b"]}} / result: 00:00:48 v #393 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 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|]
getFileHoverAt¶
In [ ]:
let getFileHoverAt
port
cancellationToken
path
(position : {| line: int; character: int |})
= async {
let fullPath = path |> System.IO.Path.GetFullPath
let! code = fullPath |> SpiralFileSystem.read_all_text_async
let lines = code |> SpiralSm.split "\n"
let struct (token, disposable) = SpiralThreading.new_disposable_token cancellationToken
use _ = disposable
let port = port |> Option.defaultWith getCompilerPort
let! serverPort, _errors, ct, disposable = awaitCompiler port (Some token)
use _ = disposable
let fullPathUri = fullPath |> SpiralFileSystem.normalize_path |> SpiralFileSystem.new_file_uri
let fileOpenObj = {| FileOpen = {| uri = fullPathUri; spiText = code |} |}
let! _fileOpenResult = fileOpenObj |> sendObj serverPort
// do! Async.Sleep 60
let hoverAtObj =
{|
HoverAt =
{|
uri = fullPathUri
pos = position
|}
|}
let! hoverAtResult =
hoverAtObj
|> sendObj serverPort
|> Async.withCancellationToken ct
let fileDir = fullPath |> System.IO.Path.GetDirectoryName
if fileDir |> SpiralSm.starts_with (workspaceRoot </> "target") then
let fileDirUri = fileDir |> SpiralFileSystem.normalize_path |> SpiralFileSystem.new_file_uri
let fileDeleteObj = {| FileDelete = {| uris = [| fileDirUri |] |} |}
let! _fileDeleteResult = fileDeleteObj |> sendObj serverPort
()
return hoverAtResult
}
getCodeHoverAt¶
In [ ]:
let getCodeHoverAt cancellationToken code position = async {
let! mainPath, _ =
persistCode {| input = Spi (code, None); backend = None; packages = [||] |}
let codeDir = mainPath |> System.IO.Path.GetDirectoryName
let filePath = codeDir </> "hover.json"
let! output = async {
if filePath |> System.IO.File.Exists |> not
then return None
else
let! text = filePath |> SpiralFileSystem.read_all_text_async
return
if text.Length > 2
then text |> Some
else None
}
match output with
| Some output ->
return output |> Some
| None -> return! getFileHoverAt None cancellationToken mainPath position
}
In [ ]:
//// test
getCodeHoverAt None """inl main () = ()""" {| line = 0; character = 4 |}
|> Async.runWithTimeout 10000
|> Option.flatten
|> _assertEqual (Some "() -> ()")
00:00:48 v #394 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:46 d #79 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:48 v #395 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #396 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:46 v #80 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:46 v #81 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:46 v #82 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:48 v #397 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #398 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #399 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #400 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #401 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #402 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #403 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #404 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #405 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #406 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #407 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #408 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #409 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #410 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #411 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #412 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #413 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #414 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #415 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #416 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #417 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #418 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:46 v #83 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:48 v #419 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #420 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 v #421 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:43 v #262 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:43 v #263 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:46 v #84 > Server bound to: http://localhost:13805 00:00:43 v #264 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = ()","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e/main.spi"}} / result: 00:00:45 v #265 Supervisor.sendJson / port: 13805 / json: {"HoverAt":{"pos":{"character":4,"line":0},"uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e/main.spi"}} / result: Some(() -> ()) 00:00:45 v #266 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e"]}} / result: 00:00:51 v #422 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } Some "() -> ()"
In [ ]:
//// test
getCodeHoverAt None """inl main () = ()""" {| line = 0; character = 0 |}
|> Async.runWithTimeout 10000
|> Option.flatten
|> _assertEqual (Some null)
00:00:51 v #423 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:48 d #85 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:51 v #424 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:49 v #86 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:49 v #87 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:49 v #88 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:51 v #425 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #426 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #427 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #428 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #429 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #430 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #431 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #432 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #433 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #434 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #435 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #436 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #437 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #438 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #439 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #440 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #441 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #442 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #443 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #444 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #445 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #446 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #447 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:49 v #89 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:51 v #448 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #449 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #450 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 v #451 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:46 v #267 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:46 v #268 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:49 v #90 > Server bound to: http://localhost:13805 00:00:46 v #269 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = ()","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e/main.spi"}} / result: 00:00:48 v #270 Supervisor.sendJson / port: 13805 / json: {"HoverAt":{"pos":{"character":0,"line":0},"uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e/main.spi"}} / result: 00:00:48 v #271 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/20e725d46cfdc99c0f307f1933a76ec7da4570c1b757721164d86f19feaf821e"]}} / result: 00:00:54 v #452 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } Some null
In [ ]:
//// test
getCodeHoverAt None """inl rec main () = main""" {| line = 0; character = 8 |}
|> Async.runWithTimeout 10000
|> Option.flatten
|> _assertEqual (Some "forall 'a. () -> 'a")
00:00:54 v #453 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:51 d #91 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:54 v #454 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #455 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:52 v #92 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:52 v #93 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:52 v #94 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:54 v #456 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #457 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #458 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #459 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #460 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #461 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #462 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #463 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #464 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #465 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #466 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #467 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #468 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #469 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #470 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #471 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #472 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #473 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #474 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #475 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #476 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #477 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:52 v #95 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:54 v #478 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #479 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 v #480 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:49 v #272 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:49 v #273 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:52 v #96 > Server bound to: http://localhost:13805 00:00:49 v #274 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl rec main () = main","uri":"file:///home/runner/work/polyglot/polyglot/ta...et/spiral_Eval/packages/7fa7f94d5cb478aa7827ac687ed3514a89f2a8e22fc895db0f8b03cacf92c7e2/main.spi"}} / result: 00:00:51 v #275 Supervisor.sendJson / port: 13805 / json: {"HoverAt":{"pos":{"character":8,"line":0},"uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/7fa7f94d5cb478aa7827ac687ed3514a89f2a8e22fc895db0f8b03cacf92c7e2/main.spi"}} / result: Some(forall 'a. () -> 'a) 00:00:51 v #276 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/7fa7f94d5cb478aa7827ac687ed3514a89f2a8e22fc895db0f8b03cacf92c7e2"]}} / result: 00:00:57 v #481 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } Some "forall 'a. () -> 'a"
In [ ]:
//// test
getCodeHoverAt None """inl main () = 1""" {| line = 0; character = 4 |}
|> Async.runWithTimeout 10000
|> Option.flatten
|> _assertEqual (Some "forall 'a {number}. () -> 'a")
00:00:57 v #482 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:54 d #97 runtime.execute_with_options_async / { file_name = dotnet; arguments = US5_0 ""/home/runner/work/polyglot/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"; options = { command = dotnet "/home/runner/work/polyglot/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; cancellation_token = Some System.Threading.CancellationToken; environment_variables = [||]; on_line = Some <fun:compiler@22-4>; stdin = None; trace = true; working_directory = Some "/home/runner/work/polyglot/polyglot" } } 00:00:57 v #483 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #484 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:55 v #98 > 00:00:00 d #1 pwd: /home/runner/work/polyglot/polyglot 00:00:55 v #99 > 00:00:00 d #2 dllPath: /home/runner/work/polyglot/polyglot/deps/The-Spiral-Language/The Spiral Language 2/artifacts/bin/The Spiral Language 2/release 00:00:55 v #100 > 00:00:00 d #3 targetDir: /home/runner/work/polyglot/polyglot/target/spiral_Eval 00:00:57 v #485 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #486 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #487 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #488 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #489 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #490 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #491 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #492 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #493 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #494 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #495 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #496 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #497 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #498 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #499 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #500 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #501 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #502 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #503 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #504 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #505 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #506 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:55 v #101 > Starting the Spiral Server. It is bound to: http://localhost:13805 00:00:57 v #507 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #508 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:57 v #509 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } 00:00:52 v #277 Supervisor.sendJson / port: 13805 / json: {"Ping":true} / result: 00:00:52 v #278 Supervisor.awaitCompiler / Ping / result: 'Some null' / port: 13805 / retry: 1 00:00:55 v #102 > Server bound to: http://localhost:13805 00:00:52 v #279 Supervisor.sendJson / port: 13805 / json: {"FileOpen":{"spiText":"inl main () = 1","uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2f51fd7aa58d1ea373b484460dba65cec845b6dddbc1fc6de2eea30335846eee/main.spi"}} / result: 00:00:54 v #280 Supervisor.sendJson / port: 13805 / json: {"HoverAt":{"pos":{"character":4,"line":0},"uri":"file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2f51fd7aa58d1ea373b484460dba65cec845b6dddbc1fc6de2eea30335846eee/main.spi"}} / result: Some(forall 'a {number}. () -> 'a) 00:00:54 v #281 Supervisor.sendJson / port: 13805 / json: {"FileDelete":{"uris":["file:///home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/2f51fd7aa58d1ea373b484460dba65cec845b6dddbc1fc6de2eea30335846eee"]}} / result: 00:01:00 v #510 networking.test_port_open / { port = 13805; ex = System.AggregateException: One or more errors occurred. (Connection refused) } Some "forall 'a {number}. () -> 'a"
Arguments¶
In [ ]:
[<RequireQualifiedAccess>]
type Arguments =
| Build_File of string * string
| File_Token_Range of string * string
| File_Hover_At of string * string * int * int
| Execute_Command of string
| [<Argu.ArguAttributes.Unique>] Timeout of int
| [<Argu.ArguAttributes.Unique>] Port of int
| [<Argu.ArguAttributes.Unique>] Parallel
| [<Argu.ArguAttributes.Unique>] Exit_On_Error
interface Argu.IArgParserTemplate with
member s.Usage =
match s with
| Build_File _ -> nameof Build_File
| File_Token_Range _ -> nameof File_Token_Range
| File_Hover_At _ -> nameof File_Hover_At
| Execute_Command _ -> nameof Execute_Command
| Timeout _ -> nameof Timeout
| Port _ -> nameof Port
| Parallel -> nameof Parallel
| Exit_On_Error-> nameof Exit_On_Error
In [ ]:
//// test
Argu.ArgumentParser.Create<Arguments>().PrintUsage ()
"USAGE: dotnet-repl [--help] [--build-file <string> <string>] [--file-token-range <string> <string>] [--file-hover-at <string> <string> <int> <int>] [--execute-command <string>] [--timeout <int>] [--port <int>] [--parallel] [--exit-on-error] OPTIONS: --build-file <string> <string> Build_File --file-token-range <string> <string> File_Token_Range --file-hover-at <string> <string> <int> <int> File_Hover_At --execute-command <string> Execute_Command --timeout <int> Timeout --port <int> Port --parallel Parallel --exit-on-error Exit_On_Error --help display this list of options. "
main¶
In [ ]:
let main args =
let argsMap = args |> Runtime.parseArgsMap<Arguments>
let buildFileActions =
argsMap
|> Map.tryFind (nameof Arguments.Build_File)
|> Option.defaultValue []
|> List.choose (function
| Arguments.Build_File (inputPath, outputPath) -> Some (inputPath, outputPath)
| _ -> None
)
let fileTokenRangeActions =
argsMap
|> Map.tryFind (nameof Arguments.File_Token_Range)
|> Option.defaultValue []
|> List.choose (function
| Arguments.File_Token_Range (inputPath, outputPath) -> Some (inputPath, outputPath)
| _ -> None
)
let fileHoverAtActions =
argsMap
|> Map.tryFind (nameof Arguments.File_Hover_At)
|> Option.defaultValue []
|> List.choose (function
| Arguments.File_Hover_At (inputPath, outputPath, line, character) ->
Some (inputPath, outputPath, line, character)
| _ -> None
)
let executeCommandActions =
argsMap
|> Map.tryFind (nameof Arguments.Execute_Command)
|> Option.defaultValue []
|> List.choose (function
| Arguments.Execute_Command command -> Some command
| _ -> None
)
let timeout =
match argsMap |> Map.tryFind (nameof Arguments.Timeout) with
| Some [ Arguments.Timeout timeout ] -> timeout
| _ -> 60000 * 60
let port =
match argsMap |> Map.tryFind (nameof Arguments.Port) with
| Some [ Arguments.Port port ] -> Some port
| _ -> None
let isParallel = argsMap |> Map.containsKey (nameof Arguments.Parallel)
let isExitOnError = argsMap |> Map.containsKey (nameof Arguments.Exit_On_Error)
async {
let port =
port
|> Option.defaultWith getCompilerPort
let struct (localToken, disposable) = SpiralThreading.new_disposable_token None
let! serverPort, _errors, compilerToken, disposable = awaitCompiler port (Some localToken)
use _ = disposable
let buildFileAsync =
buildFileActions
|> List.map (fun (inputPath, outputPath) -> async {
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}"
let isReal = inputPath |> SpiralSm.ends_with ".spir"
inputPath |> buildFile backend timeout (Some serverPort) None
errors
|> List.map snd
|> List.iter (fun error ->
trace Critical (fun () -> $"main / error: {error |> serializeObj}") _locals
)
match outputCode with
| Some outputCode ->
do! outputCode |> SpiralFileSystem.write_all_text_exists outputPath
return 0
| None ->
if isExitOnError
then SpiralRuntime.current_process_kill ()
return 1
})
let fileTokenRangeAsync =
fileTokenRangeActions
|> List.map (fun (inputPath, outputPath) -> async {
let! tokenRange = inputPath |> getFileTokenRange (Some serverPort) None
match tokenRange with
| Some tokenRange ->
do! tokenRange |> FSharp.Json.Json.serialize |> SpiralFileSystem.write_all_text_exists outputPath
return 0
| None ->
if isExitOnError
then SpiralRuntime.current_process_kill ()
return 1
})
let fileHoverAtAsync =
fileHoverAtActions
|> List.map (fun (inputPath, outputPath, line, character) -> async {
let! hoverAt =
getFileHoverAt
(Some serverPort)
None
inputPath
{| line = line; character = character |}
match hoverAt with
| Some hoverAt ->
do! hoverAt |> FSharp.Json.Json.serialize |> SpiralFileSystem.write_all_text_exists outputPath
return 0
| None ->
if isExitOnError
then SpiralRuntime.current_process_kill ()
return 1
})
let executeCommandAsync =
executeCommandActions
|> List.map (fun command -> async {
let! exitCode, result =
SpiralRuntime.execution_options (fun x ->
{ x with
l0 = command
l1 = Some compilerToken
}
)
|> SpiralRuntime.execute_with_options_async
trace Debug (fun () -> $"main / executeCommand / exitCode: {exitCode} / command: {command}") _locals
if isExitOnError && exitCode <> 0
then SpiralRuntime.current_process_kill ()
return exitCode
})
return!
[| buildFileAsync; fileTokenRangeAsync; fileHoverAtAsync; executeCommandAsync |]
|> Seq.collect id
|> fun x ->
if isParallel
then Async.Parallel (x, float System.Environment.ProcessorCount * 0.51 |> ceil |> int)
else Async.Sequential x
|> Async.map Array.sum
}
|> Async.runWithTimeout timeout
|> Option.defaultValue 1
In [ ]:
//// test
let args =
System.Environment.GetEnvironmentVariable "ARGS"
|> SpiralRuntime.split_args
|> Result.toArray
|> Array.collect id
match args with
| [||] -> 0
| args -> if main args = 0 then 0 else failwith "main failed"
0