CobGO Community Edition - Open Source COBOL Modernization
CobGO Community Edition is an open-source Domain Specific Language (DSL) and compiler for modernizing COBOL applications to Go. This edition provides the core compiler infrastructure, COBOL parser, and basic runtime support - everything you need to get started with COBOL modernization.
🚀 What’s Included
Core Compiler & Language Support
- ✅ COBOL Parser - Robust parsing of COBOL source code (COBOL-74 standard)
- ✅ DSL Language - Clean, modern syntax for COBOL modernization
- ✅ Intermediate Representation - Language-agnostic business logic representation
- ✅ Go Code Generation - Production-ready Go code with proper error handling
- ✅ Basic Runtime - COBOL-compatible data types and operations…
CobGO Community Edition - Open Source COBOL Modernization
CobGO Community Edition is an open-source Domain Specific Language (DSL) and compiler for modernizing COBOL applications to Go. This edition provides the core compiler infrastructure, COBOL parser, and basic runtime support - everything you need to get started with COBOL modernization.
🚀 What’s Included
Core Compiler & Language Support
- ✅ COBOL Parser - Robust parsing of COBOL source code (COBOL-74 standard)
- ✅ DSL Language - Clean, modern syntax for COBOL modernization
- ✅ Intermediate Representation - Language-agnostic business logic representation
- ✅ Go Code Generation - Production-ready Go code with proper error handling
- ✅ Basic Runtime - COBOL-compatible data types and operations
Developer Tools
- ✅ dslc - Main compiler (COBOL/CobGO → Go)
- ✅ dslfmt - Code formatter for consistent style
- ✅ dsllint - Static analyzer and linter
- ✅ copybook2dsl - COBOL copybook converter
COBOL Language Features
- ✅ All data types (COMP, DISPLAY, PACKED-DECIMAL)
- ✅ All PIC clauses (9, X, A, S, V, decimal positions)
- ✅ OCCURS (fixed tables)
- ✅ REDEFINES (data overlays)
- ✅ Group items and elementary items
- ✅ Level numbers (01-49, 77, 88)
- ✅ VALUE clauses
- ✅ Basic arithmetic operations (ADD, SUBTRACT, MULTIPLY, DIVIDE, COMPUTE)
- ✅ Control structures (IF-THEN-ELSE, EVALUATE, PERFORM)
- ✅ Sequential file I/O (OPEN, READ, WRITE, CLOSE)
📦 Installation
Prerequisites
- Go 1.21 or later
- Git
- Make (optional, PowerShell scripts provided for Windows)
Quick Start
# Clone the repository
git clone https://github.com/cobgo/cobgo-community.git
cd cobgo-community
# Install dependencies
go mod download
# Build all tools
make tools
# OR on Windows:
.\build.ps1
# Run tests
make test
🏃♂️ Basic Usage
Compile a COBOL Program
# Compile COBOL to Go
./bin/dslc examples/hello.cob -o hello.go
# Run the generated Go program
go run hello.go
Format DSL Code
./bin/dslfmt -i examples/hello.cobgo
Lint DSL Code
./bin/dsllint examples/hello.cobgo
Convert COBOL Copybook
./bin/copybook2dsl -i examples/customer.cpy -o customer.cobgo
📚 Documentation
- Setup Guide - Installation and configuration
- Architecture - System design and components
- Language Specification - DSL syntax and semantics
- API Reference - API documentation
- Migration Guide - COBOL to Go migration process
- Tutorials - Step-by-step guides
🏗️ Architecture
COBOL Source → Parser → IR → Code Generator → Go Source → Runtime
↓ ↓ ↓ ↓ ↓ ↓
.cob files AST IR Tree Go Code .go files Execution
Core Components
- Parser (
pkg/parser/): COBOL/DSL source code parsing and AST generation - IR (
pkg/ir/): Intermediate representation for language-agnostic processing - Code Generator (
pkg/codegen/): Go source code generation from IR - Runtime (
pkg/runtime/): Basic COBOL-compatible runtime libraries - Tools (
cmd/): Command-line utilities for development
🎯 Use Cases
Legacy System Modernization
- Convert existing COBOL applications to Go
- Improve maintainability with modern codebase
- Maintain business logic integrity
- Deploy to cloud platforms
Development Workflow
- Copybook conversion to DSL record definitions
- Consistent code style with automated formatting
- Quality analysis with linting tools
- Comprehensive testing support
🧪 Testing & Quality
CobGO includes comprehensive test suites to validate correctness and demonstrate quality:
Test Coverage
- ✅ ~85-90% code coverage across all packages
- ✅ ~85-90% passing on unit tests (core functionality verified)
- ✅ 100% passing on acceptance tests
- ✅ 100% passing on compliance tests
NIST COBOL-85 Validation
- ✅ 77.61% overall pass rate (305/393 tests)
- 🎉 3 perfect modules - SM, RL, IF (100% pass rate)
- ✅ 97.89% pass rate on NC module (Core COBOL) - 93/95 tests
- ✅ 96% pass rate on IC module (CALL statements) - 24/25 tests
- ✅ 88% pass rate on ST module (SORT) - 22/25 tests
- ✅ 82.76% pass rate on IX module (Indexed I/O) - 24/29 tests
Note: NIST test infrastructure included. Test programs must be obtained separately from NIST. See tests/nist85/README.md for details.
Running Tests
# Run all tests
go test ./...
# Run with coverage
go test ./... -cover
# Run specific test suites
go test ./tests/acceptance/... -v
go test ./tests/compliance/... -v
See tests/README.md for detailed test documentation and results.
📊 Performance
CobGO delivers significant performance improvements:
- 3-5x faster execution compared to legacy COBOL systems
- Efficient compilation - Fast code generation
- Modern Go runtime - Leverages Go’s performance optimizations
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details on how to:
- Report issues
- Submit pull requests
- Contribute to documentation
- Participate in discussions
Development Setup
- Fork the repository
- Clone your fork
- Create a feature branch
- Make your changes
- Run tests and ensure they pass
- Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🧪 Testing
CobGO Community Edition includes comprehensive test suites:
- Unit Tests: ~90%+ coverage across all packages
- Acceptance Tests: End-to-end COBOL → Go pipeline validation
- Compliance Tests: COBOL behavior validation
- NIST COBOL-85: Integration with official test suite
See tests/README.md for detailed test results and how to run them.
🆘 Support
- Documentation: Check the docs/ directory
- Tests: See tests/README.md for test documentation
- Issues: Report bugs and request features on GitHub Issues
- Discussions: Join the conversation on GitHub Discussions
🏢 Enterprise Edition
Looking for enterprise features? Check out CobGO Enterprise Edition which includes:
- 🔒 DB2 Integration - Full EXEC SQL support with parameterized queries
- 🏦 CICS Support - Transaction processing and terminal I/O
- 📊 Batch Processing - JCL parsing and job orchestration
- 🔐 Advanced Security - Encryption, audit trails, compliance frameworks
- 📋 Compliance Standards - SOX, PCI-DSS, GDPR, HIPAA, GLBA, Basel III
- 🛠️ Migration Tools - Assessment, planning, and professional services
Visit cobgo.com/enterprise for more information.
🙏 Acknowledgments
- The Go community for excellent tooling and ecosystem
- COBOL developers for maintaining critical business systems
- Open source contributors who make projects like this possible
CobGO Community Edition - Modernizing COBOL for the 21st century 🚀