Skip to content
/ medi Public

Domain-specific Programming Language to Empowering Healthcare with Secure, Fast, and Clinician-Friendly Analytics.

License

Notifications You must be signed in to change notification settings

MediLang/medi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

364 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Medi Logo

The Medi Programming Language

Website | Documentation | Contributing | Discord

License Status CodeRabbit Pull Request Reviews codecov

Medi is a programming language purpose-built for healthcare, designed to transform medical analytics with unparalleled ease, speed, and security. With a beginner-friendly syntax inspired by Python and R, high performance rivaling Julia, Rust, and C++, and native support for healthcare standards like FHIR, HL7, and DICOM, Medi empowers clinicians, researchers, and developers to unlock insights from complex medical data.

From genomic analysis to real-time patient monitoring, clinical trials to hospital operations, Medi delivers secure, scalable, and clinician-friendly solutions.

Why Medi?

Healthcare demands tools that balance accessibility, performance, security, and compliance. Existing languages fall short:

  • Python/R: Versatile but slow for big data, lack native healthcare standards, and require complex integrations.
  • SAS/Stata: Expensive, proprietary, and cumbersome for modern workflows.
  • Julia: Fast but not healthcare-specific, with a smaller ecosystem.

Medi fills these gaps with:

Challenge Medi's Solution
Performance on big data LLVM-compiled, near-C++ speed
Healthcare standards Native FHIR, HL7, DICOM, genomics (FASTQ, VCF)
Compliance Built-in regulate blocks, PHI tracking, HIPAA/GDPR automation
Edge/IoT deployment WebAssembly, RISC-V targets for wearables and medical devices
Accessibility Clinician-friendly syntax, visual IDE

Key Features

  • Beginner-Friendly Syntax: Python-like readability with R-style data pipelines (|>). Declarative constructs like fhir_query and plot_kaplan_meier simplify complex tasks.
  • High Performance: Compiled to machine code via LLVM. Supports parallel processing, GPU acceleration (CUDA/OpenCL), and targets x86-64, WebAssembly, and RISC-V.
  • Medical Data Science & AI: Built-in statistical methods (kaplan_meier, sir_model), pre-trained models for diagnostics, federated learning for privacy-preserving analytics.
  • Privacy & Compliance: federated and dp constructs for differential privacy. regulate blocks for automated HIPAA/GDPR/FDA compliance checks.
  • Healthcare Interoperability: Native FHIR, HL7, DICOM support. Integration with Python (py_call), R (r_call), and healthcare systems (Epic, Cerner, AWS HealthLake).

Example

// Query patients with diabetes and analyze outcomes
let diabetic_patients = fhir_query("Patient")
    |> filter(condition: icd10("E11"))  // Type 2 diabetes
    |> join(observations: "HbA1c");

// Run survival analysis with compliance checks
regulate { standard: "HIPAA", checks: ["phi_protected"] };
let survival = kaplan_meier(diabetic_patients, event: "hospitalization");
plot_kaplan_meier(survival, title: "Diabetes Outcomes");

Quick Start

# Clone and build
git clone https://github.com/MediLang/medi.git
cd medi
cargo build --workspace

# Run tests
cargo test --workspace

# Try an example
cargo run -p medi_data --example clinical_data_exploration

Current Status

Component Status
Lexer / Parser / AST ✅ Done
Type System (inference, healthcare types, privacy annotations) ✅ Done
LLVM Backend (x86-64, WASM, RISC-V) ✅ Done
Memory Management (GC, borrow checker, real-time zones) ✅ Done
Standard Library (medi_data, medi_stats, medi_compliance, medi_ai) ✅ Done
Privacy/Compliance Checker (HIPAA, PHI flow analysis) ✅ Done
Basic IDE (syntax highlighting, code completion) ✅ Done
Example Use Cases ✅ Done
Documentation & Benchmarks 🔄 In Progress
CLI Compiler (medic) ✅ Done
REPL ✅ Done
Package Manager (medipack) ✅ Done
Python FFI ✅ Done

Project Structure

medi/
├── compiler/          # Rust compiler crates (medic_lexer, medic_parser, etc.)
├── stdlib/            # Standard library (medi_data, medi_stats, medi_compliance, medi_ai)
├── tests/             # Integration tests
├── examples/          # Example programs and use cases
└── docs/              # Documentation (MkDocs)

See docs/content/technical/file-structure.md for details.

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Focus areas: compiler development, standard library, IDE, RISC-V support, healthcare use cases.

License

MIT License. See LICENSE.

Community


Join us in revolutionizing healthcare analytics with Medi!

About

Domain-specific Programming Language to Empowering Healthcare with Secure, Fast, and Clinician-Friendly Analytics.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 5