Skip to content

aetherlf/AETHER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,963 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AETHER

AETHER · Logo

Advanced Execution Through Endless Recursion

The language that should have existed before C++ got complicated, before Rust got opinionated, and before Go gave up on generics (and then half-added them back).

License: GPL v3


The Pitch

You want to write systems-level code. You need speed, control, and zero-cost abstractions.

But you also want to read your own code six months from now without crying.

AETHER gives you both. LLVM-compiled native binaries. Ownership-based memory safety. A real type system with generics, interfaces, and inheritance. And syntax that doesn't look like a cat walked across your keyboard.

package main

from aether.io.console import puts

public function main() -> I32:
    puts( "Hello, AETHER!" )
    return 0

No headers. No braces. No ceremony. Just code.

./build/aether hello.ae -o hello && ./hello
# Hello, AETHER!

Why AETHER Exists

Every systems language makes you choose. AETHER says you don't have to.

The Tradeoff Triangle That Shouldn't Exist

Readable Safe Fast Simple to Learn
C Yes Sort of
C++ Yes No
Rust Yes Yes No
Go Yes GC ~Fast Yes
Zig Yes Yes Sort of
Python Yes GC No Yes
Java GC JIT Sort of
PHP GC No Sort of
AETHER Yes Yes Yes Yes

Bold claim? Here's the receipts.

vs C - "You Deserve Better Than malloc and Prayer"

C gave us everything. And then it gave us buffer overflows, dangling pointers, and 50 years of CVEs.

AETHER keeps what C got right - direct memory access, zero-overhead abstractions, native compilation - and throws away what it got wrong:

  • No header files. Modules resolve at compile time. One file, one truth.
  • No preprocessor. No #ifdef spaghetti. No macro hell. No #include ordering nightmares.
  • Ownership tracking. The compiler catches use-after-free, double-free, and dangling references. At compile time.
  • Real strings. Not char* and a dream.
  • Generics. Monomorphized. Zero-cost. No void* casting.

You still get inline assembly, raw memory access via Memory<T>, and C FFI when you need it. You just don't get segfaults at 3am.

vs C++ - "All the Power, None of the Archaeology"

C++ is a marvel of engineering buried under 40 years of backwards compatibility. Templates that write templates. SFINAE. std::move semantics that require a PhD to get right. Build systems that need build systems.

AETHER takes the good parts:

  • Classes with single inheritance and virtual dispatch
  • Generics (monomorphized, not template instantiation)
  • Operator overloading
  • defer for deterministic cleanup

And leaves behind:

  • No header/source split. One file per module.
  • No template metaprogramming. Generics use constraints, not SFINAE.
  • No user-defined implicit conversions. No explicit keyword needed because the type system doesn't fight you.
  • Indentation-based blocks. Your code looks like what it does.

The result: C++'s power in a fraction of its complexity.

vs Rust - "Safety Without the Thesis Defense"

Rust proved that memory safety without a garbage collector is possible. Then it made you learn lifetime annotations, trait bounds, Pin<Box<dyn Future<Output = Result<T, E>>>>, and why your closure can't capture that reference.

AETHER takes Rust's core insight - ownership and borrowing - and wraps it in syntax a human can parse:

  • No lifetime annotations. The borrow checker infers scope. You write code, not type puzzles.
  • No trait objects vs generics confusion. Interfaces are interfaces. Generics are generics.
  • Real OOP when you want it. Classes, inheritance, virtual dispatch. Not everything needs to be a trait impl.
  • Familiar syntax. If you've written Python, you can read AETHER. If you've written Java, you can write it.

Rust's error messages are legendary. AETHER's goal is that you don't need them.

vs Go - "Concurrency With Actual Types"

Go got simplicity right. Then it shipped without generics, with a garbage collector, and with if err != nil on every other line.

AETHER gives you:

  • Generics from day one. ArrayList<E>, HashMap<K,V>, Box<T>. Monomorphized. Zero runtime cost.
  • No garbage collector. Ownership-based. Deterministic. No GC pauses. No hidden allocations.
  • Real error handling. try/except/finally with typed exceptions. Not (value, error) tuple juggling.
  • Inheritance. Because sometimes a Dog really is an Animal.
  • Threads, fibers, async/await. Choose your concurrency model. Built on bare-metal OS primitives, not a runtime.

vs Zig - "Comptime is Cool, but Have You Tried Just Having Generics?"

Zig's philosophy of "no hidden control flow" is admirable. AETHER respects it - defer is explicit, ownership is tracked, there's no hidden allocator.

But AETHER also gives you:

  • Full OOP. Classes, interfaces, inheritance, virtual dispatch. Zig deliberately avoids this - AETHER embraces it where it makes sense.
  • Exception handling. When errors are exceptional, treat them that way. When they're expected, use nullable types.
  • Richer standard library. Collections, threading, I/O, coroutines - all written in AETHER itself. Core I/O runs on raw syscalls with zero C runtime dependency.

