Larva 0.8.0
Antril 0.8.0 and the Larva toolchain, with installers for Windows, Linux and macOS, a standard library that ships compiled, signed language packs, the Hive package manager and VS Code support.
Larva 0.8.0 is the toolchain for the Antril language, together with Antril 0.8.0, its language pack. This page lists what the release contains, area by area, with links to the documentation. To install it, see the download page or run the one-line installer for your system (see Install below).
Highlights
- Installers for Windows, Linux and macOS. The Windows setup wizard, a portable zip, and, new in this release,
.tar.gzarchives withinstall.shfor Linux and macOS. The installers work for the current user, without administrator rights. - One-line install from www.antril.org, with
install.ps1on Windows andinstall.shon Linux and macOS. - The standard library ships compiled. System.Core is installed as
System.Core.dll, a Larva library, instead of source files compiled on first use. - Languages are signed packs. Antril lives in
Languages/Antril, its files hashed in its manifest and the manifest signed.larva languageschecks every installed pack. - A languages registry, new and still changing:
larva languages install,publishand more, with packs signed by their author and by antril.org. - Hive is built into
larva: signed packages, version ranges,hive.lock, and a public registry on www.antril.org with accounts and API tokens. - Memory per project.
gc: default,refcount,arenaormanualin.queen, and libraries built for another mode linked as their own GC domain. - Four back ends: LLVM, Larva's own x86-64 back end, WebAssembly, and the IL VM.
- VS Code: the Antril and Larva extensions, with a language server that also checks borrows as you type.
What's in 0.8.0
The Antril language
- Primitive types from
i8toi256,u8tou256andf16tof256, plusiptr/uptr,strandany. A type without?never holdsnull. See Basics. - Classes with access sections (
public:,private:,internal:,inherited:,friendly:,file:),valuetypes, base and final classes, interfaces with default bodies, properties, static classes and destructors. See Types. - Records that compare by content and copy with
with. Tuples of any number of elements. Enums over integers,stror avalue, andbitflag enums. See Records and Enums. - One
loopkeyword for every kind of loop, andswitchwith constant, comparison, range, type, property and positional patterns. See Control flow. - Function types (
func<A> : R) and lambdas that capture, iterators withyield, generics with constraints such asT : number,T : new()andT : op +(T, T) : T, and variadic generics (T...withstatic loop). See Functions and generics. - User-defined operators, including new symbols with their own precedence, and extension blocks (
ext,static ext, constrainedext<T : …>). See Operators and Extension blocks. exceptiondeclarations, withtry,catchandfinally. See Errors and exceptions.async/awaitoverTaskandTask<T>, and reactive classes withreactivefields,computedvalues,effectblocks andreactsmethods. See Async and reactive code.- Destructors in every memory mode,
region { }blocks,&T/&mut Treferences checked by the borrow checker (offby default,warnorenforce), pointers inunsafecode,unsafe: denyper project, and fixed buffers, includingfixed T[]kept inside afinalclass's object. See Memory. - Calling C directly with
[Import], C struct layouts, function pointers and exports. See Interop with C. - The full language reference, including every diagnostic.
Larva
larva newwith theConsole-AppandLibrarytemplates. Templates are stored as Larva HIR, and each language writes them as its own source. See new.larva runbuilds the current project only when something changed, then runs it. See run.larva buildwith--check,--dll,--target native|wasm|wasm-llvm,--backend llvm|x64,-O0to-O3,--borrowcheck,--cpuand--timings. See build.larva libcompiles sources into a Larva library: a.dllthat carries compiled Larva code. See lib.larva configsets machine-wide defaults: GC mode, back end, target, optimization, CPU, reflection, borrow checker, unsafe code, generics, default access and Hive registries. See config..queenproject files with thePROJ,BUILD,DEPS,SOURCES,FILES,RESOURCESandHIVEchunks, and resources built into the program (System.Resources). See Project files.larva types,larva showandlarva searchbrowse the standard library, libraries and your own sources, in Antril or as HIR (--lang hir). See Exploring code.larva bindwrites a Larva library for a native.dllor.so, from a C header (preprocessed with clang when it is installed) or a.binddescription. Binding profiles written in Antril (--profile) decide every name. See Native bindings.- Language packs:
larva languageslists and verifies installed packs, andlarva languages keyandpacksign them. Packs from the languages registry, which is new, are installed withlarva languages install. See Language packs and The languages registry. - Back ends: LLVM (the default, optimizing), Larva's own x86-64 back end (faster to compile), WebAssembly through LLVM (
--target wasm-llvm) or Larva's own back end (--target wasm), and the IL VM for.lvmmodules (larva run,dis,link,native). See Architecture. - Memory: a generational tracing collector with a parallel copying nursery, reference counting, arenas and manual memory. A dependency whose
gc:differs from the program's is linked as its own GC domain, and text and bytes cross between domains withSystem.Exchange. See Garbage collection and GC domains.
Standard library
- System.Core is written in Antril and installed compiled, as
System.Core.dll. Browse it in the library browser. - Collections, text,
Mathover every number type (exact on integers and onf128/f256),Random,DateTime, reflection andResourcesinSystem. - Files, folders, paths and streams in
System.IO. JSON (JsonValue) and regular expressions (Regex) inSystem.Text. - TCP and
HttpClient.GetinSystem.Net.ProcessandStopwatchinSystem.Diagnostics. - Threads, locks, atomics and
ParallelinSystem.Threading. Tasks inSystem.Threading.Tasks.System.Reactive. System.Bindings.dll, which binding profiles are written against.
See the System.Core overview.
Hive
larva hive add,install,restore,info,list,verifyandtrustfor using packages, andkey,packandpublishfor making them. See Using packages and Publishing packages.- Packages named
Author/Name, with version ranges (@1.2,@^1.2,@>=1.2) and ahive.lockthat pins each version's hash, key and registry. - Packages signed with ECDSA P-256. Every file is hashed in the manifest. Signing keys are remembered on first install, and nothing from a package runs when it is installed.
- Compiled and source packages, and packages that wrap a library built elsewhere, such as a native binding.
- Registries on the web, on any static HTTPS server, or in a folder. The public registry is
https://www.antril.org/hive-api, with accounts, authors and API tokens. See The registry API and Accounts, tokens and authors.
Editors
- Antril for VS Code: syntax highlighting, snippets, file icons and semantic colors for
.antfiles. It installs Larva with it. - Larva for VS Code runs
larva lspfor every installed language. It gives errors as you type (borrow checker included), completion, hover, navigation into decompiled library types and.queensupport. It adds the commands New Project from a Template, Run, Check, Build Native Executable, Build WebAssembly, Bind a Native Library, Generate Bindings from the Profile Open, List a Native Library's Exports, Show Type (decompiled) and Restart Language Server. See VS Code. larva lspworks with any editor that speaks the Language Server Protocol. See The language server.
Install
| File | System |
|---|---|
LarvaSetup-0.8.0-win-x64.exe |
Windows x64: the setup wizard, or --silent from a terminal. |
Larva-0.8.0-win-x64.zip |
Windows x64, portable: unpack and run larva.exe. Nothing is added to PATH. |
Larva-0.8.0-<os>-<arch>.tar.gz |
Linux x64 and macOS arm64: unpack and run install.sh. |
Or in one line:
irm https://www.antril.org/install.ps1 | iex
curl -fsSL https://www.antril.org/install.sh | sh
Options pass through to install.sh, for example curl -fsSL https://www.antril.org/install.sh | sh -s -- --no-path.
- The setup wizard installs into
%LOCALAPPDATA%\Programs\Larva. It can add Larva to yourPATH, register it in Settings > Apps, makehttps://www.antril.org/hive-apithe default package registry and show Larva's files with their icons. Each of these can be turned off (--no-path,--no-registry,--no-hive,--no-types).--uninstallremoves Larva. install.shinstalls into~/.local/share/larva(on macOS,~/Library/Application Support/Larva) and puts alarvacommand in~/.local/bin. It takes--prefix,--no-path,--no-hive,--no-typesand--uninstall.- On Windows, installing over an earlier version removes only the files that version installed. Anything else in the folder is left alone.
- Optional tools: the MSVC build tools for native executables on Windows, clang for preprocessing C headers in
larva bind, and Node.js for running WebAssembly builds outside a browser.
See Install Larva and The installers.
Known limitations
- The Linux and macOS packages are new and less tested than the Windows installer. Please report problems on the forum.
- Native executables are linked with the MSVC tools. Native builds on Linux and macOS are not finished yet.
gc: customis accepted, but there is no interface for a project's own collector yet. Such projects are built with the tracing collector.- Larva's own WebAssembly back end (
--target wasm) emits invalid modules for some programs and does not support 256-bit integers. Use--target wasm-llvm. Maincannot receive text arguments, andMain() : i32prints its result instead of exiting with it.larva buildcompiles the whole program each time. A per-assembly incremental cache is planned.- Hive versions cannot be yanked on www.antril.org yet.
Files and checksums
The files of this release are not published here.