Basics
Guides
API Reference
Basics
Guides
API Reference
An extern class is an Aussom-side declaration that wraps a Java class. The functions inside it have no Aussom body - they map directly onto methods of the Java class. Most of the standard library is built this way: a small Java class implements the work, and an extern class makes it usable from Aussom.
You will mostly use extern classes, not write them. This page explains both sides.
An extern class behaves like any other class once it is in scope.
Static externs (the most common kind for stdlib modules) are called
on the class name; instance externs are created with new.
The sys module is a good example. It is a static extern.
include sys;
class App {
public main(args) {
c.log(sys.getAssemblyPath());
c.log(sys.getCurrentPath());
}
}
You do not have to think about Java when you call into one of these modules. The runtime handles the bridge.
If you open one of the standard library .aus files (or the source
of a host application), the declarations look like this:
static extern class sys : com.aussom.stdlib.ASys {
public extern getSysInfo();
public extern getAssemblyPath();
public extern getCurrentPath();
// ...
}
What each part means:
static - this is a singleton, called on the class name.extern - the body is provided by Java, not Aussom.class sys - the Aussom-facing name.: com.aussom.stdlib.ASys - the fully-qualified Java class that
implements the methods.public extern getSysInfo() - a stub for a Java method. The
function exists from Aussom's point of view, but the body is in
Java.Extern functions can declare argument types just like regular Aussom functions. Type-annotated extern arguments save the Java side from having to validate every call.
public extern parseInt(string Value);
public extern fileSize(string Path);
A class may inherit from at most one extern class, mixed with any number of Aussom-side parents. This is how you build on a Java type while still adding Aussom methods.
class MyApp : AppBase {
public index(req) {
// ...
}
}
AppBase is an extern class supplied by Aussom Server. MyApp
inherits its routing and request infrastructure from Java, then
adds the index route in Aussom.
You cannot inherit from more than one extern class.
There are two main reasons:
If you build your own Java host that embeds the Aussom interpreter, your custom classes register the same way. Aussom code running on your host gets a curated view of whatever your host wants to expose, and nothing more - the security manager makes sure of it.
include finds extern modules at parse time.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.