Autumn is a multi-paradigm general-purpose programming language for the JVM.
Quick Links:
Notable Features:
- Compile On-Run
- Compile Ahead-Of-Time
- Embeddable in Java Programs
- Static Type-System
- Java Interoperability
- Immutable Structs with Non-Destructive Mutators
- Multiple Dispatch
- Direct Tail-Recursion
The development of Autumn started as a personal project of Mackenzie High in the Spring of 2010.
mackenzie@caprica: cd /tmp
mackenzie@caprica: wget https://github.com/Mackenzie-High/autumn/releases/download/v2_0/autumn.zip
mackenzie@caprica: sha256sum autumn.zip
5a4063f2887e91b114b98c17b408e190183449d3ae0787e09ae33a1e59cf1231 autumn.zip
mackenzie@caprica: unzip autumn.zip
mackenzie@caprica: cd autumn/
mackenzie@caprica: alias autumn='java -jar /tmp/autumn/autumn-2.0.jar'
mackenzie@caprica: autumn version
autumn:2.0:20250527.082723
The alias is created for use in the following examples.
Programs written in Autumn can be compiled, interpreted, or embedded.
Step: Create a project.
mackenzie@caprica: autumn create example
Current Directory = /home/mackenzie/Downloads
Project Name = example
mackenzie@caprica:
mackenzie@caprica: cd example/
Step: Create or edit the src/Main.leaf
program entrypoint.
module Main in program;
@Start
defun main (args : String[]) : void
{
F::println ("Hello World!");
}
Step: Compile the project to generate the program.jar
file.
mackenzie@caprica: autumn compile
Step: Add Autumn ands its dependencies to the CLASSPATH.
mackenzie@caprica: export CLASSPATH="${CLASSPATH}:$(find /tmp/autumn -type f -exec echo -n {}: \;)"
Step: Add the compiled program to the CLASSPATH.
mackenzie@caprica: export CLASSPATH="${CLASSPATH}:program.jar"
Step: Run the compiled program.
mackenzie@caprica: java program.Main
Hello World!
Autumn interprets a program by compiling and then dynamically loading the generated bytecode at startup.
Step: Create a project.
mackenzie@caprica: autumn create example
Current Directory = /home/mackenzie/Downloads
Project Name = example
mackenzie@caprica:
mackenzie@caprica: cd example/
Step: Create or edit the src/Main.leaf
program entrypoint.
module Main in program;
@Start
defun main (args : String[]) : void
{
F::println ("Hello World!");
}
Step: Run the program.
mackenzie@caprica: java -jar /tmp/autumn/autumn-2.0.jar run
Hello World!
Step: Create a Maven project and add Autumn as a dependency.
<dependency>
<groupId>com.mackenziehigh</groupId>
<artifactId>autumn</artifactId>
<version>2.0</version>
</dependency>
Step: Embed Autumn in the main Java program.
import autumn.lang.compiler.Autumn;
import autumn.lang.compiler.AutumnParser;
import autumn.lang.compiler.errors.BasicErrorReporter;
import java.io.File;
public final class Main
{
public static void main (final String[] args) throws Throwable
{
// This is the string of Autumn source code that
// will be dynamically compiled and executed.
final String code = """
module Main in program;
@Start
defun main (args : String[]) : void
{
F::println("Hello World from inside an Autumn script!");
}
""";
// This object will be write any compilation errors to stdout.
final BasicErrorReporter reporter = new BasicErrorReporter(System.out);
// Create a parser that can parse Autumn source-code.
final AutumnParser parser = new AutumnParser(reporter);
// This file object does *not* refer to a real file.
// The parser requires a file object for reporting syntax errors.
final File fake = new File("<script>");
// Parse the script in order to obtain an Abstract-Syntax-Tree.
final autumn.lang.compiler.ast.nodes.Module tree = parser.parse(code, fake);
// This object will control compilation and execution.
final Autumn autumn = new Autumn();
autumn.setErrorReporter(reporter);
autumn.src(tree);
// Compile and execute the script that is written in Autumn.
autumn.run(new String[0]);
}
}
- Standard Library
- Language Constructs
- Module
- Directives
- Definitions
- Statements
- Flow Control
- Variable Related
- Exception Handling
- Anonymous Functions
- Special
- Return
- Expressions
- Datums
- Operators
- Negate Operation
- Not Operation
- Divide Operation
- Modulo Operation
- Multiply Operation
- Add Operation
- Subtract Operation
- Concat Operation
- Identity Equality Operation
- Identity Inequality Operation
- Equality Operation
- Inequality Operation
- Greater-Than-OR-Equals Operation
- Less-Than-OR-Equals Operation
- Greater-Than Operation
- Less-Than Operation
- And Operation
- Or Operation
- Xor Operation
- Implies Operation
- Null Coalescing Operation
- As Operation
- Is Operation
- Object Orientation
- Ternary Conditional Expression
- Once Expression
- Locals Expression
- Progn Expression
- List Expression
- List Comprehension Expression
- Components
- Type System