Skip to main content
Version: Next

Feature matrix

This matrix summarizes feature support in the compiler emit path (gsc) and the interpreter/REPL path. Legend: Supported means implemented on that path; Mostly supported means ordinary cases work with known edge limitations; Partial means syntax or binding exists but execution or emit is incomplete; Not supported means rejected or intentionally absent; N/A means the feature belongs to tooling rather than one execution path.

Lexical and source structure

FeatureEmit (gsc)InterpreterNotes
Lexing, parsing, keywords, tokens, literalsSupportedSupportedShared lexer and parser.
Packages, imports, import aliasesSupportedSupportedEmit supports multi-package assemblies; interpreter binds the same model.
Implicit System importSupportedSupportedEnabled by default; disabled with /noimplicitimports or /no-implicit-imports.
Top-level statements and func MainSupportedSupportedMixing top-level statements and explicit Main is diagnosed by GS0165/GS0166.
CommentsSupportedSupportedLine (//), block (/* … */), and Markdown documentation (///) comments.
String, raw string, and interpolated string literalsSupportedSupportedSigil-free interpolation with $name/${expr,alignment:format}, delimiter-aware multiline holes, and DefaultInterpolatedStringHandler/FormattableString lowering.
Character literalsSupportedSupportedCharacter diagnostics are GS0191 through GS0195.
Documentation commentsSupportedSupported/// Markdown comments round-trip to CLR XML doc; hover renders CLR XML docs for imported APIs. Diagnostics GS0227GS0231.

Types and values

FeatureEmit (gsc)InterpreterNotes
Primitive types and numeric operatorsSupportedMostly supportedEvaluator implements primitive arithmetic; address/deref unary operators are limited.
Width-bearing integer namesSupportedSupportedCanonical names are int32, uint64, and related widths. Friendly aliases are also accepted: int, uint, long, ulong, short, ushort, byte, sbyte, float, and double; they resolve to the canonical TypeSymbol at the binder, so diagnostics, typeof, hover, and IL print the canonical name.
Numeric conversionsSupportedSupportedWidening numeric conversions plus explicit conversions.
object universal upper boundSupportedSupportedBoxing and object equality are implemented.
Nullable T?, nil, !!, ??, ?., ?[i]SupportedSupported!! throws in the evaluator when the value is nil. ?[i] short-circuits indexing to nil when the receiver is nil.
Arrays and slicesSupportedSupportedSlices are backed by arrays; append copies. len / cap / append require import Gsharp.Extensions.Go (GS0317); the .NET-idiomatic alternative is .Length and (for mutable lists) List[T].Add.
MapsSupportedSupportedBacked by Dictionary[K,V]; delete and len are implemented. Both require import Gsharp.Extensions.Go (GS0317); .NET-idiomatic alternatives are .Remove(k) and .Count.
Tuples and multi-returnSupportedSupportedMulti-value return syntax is represented as tuple literals.
Struct literalsSupportedSupportedField initialization and field access are implemented.
Data classes, data structs, with/copySupportedSupporteddata class (reference) and data struct (value) synthesise equality, with-copy, and deconstruction. The record keyword is not supported; migrate to data struct (preserves value semantics) or data class (reference semantics).
Inline structsSupportedSupportedExactly one field; participates in structural equality.
Classes and primary constructorsSupportedPartially supportedEvaluator supports G# classes; CLR base initializer modeling is limited.
Explicit class init constructorsSupportedSupportedG# class constructors are parsed, bound, and evaluated.
InterfacesSupportedSupported for checking/upcastsDefault-interface methods, static-virtual interface members declared inside the interface's shared { … } block, private interface helper methods — instance helpers in the interface body, static helpers as private func inside the interface's shared { … } block — and the explicit-base interface call syntax base[IFoo].M(...) for DIM diamond disambiguation are supported.
PropertiesSupportedSupportedAuto/computed and static/shared forms are represented.
EventsSupportedSupportedG# and CLR event subscription paths exist.
Static/shared membersSupportedSupportedDeclared in a shared { ... } block.
Function types, literals, closuresSupportedSupportedDelegate conversions are strongest on the emit path.
Generics and method inferenceSupportedSupported for binding/evaluationReified CLR generics: user-declared generic types/methods emit GenericParam rows; signatures over T encode Var/MVar; closed CLR generics over an in-scope type parameter (List[T]) emit honest GenericInstantiation blobs; open-bearing delegates (func(T) U) dispatch through FuncN::InvokeMemberRefs on constructedTypeSpec`.
Variance and constraintsSupported semanticallySupported semanticallyDiagnostics include GS0150 through GS0153.
By-ref and pointersPartialLimited/not supported& / * / *T for CLR ref/out/in interop; ref returns auto-dereference in rvalue position. Evaluator rejects generic address/deref execution.
ref/out/in parametersSupportedSupportedDeclaration-site and call-site modifiers; diagnostics GS0235GS0243. Includes out var/let/_ inline declarations.
Ref-aliasing locals (let ref / var ref)SupportedSupportedLocal whose IL slot is T& and aliases another lvalue. Diagnostics GS0256GS0258.
ref-returning functionsSupportedSupportedfunc f(...) ref T { ... } paired with return ref <lvalue>. Diagnostics GS0248GS0255.
scoped parameter modifierSupportedSupportedConstrains a ref struct / managed-pointer parameter from escaping; enforced by GS9004 / GS9006.
Spans and ref struct typesMostly supportedLimitedStack-only consumption of Span[T] / ReadOnlySpan[T] and user ref struct X: element read/write, []T→span conversion, closed generic value-type fields. Escape rules are GS0219; ReadOnlySpan[T] writes are GS0226. Full ref-safe-to-escape analysis is not implemented.

Declarations and members

FeatureEmit (gsc)InterpreterNotes
Top-level functions and variablesSupportedSupportedvar, let, and const are implemented. The legacy := short variable declaration is not supported; the parser hard-rejects it with GS0305.
Visibility modifiersSupportedSupportedpublic, internal, and private; invalid locations report GS0180.
Receiver methods and extension functionsSupportedSupportedG# receiver style and imported CLR extension dispatch. The receiver-clause form is reserved for non-owned receiver types and warns (GS0314) when it targets an owned class or struct; in-body declarations are the canonical form for owned-type methods.
Operator declarationsSupportedSupported where evaluator invokes user/CLR op pathsReceiver operator declarations map to CLR op_* names.
Interface implementationSupportedSupported for checks/upcastsMissing members and sealed-interface violations are diagnosed.
Inheritance and overridesSupportedPartially supportedBase classes must be open; override diagnostics are implemented.
Default parameter values in G# declarationsSupportedSupportedOptional parameters carry compile-time-constant defaults; rule violations report GS0265.
Method overloading (user functions)SupportedSupportedFunctions can carry overload sets differing by parameter types, ref-kinds, or generic-parameter constraints (where T : class / where T : struct); duplicates report GS0264, ambiguous calls report GS0266 or GS0160, no-applicable reports GS0267.
Variadic parameters (name ...T)Supported (all declaration sites)Supported (all declaration sites)Canonical Go-style spelling name ...T; body sees []T; at most one variadic per signature and must be last (GS0145, GS0364). Call site packs N trailing args into a fresh []T; a single trailing []T argument passes through unwrapped (identity preserved). The emitter stamps [System.ParamArrayAttribute] so C# / F# / VB consumers see it as params T[]. The C# params keyword is rejected with GS0363 pointing at the canonical form. Accepted on top-level func, class instance/static methods, interface methods (incl. default-body), constructors, lambdas, and named delegate declarations.
Named delegate typesSupportedSupportedtype X = delegate func(...) declares a real CLR MulticastDelegate-derived type; generic delegates (type X[T any] = delegate func(...)) supported; diagnostic GS0233.

Statements and control flow

FeatureEmit (gsc)InterpreterNotes
ifSupportedSupportedIncludes simple-statement form. The if let name = expr { ... } [else { ... }] binding form strips a nullable layer and narrows name to the underlying type inside the then-branch. if is also available as a value-producing expression — see the If expression row below.
if expressionSupportedSupportedlet x = if cond { a } else { b } and else if chains in value position. Requires a terminal else (GS0276); blocks must end in a value-producing expression (GS0277); branches with no common type report GS0263 (shared with the ternary). Lowers through the same BoundConditionalExpression / BoundBlockExpression nodes the ternary and switch expression use.
guard letSupportedSupportedguard let name = expr else { ... } binds name for the remainder of the enclosing block and requires the else clause to unconditionally exit (GS0297).
for condition, clause, infinite loopsSupportedSupportedCompanion while and do-while forms are supported.
for x in collectionSupportedSupportedCanonical in form. The legacy for x := range collection Go-style spelling is not supported.
Ellipsis loopsSupportedSupportedfor i in start ... end. The legacy for i := start ... end spelling is not supported.
while and do-whileSupportedSupportedwhile cond { ... } (pre-test) and do { ... } while cond (post-test).
break and continue (with optional loop labels)SupportedSupportedInvalid locations are diagnosed. Loop labels (label: for ..., break label, continue label) are supported; diagnostics GS0293GS0295.
Multi-assignment and deconstructionSupportedSupportedTarget/value mismatches are diagnosed.
Null-coalescing compound assignment (??=)SupportedSupporteda ??= b writes b only when a reads as nil; RHS short-circuits otherwise. Receiver and index expressions evaluated exactly once. Works on locals, fields, properties, and indexers. Non-nullable LHS reports GS0298; non-assignable LHS reports GS0299.
switch statementsSupportedSupportedCases do not fall through. Flow analysis narrows the discriminator inside type-pattern arms (case d is T) and lifts a common narrowing into the rest of the enclosing block when the switch is exhaustive and every non-exiting arm contributes the same narrowing.
Switch expressionsSupportedSupportedExhaustiveness and arm type diagnostics implemented.
PatternsSupportedSupportedConstant, relational, type, property, list, and discard patterns are represented.
fallthroughNot supportedNot supportedReserved and diagnosed as GS0168.
try, catch, finally, throwSupportedSupportedCLR exception model.
usingSupportedSupported if lowered/bound disposableResource-scope variable declaration.
deferSupported by binding/lowering intentSupported when lowered before evaluationBinder requires a call expression.
gotoPartialPartialToken and bound label/goto nodes exist; use with caution pending fuller docs.

Expressions

FeatureEmit (gsc)InterpreterNotes
Calls and generic callsSupportedSupportedBracketed type arguments.
Named argumentsSupportedSupportedFoo(timeout: 30, retries: 3) for free functions, user methods/constructors, extension functions, and inherited CLR methods (including delegate Invoke). The legacy Foo(timeout = 30) shape is deprecated and emits GS0315; both spellings still parse for one release. Indirect calls through a function-typed variable and variadic targets are excluded. Diagnostics GS0244GS0247, GS0315.
Conditional (?:) ternary expressionSupportedSupportedcond ? a : b is a normal expression. GS0263 covers the "no common type" failure.
Conditional ref-arguments (ref cond ? a : b)SupportedSupportedBranches must produce same-typed lvalues. Diagnostics GS0260GS0262.
Struct, array, and map literalsSupportedSupportedMap literals bind to Dictionary[K,V] backing.
Indexing and index assignmentSupportedSupportedArrays, slices, maps, and imported CLR indexers.
Null-conditional accessSupportedSupported?. and ?[i] are represented in the bound tree. ?[i] covers arrays, slices, maps, and CLR indexers; non-nullable receiver warns GS0300; ?[i] rejected as assignment LHS (GS0301).
Type operatorsSupportedSupportedtypeof(...) and nameof(...).
default(T) and bare default literalSupportedSupporteddefault(T) for any type expression; bare default valid in target-typed positions (let/var with explicit type, return with known return type, typed call argument, ?: branch typed by sibling). Diagnostic GS0362 when no target type is available.
Smart casts / flow narrowingSupportedSupportedis / !is on a local, parameter, or read-only top-level let narrows the receiver to the tested type. Composes through !, &&, `
Trailing func lambdasSupportedSupportedcall(...) func(...) { ... } form.
Arrow lambda expressions ((x int32) -> body)SupportedSupportedParameter list is always parenthesised; body is a single expression or a brace block whose trailing expression is the value. Captures outer locals. Lambda parameter type inference and (T) -> R function-type syntax are supported separately.

Concurrency, async, and iterators

FeatureEmit (gsc)InterpreterNotes
goSupportedSupported with evaluator scheduling limitsOperand must be a call expression. Per-file import Gsharp.Extensions.Go is required (GS0316).
scope structured concurrencySupportedSupportedChild tasks are joined and failures propagate. Not gated.
Channels, send, receive, closeSupportedSupportedBacked by System.Threading.Channels. Per-file import Gsharp.Extensions.Go is required (GS0316).
selectSupportedSupportedReceive, receive-bind, send, and default cases. Per-file import Gsharp.Extensions.Go is required (GS0316).
async func and awaitSupportedSupported by blockingEmit has state machines; evaluator blocks on awaiters. Not gated.
Async state-machine edge casesPartialN/AUnsupported emit shapes report GS0190.
sequence[T] and yieldSupportedSupportedSync iterator state machines in emit; evaluator collects sequence values.
async sequence[T] and await forSupportedSupported by blockingMaps to IAsyncEnumerable[T].

CLR interop

FeatureEmit (gsc)InterpreterNotes
Imported constructorsSupportedSupported by reflectionIncludes simple-name construction when imported.
Imported instance/static methodsSupportedSupported by reflectionOverload resolution and conversions apply.
Imported fields/properties/indexersSupportedSupported by reflectionReads and writes are represented separately.
Imported eventsSupportedSupported+= and -= bind to event add/remove.
Imported extension methodsSupportedSupportedUses imported [Extension] classes.
Imported optional/default argumentsSupportedSupportedVerified by sample coverage.
Function literal to delegateSupportedPartialSome marshalling scenarios are emit-path only.
Method group to delegateSupportedSupported in covered scenariosIncludes imported CLR method groups.
Imported operator overloads and conversionsSupportedSupported where evaluator invokes pathsBound as CLR operator/conversion calls.
AttributesSupportedSemantically recognizedIncludes @Attribute sugar and @Obsolete; @DllImport opts into P/Invoke; @LibraryImport opts into the source-generator-shaped P/Invoke.
P/Invoke/externSupportedSupported (emit-only)Attribute-driven via @DllImport("lib") on a ;-body func, or via the source-generator-shaped @LibraryImport("lib", StringMarshalling: …), which is AOT-friendly with an explicit IL stub. v1 marshals primitives, string, *T (byref), slices of primitives, and blittable / explicit-layout structs via @StructLayout(LayoutKind.…) + @FieldOffset(N). ref / out / in parameters are supported for blittable pointees (primitives and @StructLayout structs); the runtime marshals the byref slot as T* to the unmanaged callee. Function-pointer marshalling supports both managed delegate callbacks (@UnmanagedFunctionPointer(CallingConvention.Cdecl) on the delegate type) and raw unmanaged[Cdecl] (T) -> R function pointers (encoded as ELEMENT_TYPE_FNPTR in metadata). Per-parameter @MarshalAs(UnmanagedType.…) overrides opt a parameter into a different unmanaged form (LPWStr for Windows …W entry-points, LPUTF8Str for modern C APIs, I4 to widen a bool to a C int flag, LPArray with SizeParamIndex: for sibling-sized buffers, etc.).

Gsharp.Extensions helper namespaces

FeatureEmit (gsc)InterpreterNotes
Gsharp.Extensions.OptionalSupportedSupportedExtension helpers on T? (Map, FlatMap, OrElse, OrCompute, OrThrow, IfPresent, Filter). Value-typed (T : struct) helpers carry a *Value suffix and require import Gsharp.Extensions.Optional.
Gsharp.Extensions.SequencesSupportedSupportedStatic builders (Range, RangeStep, Iterate, Repeat, Of, Empty), transformers (Windowed, Chunked, Indexed, Pairwise, Interleave), safe terminals (FirstOrNil, LastOrNil, SingleOrNil plus *ValueOrNil companions), and G#-shaped collectors (ToSlice, ToMap). Requires import Gsharp.Extensions.Sequences.
Gsharp.Extensions.Go (gate)SupportedSupportedPer-file import Gsharp.Extensions.Go unlocks the Go-flavored concurrency surface and the Go-style built-ins len, cap, append, delete, make.
No auto-import policyN/AN/ANothing under Gsharp.Extensions.* is auto-imported — even when implicit imports are enabled. Each namespace is opt-in per file.

Tooling and build

FeatureEmit (gsc)InterpreterNotes
PE assembly emitSupportedN/ADirect System.Reflection.Metadata emitter.
Portable PDB, Source Link, embedded sources, deterministic IDsSupportedN/AEmit-only debug information.
Reference assembliesSupportedN/ASDK can produce reference assemblies.
SDK .gsproj build/run/packSupportedN/AGsharp.NET.Sdk integrates with MSBuild and dotnet.
REPLN/ASupportedInterpreter executable starts a REPL with no file argument.
Language server and VS Code extensionN/AN/APull-based diagnostics, semantic tokens, hover for CLR XML docs, CodeLens reference counts on members of types/structs/interfaces/enums, signature help, inlay hints, completion, go-to-definition, references, rename, formatting, debug + test integration.
VS Code color themesN/AN/ASix bundled themes (Ember, Magma, Synthwave — Dark + Light each).