dist_agent_lang
A hybrid compiled programming language for AI agents, blockchain, and distributed systems
๐ PUBLIC DOCUMENTATION
โก๏ธ Complete Documentation (AI/LLM Ready)
Quick Links:
- Installation
- Getting Started
- Standard Library Reference
- Package Management
- CLI Commands
- Examples & Tutorials
- Integration
Optimized for both developers and AI assistants.
โ ๏ธ Beta Release Notice
Current Version: v1.0.5 (Beta Release) โ Actively Developed
dist_agent_lang is an actively maintained beta release with consistent updates and improvements. The language includes extensive security features, comprehensive documentation, and has passed all tests (140+ passing).
๐ Beta Testing Contributions Appreciated!
We welcome feedback, bug reports, and contributions from the developer community to help us reach production readiness (v1.1.0+).
โ Safe For:
- Development & Prototyping - Building and testing applications
- Learning & Experimentation - Educational purposes and learning
- Non-Critical Applications - Applications not handling significant value
- Testing & Validation - Validating concepts and workflows
- Beta Testing - Help us improve with your feedback!
โ ๏ธ Use With Caution For:
- Production Financial Applications - Applications handling real money (wait for v1.1.0+)
- High-Value Smart Contracts - Contracts managing significant assets (third-party audit recommended)
- Critical Infrastructure - Systems requiring high reliability (additional validation needed)
- Sensitive Data Applications - Additional security audits strongly recommended
๐ Security Features (v1.0.5):
- โ Reentrancy protection
- โ Safe math (overflow/underflow protection)
- โ State isolation
- โ Cross-chain security
- โ Oracle security (signed feeds, multi-source validation)
- โ Transaction atomicity (ACID guarantees)
- โ Enhanced security logging with source tracking
- โ 140+ tests passing (100%)
- โ Zero compilation errors
- โ Dependency security audit passed (0 vulnerabilities)
๐ What's New in v1.0.5:
- Enhanced Log Functions - Optional source parameter for all log functions (info, warning, error, debug, audit)
- HTTP Timeout Standardization - Standardized to 30000ms (30 seconds) for consistency with HTTP libraries
- Comprehensive Security Integration Tests - End-to-end security workflow tests using actual DAL language code
- Improved Logging - Custom source identifiers for better log filtering and debugging
- Enhanced Testing - 140+ tests covering all standard library modules
๐ Active Development:
This project receives consistent updates with improvements to security, performance, documentation, and features. We're working toward v1.1.0 (production release) with third-party security audits, real-world validation, and community feedback.
Target for Production (v1.1.0+): ~14 weeks with community validation
๐ Recommendations:
- For Production Use: Wait for v1.1.0+ with third-party security audit and real-world validation
- For Critical Applications: Conduct independent security audit before deployment
- For Financial Applications: Additional formal verification strongly recommended
- Always: Test thoroughly in development/testnet environments first
- Join Beta Testing: Help us improve by testing and providing feedback!
๐ค How to Contribute to Beta:
- ๐งช Testing - Use the language, run examples, report bugs (no coding required!)
- ๐ Documentation - Improve docs, write tutorials, fix typos
- ๐ป Code - Fix bugs, implement features, add tests
- ๐ก Ideas - Share use cases, suggest improvements, join discussions
๐ New to contributing? Check out GOOD_FIRST_ISSUES.md for beginner-friendly tasks!
๐ Full Guide: See CONTRIBUTING.md for detailed contribution guidelines.
We value your feedback and contributions as we work toward production readiness!
๐ Features
๐ค AI Agent Framework
- Multi-Agent Coordination: Create and orchestrate AI agents with built-in coordination
- Workflow Management: Define complex workflows with step dependencies
- Task Execution: Distributed task processing with status tracking
- Memory Management: Persistent agent memory and context awareness
- Communication Protocols: Inter-agent messaging and event-driven communication
โ๏ธ Blockchain Integration
- Multi-Chain Support: Ethereum, Polygon, Binance, Solana, Avalanche, Arbitrum, Optimism
- Smart Contract Development: Native smart contract creation and deployment
- Cross-Chain Operations: Seamless asset transfers across different blockchains
- Oracle Integration: Real-world data feeds and external API connectivity
- Gas Optimization: Chain-specific gas estimation and transaction management
๐ Security & Compliance
- KYC/AML Integration: Built-in Know Your Customer and Anti-Money Laundering checks
- Trust Model System: Configurable trust levels and security profiles
- Audit Trails: Comprehensive logging and compliance tracking
- Capability-Based Security: Fine-grained permission system
- Cryptographic Operations: AES-256, SHA-256, ECDSA, multi-signature support
๐ฏ Multi-Target Compilation
- Blockchain: Smart contract compilation for multiple chains
- WebAssembly: Web-based applications and browser integration
- Native: High-performance desktop applications
- Mobile: iOS and Android app development
- Edge: IoT and edge computing devices
๐ Documentation
Getting Started (5 minutes)
- Quick Start Guide - Get up and running in 5 minutes
- Installation Guide - Detailed installation instructions
- Your First Contract - Build and deploy your first smart contract
Production Deployment
- Deployment Guide - Complete production deployment guide
- Docker Deployment - Containerized deployment
- CI/CD Integration - Automated deployment pipelines
Developer Guides
- Best Practices - Security, performance, and code organization
- API Reference - Complete standard library documentation (22 modules)
- Testing Guide - Comprehensive testing strategies
Tutorials
- Tutorial 1: DeFi Token - Build a token with oracle integration
- Tutorial 2: AI Trading Agent - Build an AI-powered trading bot
- Tutorial 3: NFT Marketplace - Complete NFT marketplace
- Tutorial 4: Cross-Chain Bridge - Multi-chain operations
- More Tutorials... - Real-world examples
AI Features
- AI Features Guide - Complete AI capabilities overview
- AI Best Practices - Security and optimization for AI
- AI+Blockchain Integration - Combine AI with DeFi, NFTs, and more
- AI API Reference - Complete AI API documentation
CloudAdmin & Hybrid Trust
- CloudAdmin Guide - Hybrid trust and admin control architecture
- Hybrid Marketplace Tutorial - Build moderated marketplace
- CloudAdmin API Reference - Complete CloudAdmin API
- Process Management - Admin process control
Migration Guides
- From Solidity - Migrate Solidity contracts to DAL
- From Rust - Migrate Rust contracts
- From Move - Migrate Move contracts
Architecture & Reference
- Language Reference - Complete language specification
- Architecture Overview - System architecture
- Phase 3 Plan - Current development phase
- Production Roadmap - Journey to v1.1.0
๐ฆ Installation
Prerequisites
- Rust 1.70+ (Install Rust)
- Node.js 18+ (for build scripts)
Quick Install
From crates.io (recommended):
From source:
From release binary: Download from GitHub Releases and extract the binary to your PATH.
๐ฎ Quick Start
Hello World
// hello_world.dal
@trust
@chain
service HelloWorld
AI Agent Example
// ai_agent_example.dal
@trust
@ai
@chain
service AIAgentDemo
Smart Contract Example
// smart_contract_example.dal
@trust
@secure
@chain
service TokenContract
// Create and use service instances
let token = new;
token.initialize;
// Alternative instantiation syntax
let token2 = new;
token2.initialize;
// Call methods on instances
token.transfer;
๐ Documentation
Getting Started
- Installation Guide - Step-by-step installation instructions
- Usage Guide - Quick start and common commands
- Comprehensive Documentation - Complete language overview
Tutorials
- Complete Tutorial Series - 12 comprehensive tutorials from beginner to advanced
- Tutorial 1: Getting Started
- Tutorial 2: AI Agents
- Tutorial 3: Blockchain Integration
- Tutorial 4: Multi-Chain Operations
- Tutorial 5: Security & Compliance
- Tutorial 6: AI Integration
- Tutorial 7: Database Operations
- Tutorial 8: Web API Operations
- Tutorial 9: Compliance Features
- Tutorial 10: Error Handling
- Tutorial 11: Performance Optimization
- Tutorial 12: Testing & Debugging
Reference Documentation
- API Reference - Complete standard library API
- Language Syntax - Syntax reference guide
- Attributes Reference - All available attributes
- Usage Guide - Detailed usage instructions
- Configuration Guide - Configuration management
Feature Guides
- KYC/AML Features - Compliance features guide
- Oracle Development - Oracle integration guide
- XNFT & Dynamic RWA Guide - NFT and RWA tokenization
Examples
- Example Programs - 27+ example programs demonstrating features
๐ ๏ธ Development
Building from Source
# Build in debug mode
# Build in release mode
# Run tests
# Run benchmarks
Project Structure
dist_agent_lang/
โโโ src/
โ โโโ lexer/ # Lexical analysis
โ โโโ parser/ # Syntax parsing
โ โโโ runtime/ # Runtime environment
โ โโโ stdlib/ # Standard library modules
โ โโโ testing/ # Testing framework
โ โโโ performance/ # Performance optimization
โโโ examples/ # Example code
โโโ docs/ # Documentation
โโโ scripts/ # Build and deployment scripts
โโโ templates/ # Code generation templates
โโโ tests/ # Test suites
๐งช Examples
The project includes 11 comprehensive examples:
- AI Agent System Demo - Multi-agent coordination and workflow management
- Backend Connectivity Patterns - Database and API integration patterns
- Chain Selection Example - Multi-chain interaction and selection
- Cross-Chain Patterns - Asset management across different blockchains
- DeFi NFT RWA Contract - Real World Asset tokenization (Arbitrum)
- Dynamic NFT Examples - Dynamic NFTs with real-world data (Ethereum)
- Dynamic RWA Examples - Real World Asset tokenization (Ethereum)
- Enhanced Language Features - Advanced language capabilities
- General Purpose Demo - General programming examples
- Integrated Spawn AI Examples - Spawn and AI agent integration
- KEYS Token Implementation - Complete token system (Ethereum)
๐งช Testing
DAL uses a three-layer testing strategy for comprehensive validation:
Layer 1: Rust Unit Tests (Syntax Validation)
Fast syntax and parse-time validation for all DAL code:
Layer 2: Semantic Validators (Attribute & Type Validation)
Validation helpers for semantic correctness:
// Used within tests for semantic validation
expect_valid_trust_model;
expect_valid_chain;
expect_compatible_attributes;
expect_type;
expect_in_range;
Layer 3: DAL Test Files (Runtime Behavior)
Hardhat-style testing framework for DAL (.test.dal files):
# Run all DAL test files
# Run specific test file
Example DAL test:
describe("TokenContract", fn() {
let contract;
beforeEach(fn() {
contract = deploy_service("TokenContract", {});
});
it("should transfer tokens", fn() {
contract.transfer("bob", 100.0);
expect(contract.balance_of("bob")).to_equal(100.0);
});
});
Testing Documentation
For complete testing guides:
docs/THREE_LAYER_TESTING.md- Complete strategy overviewdocs/guides/TESTING_GUIDE.md- Comprehensive testing guidedocs/TESTING_ATTRIBUTES.md- Attribute testing deep divedocs/WHY_RUST_UNIT_TESTS.md- Rationale for Rust tests
๐ง Configuration
Environment Variables
# Blockchain configuration
DIST_AGENT_RPC_URL_ETHEREUM=https://mainnet.infura.io/v3/YOUR_KEY
DIST_AGENT_RPC_URL_POLYGON=https://polygon-rpc.com
DIST_AGENT_PRIVATE_KEY=your_private_key
# AI configuration
DIST_AGENT_AI_API_KEY=your_openai_key
DIST_AGENT_AI_MODEL=gpt-4
# Database configuration
DIST_AGENT_DB_URL=postgresql://user:pass@localhost/db
Configuration File
# config.toml
[]
= "https://mainnet.infura.io/v3/YOUR_KEY"
= "https://polygon-rpc.com"
= "your_private_key"
[]
= "your_openai_key"
= "gpt-4"
= 4096
[]
= "postgresql://user:pass@localhost/db"
= 10
๐ค Contributing
Contributors Welcome! ๐ We're actively seeking help to improve and test dist_agent_lang. Every contribution, no matter how small, helps!
๐ Quick Start Contributing
No coding required? You can still help!
- ๐งช Test the language - Run examples, report bugs
- ๐ Improve documentation - Fix typos, clarify instructions
- ๐ก Share feedback - Tell us what works and what doesn't
Ready to code? Great!
- ๐ข Beginners: Check out GOOD_FIRST_ISSUES.md
- ๐ Full Guide: See CONTRIBUTING.md
- ๐ง Specific Tasks: See CODEBASE_TODOS.md
Development Setup
# Fork and clone
# Install dependencies
# Run tests
# Format code
# Check for issues
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Support
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: jason.dinh.developer@gmail.com
๐ Acknowledgments
- Rust community for the excellent language and ecosystem
- Ethereum community for blockchain standards and tools
- AI/ML community for inspiration and best practices
- Open source contributors who made this project possible
Made with โค๏ธ by OK Jason