Getting Started /Choosing a Language

Getting Started

Choosing a Language

Codetoy runs AssemblyScript, C# and Python with the same API. Here's how they differ and which one to pick.

All three languages draw with the same canvas, read the same input and run the same update loop. What differs is syntax, performance and which publishing features they support.

Our recommendation

Start with AssemblyScript. It's fast, it reads like TypeScript, and it's the only language that can publish Builds and Discord Activities today.

#At a glance

AssemblyScript C# Python
Best for Games you want to publish Unity and .NET developers Learning, math and quick sketches
Syntax TypeScript-like, strictly typed Modern C# 14 (top-level statements) Python 3
Runs on WebAssembly (compiled) .NET on WebAssembly Pyodide (CPython on WebAssembly)
Startup Instant A few seconds the first time A few seconds the first time
Performance Fastest Fast Slower; fine for sketches
Builds ✅ Not yet Not yet
Discord Activities ✅ Not yet Not yet
Share & embed ✅ ✅ ✅
Update loop export function update() Screen.OnUpdate(() => { }) def update():
Events export function onKeyDown() Input.OnKeyDown(...) def keyDown():

AssemblyScript is a strictly typed language with TypeScript syntax that compiles straight to WebAssembly. Programs start instantly and run fast, and the compiled .wasm is small. That's what makes Builds possible.

  • Familiar if you know TypeScript or JavaScript.
  • Numbers have explicit types: f64 for decimals, i32 for integers.
  • Supports operator overloading, which is handy for vector math.
  • You define update and event handlers as exported functions.

Coming from TypeScript? A few things work differently. Read Language Notes and the official AssemblyScript concepts guide.

#C#

Codetoy runs modern .NET in the browser with C# 14 language features. If you use Unity or .NET, it will feel like home: Screen.OnUpdate works like Update() and Screen.DeltaTime like Time.deltaTime.

  • Use top-level statements or a classic Main.
  • You register the update loop and events as callbacks (lambdas).
  • Not available yet: Builds, Discord, arc, elapsedTime, frameCount and the resize event.

See Coming from Unity for a side-by-side tour.

#Python

Python runs on Pyodide, so the standard library (math, random and more) is there. It's the friendliest choice for beginners and for exploring math visually.

  • Define functions with the right names (update, keyDown, mouseDown …) and Codetoy calls them.
  • Remember global when you assign a module-level variable inside a function.
  • Slower than the compiled languages: keep per-frame work modest.
  • Not available yet: Builds and Discord.
Esc