Write Antril, run it in your browser and share it with a link. Programs are compiled to WebAssembly and run on your machine, not on the server.
Running programs is unavailable right now: the WebAssembly linker (wasm-ld, part of LLVM) is not installed on this server. You can still write, share and download code.
importSystem;
intonamespacePeople
{
publicrecordclassPerson
{
public:
strName;
i32Age;
new(strName, i32Age);
}
Main()
{
Person ana = newPerson("Ana", 31);
Person older = ana with { Age = 32 };
Console.WriteLine(ana);
Console.WriteLine(ana == newPerson("Ana", 31));
Console.WriteLine(older.Age);
if (ana isPerson(var name, > 30))
Console.WriteLine(name + " is over 30");
Console.WriteLine(older is { Name: "Ana", Age: 32 });
}
}
Output
Press Run (or Ctrl+Enter) to compile and run the program.
Input
What Console.ReadLine() reads, one line at a time.
Ctrl+Enter runs. Tab indents (Shift+Tab outdents); press Esc, then Tab, to leave the editor. A program may run for 10 seconds.