✓
Passing This code compiles and runs correctly.
Code
// Test: an abstract tor implemented by one proc per HOST — the portability
// seam. The same port (`greet`) carries a |zig body in this file and a |js
// body in the sibling input.kjs facet. Compiling to each target selects the
// host's implementation; the caller (below) is target-independent.
//
// This is the seam argument end-to-end: a contract the compiler sees, with
// per-host implementations chosen by target, zero runtime indirection.
//
// Zig lane: prints "Hello, Alice" via the |zig proc.
// JS lane: prints "Hello, Alice" via the |js proc (from input.kjs).
// Both must match expected.txt — same contract, same observable behavior on
// both hosts.
const std = @import("std");
// The PORT — an abstract seam. One contract, one caller.
~[abstract] tor greet { name: string } -> string
// The HOST pattern: the same port implemented for each target.
~proc greet|zig {
std.debug.print("Hello, {s}\n", .{name});
return name;
}
// THE CALLER — addresses only the port. Target-independent.
~greet(name: "Alice")Supporting Files
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"a_cs_equiv/1.0.0": {
"runtime": {
"a_cs_equiv.dll": {}
}
}
}
},
"libraries": {
"a_cs_equiv/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}Hello, Alice
// C# implementation facet: this port's C# host implementation. Merged at
// compile (sibling to input.kz); selected when the target is --lang=cs.
~proc greet|cs {
__koru_stdout_write("Hello, " + name + "\n");
return name;
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<AssemblyName>a_cs_equiv</AssemblyName>
<WarningLevel>0</WarningLevel>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>
<ItemGroup>
<Compile Include="output_emitted.cs" />
</ItemGroup>
</Project>
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("a_cs_equiv")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+197e0b18a766b096f513320d594015583fe640fe")]
[assembly: System.Reflection.AssemblyProductAttribute("a_cs_equiv")]
[assembly: System.Reflection.AssemblyTitleAttribute("a_cs_equiv")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
7b5383f00ed4f88fb2f6f14b1ee58accde00ed2c163321d64d43284b83126b6e
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = koru
build_property.ProjectDir = /Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 8.0
build_property.EnableCodeStyleSeverity =
5be0995b741828a5c320155d1f80abdffa79d05541ea191d12e3a61e37fca459
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/Debug/net8.0/koru.GeneratedMSBuildEditorConfig.editorconfig
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/Debug/net8.0/koru.AssemblyInfoInputs.cache
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/Debug/net8.0/koru.AssemblyInfo.cs
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/Debug/net8.0/koru.csproj.CoreCompileInputs.cache
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/Debug/net8.0/koru.sourcelink.json
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/a_cs_equiv
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/Debug/net8.0/a_cs_equiv.dll
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/Debug/net8.0/refint/a_cs_equiv.dll
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/Debug/net8.0/a_cs_equiv.pdb
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/a_cs_equiv.deps.json
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/Debug/net8.0/koru.genruntimeconfig.cache
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/a_cs_equiv.runtimeconfig.json
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/a_cs_equiv.dll
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/Debug/net8.0/ref/a_cs_equiv.dll
/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/a_cs_equiv.pdb
5af015271ff2cd3fec3c08c93bf9a0d483afbbb49a158b1017ae59e88423f711
{"documents":{"/Users/larsde/src/koru/*":"https://raw.githubusercontent.com/korulang/koru/197e0b18a766b096f513320d594015583fe640fe/*"}}{
"format": 1,
"restore": {
"/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/koru.csproj": {}
},
"projects": {
"/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/koru.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/koru.csproj",
"projectName": "a_cs_equiv",
"projectPath": "/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/koru.csproj",
"packagesPath": "/Users/larsde/.nuget/packages/",
"outputPath": "/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/Users/larsde/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"/opt/homebrew/Cellar/dotnet/9.0.0/libexec/library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "all"
},
"SdkAnalysisLevel": "9.0.100"
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[8.0.11, 8.0.11]"
},
{
"name": "Microsoft.NETCore.App.Host.osx-arm64",
"version": "[8.0.11, 8.0.11]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[8.0.11, 8.0.11]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/opt/homebrew/Cellar/dotnet/9.0.0/libexec/sdk/9.0.100/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/larsde/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/larsde/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.12.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="/Users/larsde/.nuget/packages/" />
</ItemGroup>
</Project><?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />{
"version": 3,
"targets": {
"net8.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net8.0": []
},
"packageFolders": {
"/Users/larsde/.nuget/packages/": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/koru.csproj",
"projectName": "a_cs_equiv",
"projectPath": "/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/koru.csproj",
"packagesPath": "/Users/larsde/.nuget/packages/",
"outputPath": "/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/Users/larsde/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"/opt/homebrew/Cellar/dotnet/9.0.0/libexec/library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "all"
},
"SdkAnalysisLevel": "9.0.100"
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[8.0.11, 8.0.11]"
},
{
"name": "Microsoft.NETCore.App.Host.osx-arm64",
"version": "[8.0.11, 8.0.11]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[8.0.11, 8.0.11]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/opt/homebrew/Cellar/dotnet/9.0.0/libexec/sdk/9.0.100/PortableRuntimeIdentifierGraph.json"
}
}
}
}{
"version": 2,
"dgSpecHash": "tpGLFQRMCME=",
"success": true,
"projectFilePath": "/Users/larsde/src/koru/tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_014_abstract_seam_host_facets/koru.csproj",
"expectedPackageFiles": [
"/Users/larsde/.nuget/packages/microsoft.netcore.app.ref/8.0.11/microsoft.netcore.app.ref.8.0.11.nupkg.sha512",
"/Users/larsde/.nuget/packages/microsoft.aspnetcore.app.ref/8.0.11/microsoft.aspnetcore.app.ref.8.0.11.nupkg.sha512",
"/Users/larsde/.nuget/packages/microsoft.netcore.app.host.osx-arm64/8.0.11/microsoft.netcore.app.host.osx-arm64.8.0.11.nupkg.sha512"
],
"logs": []
}static class main_module {
public static void __koru_stdout_write(dynamic s) => global::System.Console.Out.Write(s);
public static void __koru_stderr_write(dynamic s) => global::System.Console.Error.Write(s);
public static class greet_event {
public struct Input {
public string name;
}
public static string handler(Input __koru_input) {
var name = __koru_input.name;
__koru_stdout_write("Hello, " + name + "\n");
return name;
}
}
public static void flow0() {
main_module.greet_event.handler(new greet_event.Input { name = "Alice"});
}
}
static class Program {
static void Main() {
main_module.flow0();
}
}
Actual
Hello, Alice
Expected output
✓ Zig✓ JavaScript✓ C#Hello, AliceFlows
flow ~greet click a branch to expand · @labels scroll to their anchor
greet (name: "Alice")
Test Configuration
MUST_RUN LANGUAGES: zig js cs