https://github.com/mackenzie-high/autumn
Autumn is a new multi-paradigm, compiled, and statically-typed programming language for the JVM.
https://github.com/mackenzie-high/autumn
autumn jvm programming-language
Last synced: 4 months ago
JSON representation
Autumn is a new multi-paradigm, compiled, and statically-typed programming language for the JVM.
- Host: GitHub
- URL: https://github.com/mackenzie-high/autumn
- Owner: Mackenzie-High
- License: apache-2.0
- Created: 2014-07-30T18:39:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-09-05T05:38:02.000Z (over 2 years ago)
- Last Synced: 2025-01-22T00:40:02.862Z (about 1 year ago)
- Topics: autumn, jvm, programming-language
- Language: Java
- Homepage: http://www.mackenziehigh.com/autumn
- Size: 15.5 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# The Autumn Programming Language
Autumn is a multi-paradigm general-purpose programming language for the JVM.
**Quick Links:**
+ [Language Specification](#language-specification)
+ [JavaDoc](https://mackenzie-high.github.io/autumn/javadoc/)
+ [Code Coverage](https://mackenzie-high.github.io/autumn/jacoco/)
**Notable Features:**
+ [Compile On-Run](#hello-world---interpreted)
+ [Compile Ahead-Of-Time](#hello-world---compiled)
+ [Embeddable in Java Programs](#hello-world---embedded)
+ Static Type-System
+ Java Interoperability
+ [Immutable Structs with Non-Destructive Mutators](specification/Struct_Definition.md)
+ [Multiple Dispatch](specification/Dispatch_Expression.md)
+ [Direct Tail-Recursion](specification/Recur_Statement.md)
## History
The development of Autumn started as a personal project of Mackenzie High in the Spring of 2010.
## Download
```plain
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.
## Hello World on Linux
Programs written in Autumn can be compiled, interpreted, or embedded.
### Hello World - Compiled
**Step: Create a project.**
```plain
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.**
```plain
module Main in program;
@Start
defun main (args : String[]) : void
{
F::println ("Hello World!");
}
```
**Step: Compile the project to generate the `program.jar` file.**
```plain
mackenzie@caprica: autumn compile
```
**Step: Add Autumn ands its dependencies to the CLASSPATH.**
```plain
mackenzie@caprica: export CLASSPATH="${CLASSPATH}:$(find /tmp/autumn -type f -exec echo -n {}: \;)"
```
**Step: Add the compiled program to the CLASSPATH.**
```plain
mackenzie@caprica: export CLASSPATH="${CLASSPATH}:program.jar"
```
**Step: Run the compiled program.**
```plain
mackenzie@caprica: java program.Main
Hello World!
```
-----
### Hello World - Interpreted
Autumn interprets a program by compiling and then dynamically loading the generated bytecode at startup.
**Step: Create a project.**
```plain
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.**
```plain
module Main in program;
@Start
defun main (args : String[]) : void
{
F::println ("Hello World!");
}
```
**Step: Run the program.**
```plain
mackenzie@caprica: java -jar /tmp/autumn/autumn-2.0.jar run
Hello World!
```
-----
### Hello World - Embedded
**Step: Create a Maven project and add Autumn as a dependency.**
```xml
com.mackenziehigh
autumn
2.0
```
**Step: Embed Autumn in the main Java program.**
```java
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("");
// 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]);
}
}
```
## Language Specification
+ **Standard Library**
+ [API Documentation](https://www.mackenziehigh.com/autumn/javadoc/index.html)
+ [Special Functions](specification/functions/README.md)
+ **Language Constructs**
+ [Module](specification/Module.md)
+ **Directives**
+ [Module Directive](specification/Module_Directive.md)
+ [Import Directive](specification/Import_Directive.md)
+ **Definitions**
+ [Annotation Definition](specification/Annotation_Definition.md)
+ [Exception Definition](specification/Exception_Definition.md)
+ [Enum Definition](specification/Enum_Definition.md)
+ [Design Definition](specification/Design_Definition.md)
+ [Struct Definition](specification/Struct_Definition.md)
+ [Tuple Definition](specification/Tuple_Definition.md)
+ [Functor Definition](specification/Functor_Definition.md)
+ [Function Definition](specification/Function_Definition.md)
+ **Statements**
+ **Flow Control**
+ [Sequence Statement](specification/Sequence_Statement.md)
+ [If-Then Statement](specification/If_Then_Statement.md)
+ [When Statement](specification/When_Statement.md)
+ [Goto Statement](specification/Goto_Statement.md)
+ [Marker Statement](specification/Marker_Statement.md)
+ [Branch Statement](specification/Branch_Statement.md)
+ **Looping**
+ [While Statement](specification/While_Statement.md)
+ [Until Statement](specification/Until_Statement.md)
+ [Do-While Statement](specification/Do_While_Statement.md)
+ [Do-Until Statement](specification/Do_Until_Statement.md)
+ [Forever Statement](specification/Forever_Statement.md)
+ [For Statement](specification/For_Statement.md)
+ [Foreach Statement](specification/Foreach_Statement.md)
+ [Break Statement](specification/Break_Statement.md)
+ [Continue Statement](specification/Continue_Statement.md)
+ [Redo Statement](specification/Redo_Statement.md)
+ **Variable Related**
+ [Var Statement](specification/Var_Statement.md)
+ [Val Statement](specification/Val_Statement.md)
+ [Let Statement](specification/Let_Statement.md)
+ **Exception Handling**
+ [Throw Statement](specification/Throw_Statement.md)
+ [Try-Catch Statement](specification/Try_Catch_Statement.md)
+ **Assertions**
+ [Assert Statement](specification/Assert_Statement.md)
+ [Assume Statement](specification/Assume_Statement.md)
+ **Anonymous Functions**
+ [Delegate Statement](specification/Delegate_Statement.md)
+ [Lambda Statement](specification/Lambda_Statement.md)
+ **Special**
+ [Nop Statement](specification/Nop_Statement.md)
+ [Expression Statement](specification/Expression_Statement.md)
+ **Return**
+ [Return Void Statement](specification/Return_Void_Statement.md)
+ [Return Value Statement](specification/Return_Value_Statement.md)
+ [Recur Statement](specification/Recur_Statement.md)
+ **Expressions**
+ **Datums**
+ [Boolean Datum](specification/Boolean_Datum.md)
+ [Char Datum](specification/Char_Datum.md)
+ [Byte Datum](specification/Byte_Datum.md)
+ [Short Datum](specification/Short_Datum.md)
+ [Int Datum](specification/Int_Datum.md)
+ [Long Datum](specification/Long_Datum.md)
+ [Float Datum](specification/Float_Datum.md)
+ [Double Datum](specification/Double_Datum.md)
+ [Big Integer Datum](specification/Big_Integer_Datum.md)
+ [Big Decimal Datum](specification/Big_Decimal_Datum.md)
+ [String Datum](specification/String_Datum.md)
+ [Class Datum](specification/Class_Datum.md)
+ [Null Datum](specification/Null_Datum.md)
+ [Variable Datum](specification/Variable_Datum.md)
+ **Operators**
+ [Negate Operation](specification/Negate_Operation.md)
+ [Not Operation](specification/Not_Operation.md)
+ [Divide Operation](specification/Divide_Operation.md)
+ [Modulo Operation](specification/Modulo_Operation.md)
+ [Multiply Operation](specification/Multiply_Operation.md)
+ [Add Operation](specification/Add_Operation.md)
+ [Subtract Operation](specification/Subtract_Operation.md)
+ [Concat Operation](specification/Concat_Operation.md)
+ [Identity Equality Operation](specification/Identity_Equality_Operation.md)
+ [Identity Inequality Operation](specification/Identity_Inequality_Operation.md)
+ [Equality Operation](specification/Equality_Operation.md)
+ [Inequality Operation](specification/Inequality_Operation.md)
+ [Greater-Than-OR-Equals Operation](specification/Greater_Than_OR_Equals_Operation.md)
+ [Less-Than-OR-Equals Operation](specification/Less_Than_OR_Equals_Operation.md)
+ [Greater-Than Operation](specification/Greater_Than_Operation.md)
+ [Less-Than Operation](specification/Less_Than_Operation.md)
+ [And Operation](specification/And_Operation.md)
+ [Or Operation](specification/Or_Operation.md)
+ [Xor Operation](specification/Xor_Operation.md)
+ [Implies Operation](specification/Implies_Operation.md)
+ [Null Coalescing Operation](specification/Null_Coalescing_Operation.md)
+ [As Operation](specification/As_Operation.md)
+ [Is Operation](specification/Is_Operation.md)
+ **Object Orientation**
+ [New Expression](specification/New_Expression.md)
+ [Call Static Method Expression](specification/Call_Static_Method_Expression.md)
+ [Call Method Expression](specification/Call_Method_Expression.md)
+ [Set Static Field Expression](specification/Set_Static_Field_Expression.md)
+ [Get Static Field Expression](specification/Get_Static_Field_Expression.md)
+ [Set Field Expression](specification/Set_Field_Expression.md)
+ [Get Field Expression](specification/Get_Field_Expression.md)
+ [Instance-Of Expression](specification/Instance_Of_Expression.md)
+ [Dispatch Expression](specification/Dispatch_Expression.md)
+ [Ternary Conditional Expression](specification/Ternary_Conditional_Expression.md)
+ [Once Expression](specification/Once_Expression.md)
+ [Locals Expression](specification/Locals_Expression.md)
+ [Progn Expression](specification/Progn_Expression.md)
+ [List Expression](specification/List_Expression.md)
+ [List Comprehension Expression](specification/List_Comprehension_Expression.md)
+ **Components**
+ [Annotation List](specification/Annotation_List.md)
+ [Annotation](specification/Annotation.md)
+ [Element List](specification/Element_List.md)
+ [Element](specification/Element.md)
+ [Formal Parameter List](specification/Formal_Parameter_List.md)
+ [Formal Parameter](specification/Formal_Parameter.md)
+ [Name](specification/Name.md)
+ [Namespace](specification/Namespace.md)
+ [Variable](specification/Variable.md)
+ [Type Specifier](specification/Type_Specifier.md)
+ [Doc Comment](specification/Doc_Comment.md)
+ [Doc Comment Line](specification/Doc_Comment_Line.md)
+ [Comments](specification/Comments.md)
+ **Type System**
+ [Type Structure](specification/Type_Structure.md)
+ [Type Conversions and Assignability](specification/Type_Conversions_and_Assignability.md)
+ [Accessibility](specification/Accessibility.md)
+ [Resolution](specification/Resolution.md)
+ [Variable Scoping](specification/Variable_Scoping.md)
+ [Compiler Warning Examples](specification/Compiler_Warning_Examples.md)
## Dependencies
+ [ObjectWeb ASM](http://asm.ow2.org/)
+ [Google Guava](https://github.com/google/guava)
+ [Snowflake Parser](https://www.mackenziehigh.com/snowflake/)