Fast, high-productivity programming language
- Zig 99.9%
- GLSL 0.1%
| native | complex comptime globals, better type inference, nicer demo | |
| runtime | qbe-irgen: switch, global init | |
| selfhosted | qbe-irgen: exceptions | |
| src | more qbe | |
| std | more qbe work | |
| test | qbe-irgen: exceptions | |
| tools/micro | number suffixes, | |
| zeppelin | number suffixes, | |
| build.zig | number suffixes, | |
| build.zig.zon | clean up | |
| hello.png | readme | |
| LICENSE | init | |
| README.md | readme | |
Aer Programming Language
Write less code, faster. Fight modern bloat. Enjoy programming again.
Highlights:
- productive, ergonomic language
- high performance
- fast compilation
- async by default (uncolored, stackful) (not implemented yet)
- lightweight compiler (~10k LOC)
Current status: Self-hosted compiler almost done (first iteration). See Roadmap for details.
Want this to succeed?
Demo
varstd=import"std"fnmain()void{varcontext=std.ui.UIContext("hello")varwindow=context.create_window(800,600,"Hello")varrenderer=window.rendererrenderer.set_clear_color(.dark_grey,255)vari=0varproperties=["lightweight","productive","fun"]loop{foreventinwindow.get_events(){ifevent.typein[.window_close,.key_down]{return}ifevent.type==.pointer_button_down{i=(i+1)%properties.length}}varready=renderer.next_frame()ifnotreadydocontinuerenderer.move_to(400,100)renderer.line_to(600,400)renderer.line_to(200,400)renderer.close()renderer.fill(.red,255)renderer.text("Aer is",260,450,48)renderer.fill(.from_int(0xe0e0e0),255)renderer.text("{properties[i]}",490,450,48)renderer.fill(.red,255)renderer.render()}}
Roadmap
- language design (mostly)
- bootstrap bytecode compiler (zig)
- bootstrap VM (zig)
- self-hosted, native compiler
- parser
- semantic analysis
- QBE emitter
- general
- dynamic dispatch
- global initialization
- exceptions
- more language features
- value semantics for aggregate types
- simple ownership system
- exception signatures ("throws", optional)
- defer, errdefer
- minimal bootstrap interpreter
- own backend
- QBE feature parity
- exception support
- x86_64 codegen
- fibers (again)
- port zeppelin/ from zig to aer (vulkan 2d graphics)
- windows support
- own assembler
- own linker
- aarch64 codegen
- android support
- (maybe) riscv64
- (maybe) arm32
- (maybe) riscv32
- (maybe) mac support
Build
For bootstrapping, aer currently requires zig v0.16.0-dev.1272+f3309a96a. Later, there will be a minimal bootstrapping interpreter instead.
zig build
zig-out/Debug/aer/aer selfhosted/main.aer
Features (old bytecode compiler)
- basic math
- variables
- if
- functions
- calls
- basic loops
- break
- continue
- peer type resolution
- function parameters
- strings
- lists
- native function calls
- reference counting
- classes (fields, functions, constr/destr)
- globals
- for
- imports
- packages
- std lib
- runtime strings
- string interpolation
- string compare
- error messages
- exceptions
- static functions
- assert
- optional parameters / default arguments
- short circuit and/or
- interfaces
- inheritance
- null safety (optionals)
- explicit conversions
- generics
- enums
- is operator
- unreachable (runtime exception)
- weak refs
- slices
- aliases (variables with modules, types)
- value serialization
- substrings
- native executables (embedded bytecode)
- fibers
- optional or x (orelse)
- bitwise and/or
nice to have
- optional comparison (optional_x == 5, without unpacking)
- . type inference
- scoped codeblocks
- hex int literals
- bit shift operators
- in
- "not" instead of "!"
- not in
- number suffixes ("100k")
- char literals
- switch
- errors as enums
- while
- maps (no special syntax)
- pow
- string concatenation
- debug info: source lines
- embedding files (comptime std.read_file)
- unions
- labeled codeblocks
- raw heap
- actual pointers
- arrays (as unmanaged buffers)
- access to alloc/free
- generic functions
- nested namespaces (class within class)
- enum inheritance
- if-not-null operator (opt?.some_field)
- merge interface with class
- allows for "abstract" classes
- "multi inheritance" only allowed if no fields
- first class functions
- lambdas
- global codeblocks
- defer
- direct object initialization (constructor bypass)
- catch: capture error to enable re-throwing
- structs: non-rc, value semantics, c abi or packed
- operator overloading
- public / private (module private)
- exception tracking (implicit + optionally explicit function signature)
- threads
- volatile/atomic variables
- locks
- byte type
- for-else
- goto
- doc comments
- closures
- owning/non-owning object references
- comptime
- constant folding
- VM-based evaluation of globals (no side effects)
- VM-based evaluation of "comptime"-tagged functions calls (everything allowed)
- (multi line comments)
nice to have advanced
- doc generator
- language server
- error reporting
- signature hint
- go to definition
- autocomplete
- intellij language plugin
- package manager?
- hot reload
- type reflection?
- builtin RPC