vs Python - "Your Favorite Syntax, Compiled"

Python is the world's most popular language. It's also 60x slower than C and carries a garbage collector, a GIL, and an interpreter everywhere it goes.

AETHER steals Python's best idea - indentation-based syntax - and throws away everything that makes Python slow:

  • Compiled to native machine code. Not bytecode. Not interpreted. LLVM-compiled binaries.
  • Statically typed. No TypeError at runtime on line 847. The compiler catches it before you ship.
  • No GIL. Real threads. Real parallelism. No multiprocessing workarounds.
  • No garbage collector. Ownership-based memory. Deterministic deallocation. No reference cycles. No gc.collect().
  • Generics. Not "just use list[Any] and hope for the best."

If you can read Python, you can read AETHER. If you need Python's speed - well, that's why AETHER exists.

vs Java - "Objects Without the Object Tax"

Java proved that OOP at scale works. It also proved that you can make a language so verbose it needs an IDE just to write public static void main(String[] args).

AETHER gives you everything Java promised and failed to deliver lightly:

  • No JVM. No 200MB runtime. No startup latency. No classpath hell. Just a binary.
  • No garbage collector. No GC pauses. No -Xmx tuning. No "stop the world" during your request spike. Ownership handles it at compile time.
  • Null safety by design. No NullPointerException. Nullable types are explicit: ?String forces you to check. The compiler won't let you forget.
  • Indentation-based syntax. No closing brace ever mismatched again. No argument about where the { goes.
  • Real value types. Structs live on the stack. No boxing, no Integer vs int, no autoboxing surprises.
  • defer instead of try-with-resources. Cleanup without the syntactic tax.

Same OOP model. Same type safety. A fraction of the ceremony.

vs PHP - "The Web Deserves Better"

PHP powers half the web. It also has == vs ===, a standard library with inconsistent argument order, and type coercion rules that would confuse a compiler.

AETHER is for developers who grew out of PHP's "it works, don't look too closely" philosophy:

  • Compiled to native code. Not interpreted per-request. Not "compiled to opcode cache." Actually compiled. Microsecond cold starts.
  • Statically typed. Always. No "0" == false == null == "" == []. One type system. One set of rules. No surprises.
  • Memory safety. No segfaults from C extensions. No memory leaks from circular references. The borrow checker handles it.
  • Real module system. No autoloaders. No require_once chains. No Composer at runtime. from aether.io.console import puts - done.
  • Concurrency built in. Threads, async/await, fibers - not bolted on as extensions. Written in AETHER, on raw OS primitives.
  • Consistent standard library. needle, haystack? haystack, needle? In AETHER, methods live on their types. array.get(0), not array_key_exists($key, $array).

PHP got the web started. AETHER is for what comes next.


What AETHER Compiles To

Native machine code. Via LLVM 14. Same backend as Clang, Rust, and Swift.

Source (.ae)
    |
    v
  Lexer ---- INDENT/DEDENT token emission
    |
    v
  Parser --- AST construction
    |
    v
  Semantic - Two-pass type checking (register types, then analyze bodies)
    |
    v
  Borrow --- Ownership and borrowing validation
    |
    v
  Optimizer  AST-level: constant folding, DCE, strength reduction, TCO
    |
    v
  Codegen -- LLVM IR generation
    |
    v
  LLVM ----- Native executable

No interpreter. No VM. No JIT. No runtime (unless you use async/threads, which link small static libs).


Feature Set

  • Indentation-based syntax - blocks defined by colon + indent, no braces
  • Strong static typing - OOP type system with I64, F64, String, Boolean, and user-defined types
  • Classes - single inheritance, interfaces, virtual dispatch, Readonly and final modifiers
  • Structs - stack-allocated value types with constructors and methods
  • Enums - unit variants, backed values, pattern matching via match
  • Generics - monomorphized at compile time with constraint support
  • Nullable types - ?Type syntax with None literal
  • Error handling - try/except/finally with typed raise
  • Ownership and borrow checking - move semantics, borrow rules, use-after-move detection
  • Pattern matching - match expressions with enum dispatch
  • Defer - LIFO deferred execution before function return
  • Inline assembly - asm volatile with LLVM constraint syntax
  • C FFI - extern function declarations for direct C interop
  • Memory<T> - compiler intrinsic for raw typed memory (no T[] syntax)
  • Collections - ArrayList<E>, HashMap<K,V>, HashSet<E>, LinkedList<E> - all written in AETHER
  • Concurrency - threads, mutexes, atomics, channels, fibers, async/await
  • Boolean keywords - and/or/not instead of &&/||/!
  • LLVM backend - compiles to native executables via LLVM 14
  • REPL - interactive mode for quick prototyping
  • AST optimizer - constant folding, strength reduction, dead code elimination, tail-call optimization
  • LSP server - editor support with completion, diagnostics, and hover

Building from Source

Dependencies

  • C++17 compiler (GCC 12+ or Clang 14+)
  • LLVM 14 (via llvm-config)
  • CMake 3.16+
  • fmt, spdlog, argparse, GoogleTest

Build

cmake -B build -DCMAKE_BUILD_TYPE=Release
make -C build -j$(nproc)

Produces ./build/aether (compiler), ./build/aether-lsp (language server), and ./build/aether-tests (test suite).

Test

# Unit tests (GoogleTest)
./build/aether-tests

# Single test
./build/aether-tests --gtest_filter="ParserTest.ParsesSimpleFunction"

# All module integration tests (158 .ae files)
for f in examples/testing/modules/*.ae; do ./build/aether "$f" 2>&1 | tail -1; done

CLI Usage

# Compile to executable
./build/aether source.ae -o program

# Emit LLVM IR
./build/aether source.ae --emit-llvm -o output.ll

# Dump AST
./build/aether source.ae --dump-ast

# Dump token stream
./build/aether source.ae --dump-tokens

# Optimization level
./build/aether source.ae -O3 -o program

# Link external library
./build/aether source.ae -l m -o program

# Verbose compilation (shows each pipeline stage)
./build/aether source.ae --verbose -o program

# REPL
./build/aether --repl

Standard Library

Written in AETHER. Core I/O runs on raw syscalls - no C runtime needed for console, file, or network operations. Collections use Memory<T> (which maps to malloc/free under the hood).

Module What It Does
language/ OOP type wrappers - I64, String, Boolean, Char, Float, etc.
errors/ Exception hierarchy - Throwable, Error, Exception, Warning (auto-imported)
memory/ Memory<T> - compiler intrinsic for raw typed memory
collection/ ArrayList<E>, HashMap<K,V>, HashSet<E>, LinkedList<E>, Pair, Tuple
iterators/ Iterator, Iterable, Traversable interfaces
operators/ Comparable, Equatable, Hashable - operator overloading support
io/ Console I/O (puts, putsln, input, getpass), file I/O, streams, paths
threading/ Thread, ThreadPoolExecutor, Mutex, RwLock, Atomic, Channel, Barrier
coroutine/ async/await support with event loop runtime
fiber/ Lightweight fiber / green thread support
os/ Bare-metal OS primitives - syscalls, memory management, networking, IPC, crypto
functions/ C FFI extern declarations (printf, malloc, free)
cli/ Command-line argument parsing and terminal utilities
subprocess/ Child process management

Source Layout

src/aether/
  ast/          # AST nodes, visitor, printer
  codegen/      # LLVM IR generation
  common/       # Shared utilities
  compiler/     # Compilation pipeline orchestration, module resolution, REPL
  descriptor/   # Built-in type descriptors and method IR generators
  diagnostic/   # Error/warning reporting with source locations
  ir/           # HIR and MIR (WIP)
  lexer/        # Tokenizer with indentation tracking
  optimizer/    # AST-level optimization passes
  parser/       # Recursive descent parser
  semantic/     # Type system, scope management, borrow checker

src/aether-lsp/   # Language Server Protocol implementation
src/aether-runtime/
  async-runtime/       # Async/await event loop
  thread-runtime/      # Thread spawning (pthread)
  subprocess-runtime/  # Fork/exec subprocess management
  ipc-runtime/         # Shared memory IPC

extensions/
  aether-vsc/    # VS Code extension (syntax highlighting + LSP client)
  aether-nano/   # nano syntax highlighting
  aether-hljs/   # highlight.js language definition

The Philosophy

AETHER is built on a simple belief: low-level programming doesn't have to feel low-level.

You should be able to write an operating system kernel module and a web server in the same language, with the same syntax, and understand both six months later without a decoder ring.

Memory safety isn't a feature - it's a baseline. Readability isn't a luxury - it's a requirement. And "zero-cost abstraction" means zero cost, not "zero cost after you spend three weeks understanding the template instantiation error."

AETHER doesn't ask you to choose between power and clarity. It gives you both, compiles to the same LLVM IR as Clang and Rust, and gets out of your way.

Write code that reads like Python. Ship binaries that run like C.


Warning

AETHER is a research-oriented compiler in active development. It has not been audited for security, memory safety, or performance stability. Do not use it for production systems. By using this software, you acknowledge that:

  • Syntax and APIs are subject to breaking changes without notice.
  • Generated code may contain bugs or undefined behavior.
  • Optimizations are experimental.

That said - it compiles 158 module integration tests, runs benchmarks, and hasn't segfaulted in a while. So there's that.


Issues

If you encounter crashes, incorrect LLVM IR, or memory leaks:

  1. Search the Issue Tracker first.
  2. Open a New Issue with your environment (OS, LLVM version), a minimal .ae snippet, and expected vs actual output.

Support

Give spirit to the developer, no matter how many donations given will still be accepted
paypal.me/hxAri


Licence

All AETHER source code is licensed under the GNU General Public License v3.

About

AETHER is a programming language designed to handle deep, expressive, and elegant execution through the concept of infinite recursion.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors

Languages