The standard library

System.Core, the library every Antril program is built against - its namespaces, where to browse every type, and how to look types up from the command line.

Last updated 2 min read Edit on GitHub

On this page

Every Antril program is built against System.Core, Larva's standard library. It is written in Antril and comes compiled with Larva, so nothing has to be installed or referenced: import System; is enough.

Browse it: the library browser shows every namespace, type and member of System.Core as Antril, with its documentation comments.

Namespaces

Namespace What it has
System The primitive types (Int32, Float64…), String and StringBuilder, Console, Math, Random, collections (List, Dictionary, HashSet, Queue, Stack, LinkedList, PriorityQueue, SortedDictionary, SortedSet), Span, tuples, DateTime and TimeSpan, Environment, GC, Resources, Exchange, the exceptions, Type and Attribute.
System.IO File, Directory, Path, streams (FileStream, MemoryStream, BufferedStream), readers and writers (StreamReader, StreamWriter, StringReader, StringWriter, BinaryReader, BinaryWriter).
System.Text Encoding, JsonValue and JsonReader, Regex and Match.
System.Net TcpClient, TcpListener, NetworkStream, HttpClient.
System.Threading Thread, ThreadPool, Parallel, locks and events, atomics, ConcurrentQueue, BlockingCollection.
System.Threading.Tasks Task, Task<T> and the Scheduler behind async and await.
System.Reactive Source, Effect and Reactive, behind reactive code.
System.Reflection FieldInfo, PropertyInfo, MethodInfo, ConstructorInfo, ParameterInfo.
System.Diagnostics Process, Stopwatch.
System.Runtime.InteropServices Marshal, Memory, and the attributes for interop.

The System.Core overview walks through the main types with examples.

From the command line

larva describes the library too. larva types lists a namespace's types, larva show prints a type as Antril, and larva search finds members by name:

Terminal
larva types System.Threading.Tasks
System.Threading.Tasks
  final class CompleteTask : Task
  public static class Scheduler
  public class Task
  public class Task<T> : Task
  final class WhenAllTask : Task
larva show --no-bodies --public System.Stack
// System.Stack — System.Core (decompiled from Larva HIR)

into namespace System
{
	/// Last in, first out: Push and Pop at the top.
	public class Stack<T>
	{
		public:
			new();
			Push(T item);
			Pop() : T;
			Peek() : T;
			Clear();
			i32 Count { get; }
			bool IsEmpty { get; }
	}
}
larva search Trim
System.String.Trim() : String<T>

In the editor, hovering a name shows its declaration and documentation, and going to its definition opens it as Antril. See The larva command.

Was this page helpful?

No address is stored; your user name is, if you are signed in.

Esc