Sec Language Manual
Purpose
This manual explains the Sec programming language for programmers who want to read, write, and reason about Sec code. It is a human-facing language manual, not a compiler implementation document.
The manual favors precise rules, short examples, and explicit explanations. Sec is designed to be a compiled, statically typed, high-performance language with strong safety rules and minimal hidden behavior.
Manual Structure
The manual is split into multiple HTML pages. Each major topic gets its own page so that the left navigation can point directly to sections and subsections using anchors.
| Page | Topic |
|---|---|
| Introduction | Language goals, design philosophy, core principles, and an overview of the Sec programming language. |
| Basic Syntax | Source files, modules, comments, identifiers, keywords, punctuation, blocks, and the general syntax used throughout the language. |
| Variables and Basic Types | Variable declarations, mutability, type inference, primitive types, and the fundamental value types provided by Sec. |
| Named Types, Contracts and Units | Create semantic types, define value constraints, model physical units, and understand compile-time type safety. |
| Structs, Properties and Implementation | Define data structures, attach behavior with implementation blocks, expose controlled access through properties, and organize related types. |
| Functions | tba |
| If | tba |
| Switch | tba |
| Match | tba |
Recommended Reading Order
- Read the introduction to understand the design direction.
- Read the syntax page before studying larger examples.
- Read the type system page early, because Sec code is built around semantic typing.