Introduction
What’s Ard?
Section titled “What’s Ard?”- A R-eally D-ope Language
- ard is slang for “alright.”
- Irish and Scottish Gaelic word meaning ‘high, lofty’, ‘above the ground, elevated’
- Ardbeg is my favorite scotch and I was drinking it when I came up with this name
Language Description
Section titled “Language Description”Ard is a general-purpose programming language designed for legibility, simplicity, and type-safety. It combines elements from JavaScript, Swift, Go, and Rust.
Design Goals
Section titled “Design Goals”- Readability: Ard code should be easy to read and understand.
- Simple: There should be one obvious way to do things.
- Safety: Type errors are caught at compile time and runtime errors must be handled.
- Reliable: Built on Go’s runtime, so programs can be fast and efficient.
Philosophy
Section titled “Philosophy”Ard follows Go’s philosophy for readability from left to right, rather than the usual spiraling syntax found in C-based languages (read more). This design choice makes code more intuitive to read and understand.
Key Characteristics
Section titled “Key Characteristics”No Exceptions
Section titled “No Exceptions”Ard does not have exceptions. Instead, errors are represented as values using the built-in Result<$Val, $Err>
type.
This approach makes error handling explicit and facilitates fault-tolerant programming.
Static Typing with Inference
Section titled “Static Typing with Inference”Variables and functions are statically typed. The compiler can also infer types in most cases, reducing verbosity while maintaining safety.
Explicit Mutability
Section titled “Explicit Mutability”Ard’s memory management is focused on data access controls. Variables and data structures are immutable by default and must be marked as mutable to prevent unwanted data mutations.
No Return Keyword
Section titled “No Return Keyword”Without return keywords, the returned value of a function is always the last expression when a function signature states the return type.