buildlang/lib.rs
1// ===============================================================================
2// BUILDLANG COMPILER
3// "The Language That Evolves"
4// ===============================================================================
5// SPDX-License-Identifier: AGPL-3.0-only
6// Copyright (c) 2022-2026 Zain Dana Harper.
7// ===============================================================================
8//
9// BuildLang is a multi-paradigm systems programming language featuring:
10// - Strong static typing with gradual inference
11// - Memory safety without garbage collection (ownership + borrowing)
12// - First-class effects system
13// - Embedded DSLs (SQL, Regex, Math, Finance, Graphics)
14// - Universal compilation (x86-64, ARM64, WASM, SPIR-V, C, JS)
15// - @ai decorator, neural types (@ai decorator, neural types)
16// - Self-evolution through Axiom integration
17//
18// ===============================================================================
19
20#![warn(rust_2018_idioms)]
21#![allow(missing_docs)]
22#![allow(dead_code)]
23#![allow(ambiguous_glob_reexports)]
24#![deny(unsafe_op_in_unsafe_fn)]
25
26//! # BuildLang Compiler
27//!
28//! This crate provides the complete BuildLang compiler implementation including:
29//! - Lexical analysis (tokenization)
30//! - Parsing (recursive descent with Pratt parsing for expressions)
31//! - Type checking (Hindley-Milner with extensions)
32//! - Code generation (LLVM IR, WASM, SPIR-V)
33//!
34//! ## Example
35//!
36//! ```rust,ignore
37//! use buildlang::{compile, CompileOptions, Target};
38//!
39//! let source = r#"
40//! fn main() {
41//! println("Hello, BuildLang!")
42//! }
43//! "#;
44//!
45//! let output = compile(source, Target::Native, CompileOptions::default())?;
46//! ```
47
48pub mod ast;
49pub mod bdf;
50pub mod bql;
51pub mod codegen;
52pub mod diagnostics;
53pub mod fmt;
54pub mod lexer;
55pub mod lsp;
56pub mod macro_expand;
57pub mod parser;
58pub mod pkg;
59pub mod runtime;
60pub mod serde_float;
61pub mod tv;
62pub mod types;
63pub mod units;
64pub mod verify;
65
66/// The compiler version
67pub const VERSION: &str = env!("CARGO_PKG_VERSION");
68
69/// The language version
70pub const LANGUAGE_VERSION: (u32, u32, u32) = (1, 0, 0);
71
72/// Author information
73pub const AUTHOR: &str = "Zain Dana Harper";
74
75/// Copyright notice
76pub const COPYRIGHT: &str =
77 "Copyright (c) 2022-2026 Zain Dana Harper. Licensed under AGPL-3.0-only (see LICENSE).";
78
79// Re-export commonly used types
80pub use codegen::{CodeGenerator, GeneratedCode, OutputFormat, Target};
81pub use fmt::{FormatConfig, FormatError, Formatter};
82pub use lexer::{Lexer, SourceFile, Span, Token, TokenKind};
83pub use lsp::{run_server, DocumentStore, LanguageServer};
84pub use pkg::{Lockfile, Manifest, Registry, Resolver, Version, VersionReq};
85pub use runtime::{Channel, Executor, Future, Poll, Semaphore, Task, TaskId};