Skip to main content

Crate quantalang

Crate quantalang 

Source
Expand description

§QuantaLang Compiler

This crate provides the complete QuantaLang compiler implementation including:

  • Lexical analysis (tokenization)
  • Parsing (recursive descent with Pratt parsing for expressions)
  • Type checking (Hindley-Milner with extensions)
  • Code generation (LLVM IR, WASM, SPIR-V)

§Example

use quantalang::{compile, CompileOptions, Target};

let source = r#"
    fn main() {
        println("Hello, QuantaLang!")
    }
"#;

let output = compile(source, Target::Native, CompileOptions::default())?;

Re-exports§

pub use codegen::CodeGenerator;
pub use codegen::GeneratedCode;
pub use codegen::OutputFormat;
pub use codegen::Target;
pub use fmt::FormatConfig;
pub use fmt::FormatError;
pub use fmt::Formatter;
pub use lexer::Lexer;
pub use lexer::SourceFile;
pub use lexer::Span;
pub use lexer::Token;
pub use lexer::TokenKind;
pub use lsp::run_server;
pub use lsp::DocumentStore;
pub use lsp::LanguageServer;
pub use pkg::Lockfile;
pub use pkg::Manifest;
pub use pkg::Registry;
pub use pkg::Resolver;
pub use pkg::Version;
pub use pkg::VersionReq;
pub use runtime::Channel;
pub use runtime::Executor;
pub use runtime::Future;
pub use runtime::Poll;
pub use runtime::Semaphore;
pub use runtime::Task;
pub use runtime::TaskId;

Modules§

ast
Abstract Syntax Tree
codegen
Code Generation
fmt
Code formatter for QuantaLang.
lexer
Lexical Analysis
lsp
Language Server Protocol implementation for QuantaLang.
macro_expand
Macro Expansion
parser
Parser
pkg
Package manager for QuantaLang (quanta-pkg).
runtime
Runtime support for QuantaLang programs.
types
Type System

Constants§

AUTHOR
Author information
COPYRIGHT
Copyright notice
LANGUAGE_VERSION
The language version
VERSION
The compiler version