You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
0.1.37
Language: C#
New self-contained C# language support (csharp, also accepting cs and c#) able to parse, run and translate, at the same level of compatibility as
Dart and Java: classes, fields (incl. initial values), constructors, methods
and modifiers (public/private/static/readonly/…), using directives,
variable declarations (var and typed), the full expression set
(arithmetic/comparison/logical operators, ternary ?:, ++/--, negation),
string concatenation, if/else if/else, for, foreach (T x in coll), while, try/catch/finally, throw, lambdas (=>), and List<T> / Dictionary<K,V> collection initializers.
C# types map to the shared AST (int/long/short → int, double/float/ decimal → double, bool, string, object, …) so code translates
cleanly to/from every other supported language.
Registered in ApolloVM (getParser, createRunner, createCodeGenerator)
and exported from apollovm.dart; .cs files resolve to the csharp
language.
New golden tests under test/tests_definitions/csharp_*.test.xml.
Closures now round-trip (parse → execute → regenerate) in these languages, not
just generate.
Wasm: host imports no longer corrupt module-function call indices
A module-function call index is importCount + position, but host imports
(env.print, env.int_to_str, …) are registered lazily while bodies are
generated. A call emitted before an import was registered (e.g. calling a
function and then print-ing, including across await points) got a stale
index and produced invalid Wasm (type mismatch). The import-discovery pass
that freezes importCount before the real pass now runs for all modules (it
only touches idempotent state, so import-free modules stay byte-identical).
Fixes async/await functions that call other functions and print between
awaits, which now run identically on the interpreter and Wasm.
Wasm: closures capture variables by reference
Captured variables are now "boxed" into shared heap cells: the closure
environment holds pointers to the cells (not copied values), so a variable
mutated after a closure is created — or mutated by the closure — is visible
on both sides, matching the interpreter. Each closure instance still gets its
own cell (e.g. two counters created from the same factory are independent).