aclang
v1.0.0
Published
AC Language - Multi-Backend Compiler for Modern Development. Write once, compile to 10+ target languages including C, C++, JavaScript, Python, Rust, Go, V, Java, HTML, and CSS.
Maintainers
Readme
AC Language - Multi-Backend Compiler
Write once, compile everywhere. AC Language is a revolutionary multi-backend compiler that lets you write code once and compile it to 10+ different target languages and platforms.
🚀 Quick Start
# Install globally
npm install -g aclang
# Create your first AC program
echo '<mainloop>
AC->JS
<LOGIC>
message = $Hello, AC Language!$
display message
<LOGIC>
<mainloop>' > hello.ac
# Compile and run
ac compile hello.ac --backend js --output hello.js
node hello.js🎯 Supported Backends
| Backend | Performance | Use Case | Status | |---------|-------------|----------|--------| | Binary (x86-64) | 21.20ms ⚡ | Native performance | ✅ | | Go | 22.85ms ⚡ | Concurrent systems | ✅ | | V | 28.51ms ⚡ | Modern, minimal | ✅ | | C++ | 29.80ms ⚡ | System programming | ✅ | | Rust | 37.32ms ⚡ | Memory-safe systems | ✅ | | JavaScript | 136.72ms | Web & Node.js | ✅ | | Python | 148.34ms | Rapid development | ✅ | | Java | 283.37ms | Enterprise apps | ✅ | | HTML5 | - | Web interfaces | ✅ | | CSS | - | Styling | ✅ |
Performance benchmarks based on trimmed mean of 7 runs, outliers removed.
📦 Installation
NPM (Recommended)
npm install -g aclangFrom Source
git clone https://github.com/ac-language/ac-core.git
cd ac-core
npm install && npm run build
npm linkBackend Compilers
# Install backend compilers automatically
ac install-backends
# Or install manually:
# - C/C++: GCC or MinGW
# - Rust: https://rustup.rs/
# - Go: https://golang.org/dl/
# - Java: JDK 8+
# - V: https://vlang.io/🔧 CLI Usage
# Compile to different backends
ac compile program.ac --backend js --output program.js
ac compile program.ac --backend cpp --output program.cpp
ac compile program.ac --backend rs --output program.rs
# Compile and run immediately
ac run program.ac --backend js
ac run program.ac --backend go
# List available backends
ac backends
# Show help
ac help📝 AC Language Syntax
Basic Structure
<mainloop>
AC->JS *target backend*
<LOGIC>
*your code here*
<LOGIC>
<mainloop>Variables and Arithmetic
<LOGIC>
value1 = 45.230
value2 = 12.500
sum = value1 + value2
display sum
<LOGIC>Control Flow
<LOGIC>
IF sum > 50
display $Large sum$
OTHER
display $Small sum$
<LOGIC>Objects and Methods
<OBJECT>
Obj.Calculator
Calculator.add(value1, value2)
Calculator.display()
<OBJECT>🏗️ Key Features
⚡ High Performance
- Native machine code generation
- Optimized compilation pipeline
- Minimal runtime overhead
🎯 Multi-Backend
- Single codebase, multiple targets
- Consistent behavior across platforms
- Easy deployment anywhere
🔒 Type Safety
- Compile-time error detection
- String-number exact arithmetic
- Memory-safe operations
📦 Zero Dependencies
- Standalone executables
- No runtime requirements
- Minimal footprint
🌐 Universal Deployment
- Web applications (HTML/CSS/JS)
- Desktop applications (C/C++/Rust)
- Server applications (Go/Java)
- Scripts (Python/JavaScript)
📊 Performance Benchmarks
Based on comprehensive testing with outlier removal:
🥇 Binary/C: 21.20ms (100% - fastest)
🥈 Go: 22.85ms (92.8%)
🥉 V: 28.51ms (74.4%)
C++: 29.80ms (71.1%)
Rust: 37.32ms (56.8%)
JavaScript: 136.72ms (15.5%)
Python: 148.34ms (14.3%)
Java: 283.37ms (7.5% - JVM overhead)🛠️ Development
# Clone repository
git clone https://github.com/ac-language/ac-core.git
cd ac-core
# Install dependencies
npm install
# Build project
npm run build
# Run tests
npm test
# Run with coverage
npm run test:coverage
# Development mode
npm run dev📚 Documentation
- Language Reference - Complete syntax guide
- CLI Tools - Backend-specific compilation
- Installation Guide - Detailed setup instructions
- Examples - Real-world AC programs
- Performance Report - Benchmark results
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🌟 Why AC Language?
Traditional Approach
Write C++ → Compile to binary
Write JavaScript → Run in browser
Write Python → Run with interpreter
Write Java → Compile to bytecodeAC Language Approach
Write AC → Compile to C++, JS, Python, Java, and 6+ more!One language. Infinite possibilities.
🔗 Links
Made with ❤️ by the AC Language Team
