APERTURESyndicate.Synx 3.6.2

dotnet add package APERTURESyndicate.Synx --version 3.6.2
                    
NuGet\Install-Package APERTURESyndicate.Synx -Version 3.6.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="APERTURESyndicate.Synx" Version="3.6.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="APERTURESyndicate.Synx" Version="3.6.2" />
                    
Directory.Packages.props
<PackageReference Include="APERTURESyndicate.Synx" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add APERTURESyndicate.Synx --version 3.6.2
                    
#r "nuget: APERTURESyndicate.Synx, 3.6.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package APERTURESyndicate.Synx@3.6.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=APERTURESyndicate.Synx&version=3.6.2
                    
Install as a Cake Addin
#tool nuget:?package=APERTURESyndicate.Synx&version=3.6.2
                    
Install as a Cake Tool

Main SYNX site: https://synx.aperturesyndicate.com/

SYNX for .NET

C# parser and JSON emitter aligned with synx-core: same tree rules as parser::parse, deterministic JSON as to_json (sorted object keys, matching escapes and float formatting via Utf8JsonWriter).

Quick start (new project)

  1. Install .NET 8 SDK.
  2. Create a console app and add the package:
dotnet new console -n MySynxApp -f net8.0
cd MySynxApp
dotnet add package APERTURESyndicate.Synx
  1. Replace Program.cs:
using Synx;

var text = """
    server
      host 127.0.0.1
      port 8080
    """;

// Static parse only (no !active — :env / :calc are NOT executed)
var data = SynxFormat.Parse(text);
Console.WriteLine(SynxFormat.ToJson(data));

// With !active — markers resolve (:env, :calc, includes, etc.)
var activeText = """
    !active
    port:env:default:7777 PORT
    """;

var env = new Dictionary<string, string>(StringComparer.Ordinal) { ["PORT"] = "3000" };
var resolved = SynxFormat.ParseActive(activeText, new SynxOptions { Env = env });
Console.WriteLine(SynxFormat.ToJson(resolved));
  1. Run: dotnet run

Package name: APERTURESyndicate.Synx (not Synx.Core — that ID is taken on nuget.org). Namespace: Synx. Types: SynxFormat (entry points), SynxValue (tree: SynxValue.Obj, .Str, .Int, …).

If the package is not on nuget.org yet: clone this repo, then either:

dotnet add reference /absolute/path/to/synx-format/parsers/dotnet/src/Synx.Core/Synx.Core.csproj

or build a local package from repo root: .\publish-csharp.bat (without NUGET_API_KEY it only packs), then:

dotnet add package APERTURESyndicate.Synx --source /absolute/path/to/synx-format/artifacts/nuget

Requirements

  • .NET SDK 8.0 or later (for local development you can bump <TargetFramework> in the .csproj files if you only have a newer runtime).

Layout

Path Purpose
Synx.sln Solution
src/Synx.Core/ Library: SynxFormat.Parse, SynxFormat.ParseTool, SynxFormat.ToJson, SynxValue
tests/Synx.Core.Tests/ xUnit — runs repo root tests/conformance/cases/*.synx + .expected.json (same as Rust synx-core conformance test)
tools/Synx.FuzzReplay/ Console tool: replay arbitrary files through Parse + ToJson (strict UTF-8 only — matches Rust fuzz_parse filter). Use alongside crates/synx-core/fuzz/ artifacts.

Commands

cd parsers/dotnet
dotnet test
dotnet build -c Release

# Replay fuzz corpora / minimized inputs on the C# parser (must be valid UTF-8)
dotnet run -c Release --project tools/Synx.FuzzReplay -- path/to/fuzz/artifacts/fuzz_parse/minimized-from-*
# Optional timing (parse + ToJson per file)
dotnet run -c Release --project tools/Synx.FuzzReplay -- --bench tests/conformance/cases/*.synx

API (preview)

  • SynxFormat.Parse(string) — static parse → Dictionary<string, SynxValue> (no !active engine: markers are not resolved).
  • SynxFormat.ParseActive(string, SynxOptions?) — parse + resolve (:calc, :env, :ref, :alias, constraints, includes, interpolation, …) — targets parity with synx-core::engine::resolve.
  • SynxFormat.ParseFull / ParseFullActive — full SynxParseResult including Metadata and Includes.
  • SynxFormat.ParseTool(string) — parse + reshape_tool_output (matches Rust when the file is not !active).
  • SynxFormat.ToJson — canonical JSON string for a value or root map.
  • SynxFormat.Deserialize<T>(string, JsonSerializerOptions?) — parse then deserialize directly into T via System.Text.Json. Replaces JsonSerializer.Deserialize<T>(SynxFormat.ToJson(SynxFormat.Parse(text))).
  • SynxFormat.DeserializeActive<T>(string, SynxOptions?, JsonSerializerOptions?) — parse + engine resolve then deserialize into T.

SynxValue helpers

SynxValue provides accessor methods mirroring Rust's Value::as_*():

var data = SynxFormat.Parse("name Alice\nage 30\nactive true");

// Indexer access (returns SynxValue.Null if missing)
SynxValue name = data["name"];

// Type-safe unwrapping (returns null if wrong type)
string? s  = data["name"].AsString();   // "Alice"
long?   n  = data["age"].AsInt();       // 30
double? f  = data["age"].AsFloat();     // 30.0
bool?   b  = data["active"].AsBool();   // true
bool isNul = data["missing"].IsNull();  // true

// Nested access via indexers
var port = data["server"]["port"].AsInt();

// ToString() for display
Console.WriteLine(data["name"]); // Alice
Console.WriteLine(data["age"]);  // 30

Consume from NuGet (after publish)

Package ID: APERTURESyndicate.Synx (the ID Synx.Core is already used by another package on nuget.org). Project folder in this repo remains Synx.Core; namespaces are Synx.

dotnet add package APERTURESyndicate.Synx

Prerelease / local build: add a project reference into your solution, or pack a feed:

# from repo root — produces artifacts/nuget/APERTURESyndicate.Synx.*.nupkg (push optional)
.\publish-csharp.bat

dotnet add package APERTURESyndicate.Synx --source /absolute/path/to/synx-format/artifacts/nuget

Publish to nuget.org (maintainers)

  1. Bump Version in src/Synx.Core/Synx.Core.csproj.
  2. Create an API key whose glob includes APERTURESyndicate.Synx or *.
  3. PowerShell: $env:NUGET_API_KEY = '…token only…'do not wrap the key in < >.
  4. Repo root: .\publish-csharp.bat (clears old *.nupkg in artifacts/nuget, pushes only APERTURESyndicate.Synx.*.nupkg).

Next: .synxb, diff in C#; broaden engine parity tests beyond smoke cases.

Tests: library targets .NET 8; test project and Synx.FuzzReplay may target .NET 10 on machines where only a newer runtime is installed — adjust <TargetFramework> in the respective .csproj files if dotnet run fails with a framework error.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.6.2 89 5/7/2026
3.6.1 101 4/9/2026
3.6.0.1 112 4/5/2026
3.6.0 116 4/1/2026