Skip to content

SupportedFeatures

Edgar Mesquita edited this page Feb 3, 2026 · 36 revisions

Supported C# Features Matrix

This document provides a comprehensive list of C# features, .NET APIs, and patterns supported by the eQuantic.UI compiler.

Legend

Full Support: Transpiles to equivalent JavaScript behavior.

⚠️ Partial Support: Works with caveats or minor differences.

🚧 Planned: On the roadmap.

Not Supported: fundamentally incompatible logic (e.g., blocking I/O, unsafe pointers).


🏗️ Core Language Features

Feature Status Notes
Classes & Structs Transpiled to ES6 Classes.
Interfaces Used for TypeScript type checking (erased at runtime).
Enums Transpiled to JS Objects (bidirectional mapping).
Generics Fully supported (erased at runtime).
Extension Methods Resolved via Semantic Model and transpiled to direct calls.
Async / Await Maps to async / await and Promise.
Lambda Expressions Maps to Arrow Functions () => {}.
Pattern Matching is patterns, Property Patterns, Recursive Patterns.
String Interpolation Maps to Template Literals `${var}`.
Null-Coalescing ?? and ??= mapped to JS equivalents.
Object Initializers new Obj { Prop = 1 }.
Collection Initializers new List<int> { 1, 2 } maps to [1, 2].
Deconstruction var (a, b) = tuple maps to [a, b] = tuple.
Local Functions Transpiled to inner functions.
Records (with) Maps to object spread { ...src, prop: val }.
typeof Maps to type name string literal.
base calls Maps to super keyword.
cast & as Maps to JS passthrough/truncation.
sizeof Maps to C# primitive sizes.
Anonymous Methods delegate(...) { ... } maps to arrow functions.
stackalloc Maps to Typed Arrays (e.g., Int32Array).
yield return Maps to JS Generator Functions (function*).
lock ⚠️ Transpiled to a no-op block (JS is single-threaded).

🔄 LINQ Support

The compiler includes specialized strategies for nearly all LINQ methods.

Logic Methods Status
Filtering Where, OfType
Projection Select, SelectMany, Cast
Partitioning Skip, Take, SkipWhile, TakeWhile
Ordering OrderBy, OrderByDescending, ThenBy, Reverse
Aggregation Count, Sum, Min, Max, Average, Aggregate
Quantifiers Any, All, Contains
Sets Distinct, DistinctBy, Union, Intersect, Except, Concat
Elements First, FirstOrDefault, Single, Last, ElementAt
Utility SequenceEqual, DefaultIfEmpty
Conversion ToList, ToArray, ToDictionary, ToHashSet
Grouping/Join GroupBy, Join, Zip

📦 .NET Types (BCL)

We map common .NET types to their JavaScript equivalents.

Primitives

.NET Type JavaScript Equivalent
string String
int, double, float Number
bool Boolean
object Object
dynamic any

System.String

  • Join, Format
  • IsNullOrEmpty, IsNullOrWhiteSpace
  • Split, Replace, Substring, Trim
  • ToLower, ToUpper, StartsWith, EndsWith

System.DateTime & TimeSpan

  • DateTime.Now, DateTime.UtcNow mapped to new Date().
  • Year, Month, Day, Hour... properties.
  • AddDays, AddHours... methods.
  • ToString() (basic formatting).
  • TimeSpan.FromMilliseconds... mapped to numeric milliseconds.

System.Collections.Generic

  • List<T> → Javascript Array []
  • Dictionary<TKey, TValue> → Javascript Object {} or Map (depending on usage).
  • HashSet<T> → Javascript Set.
  • Queue<T>, Stack<T> → Javascript Array methods (push/shift/pop).

System.Threading.Tasks

  • Task, Task<T>Promise.
  • Task.DelaysetTimeout wrapper.
  • Task.WhenAll, Task.WhenAny.
  • ⚠️ Task.Run executes on the main thread (microtask), NOT a background thread.

Other Utilities

  • Console.WriteLineconsole.log.
  • Math.* (Min, Max, Abs, Round, etc.) → Math.*.
  • Guid (NewGuid, Empty, Parse) → crypto.randomUUID().
  • Regex → JavaScript RegExp.

⚠️ Limitations & Caveats

  1. Blocking Code:

    • .Wait(), .Result on Tasks are NOT supported. You must use await. Blocking the main thread freezes the browser UI.
  2. Reflection:

    • System.Reflection is largely unsupported.
    • typeof(T).Name and nameof(...) are supported constants.
  3. File System:

    • System.IO (File, Directory) is not strictly forbidden but will fail at runtime in the browser.
    • Use Server Actions to handle file operations.
  4. Numbers:

    • ⚠️ JavaScript uses 64-bit floating point for all numbers. long (64-bit int) precision may be lost for values > 2^53.
    • decimal is treated as number (double), so currency precision logic should happen on the Server.
  5. Thread Safety:

    • Since JS is single-threaded, lock statements are compiled away (ignored).
    • Thread.Sleep is not supported (use Task.Delay).

Clone this wiki locally