BMB Package Manager with Rust Ecosystem Support
BMB 패키지 매니저. Rust 폴백 생태계를 지원하고 Rust→BMB 마이그레이션 도구를 제공합니다.
gotgan new <name>- 새 프로젝트 생성gotgan build- 프로젝트 빌드gotgan run- 빌드 및 실행gotgan test- 테스트 실행gotgan verify- 계약 검증 (BMB)gotgan publish- 패키지 배포gotgan add <name>- 의존성 추가
gotgan publish --local- 로컬 레지스트리에 패키지 게시gotgan add <name> --local- 로컬 레지스트리에서 패키지 설치- Semver 기반 버전 관리 (^, ~, >=, <=, >, <, =, *)
- 오프라인 패키지 캐싱
- Cargo 호환: Rust crates를 의존성으로 사용 가능
- FFI 자동 생성: Rust 라이브러리 바인딩 자동 생성
- 혼합 프로젝트: BMB + Rust 코드 동시 사용
gotgan migrate <crate>- Rust crate를 BMB로 변환- 점진적 마이그레이션: 함수 단위로 순차 변환
- 계약 추론: Rust 코드에서 pre/post 조건 추론
# From source (requires Rust)
cargo install gotgan
# Pre-built binary (planned)
curl -sSf https://bmb-lang.org/gotgan/install.sh | sh# Create new project
gotgan new hello
cd hello
# Build and run
gotgan runhello/
├── gotgan.toml # Project manifest
├── src/
│ └── main.bmb # Entry point
└── tests/
└── test_main.bmb # Tests
[package]
name = "hello"
version = "0.1.0"
edition = "2025"
[dependencies]
# BMB packages
json = "0.1"
# Go-style git dependencies (v0.60.250+)
[dependencies.bmb-hash]
git = "github.com/lang-bmb/gotgan-packages"
tag = "v0.1.0"
# path in repo: packages/bmb-hash
# Branch or commit
[dependencies.mylib]
git = "github.com/user/repo"
branch = "main" # or: tag = "v1.0.0", rev = "abc123"
# Rust fallback (crates.io) - planned
[dependencies.rust]
serde = "1.0"
tokio = { version = "1", features = ["full"] }
[dev-dependencies]
test-utils = "0.1"No central registry needed. Dependencies are fetched directly from git repositories.
# gotgan.toml
[dependencies.bmb-json]
git = "github.com/lang-bmb/gotgan-packages"
tag = "v0.1.0"Cache location: ~/.gotgan/cache/[email protected]/
| Option | Description | Example |
|---|---|---|
git |
Repository URL (Go-style) | "github.com/user/repo" |
tag |
Git tag (recommended for releases) | "v1.0.0" |
branch |
Git branch | "main" |
rev |
Git commit hash | "abc1234" |
# Publish package to local registry (~/.gotgan/registry/)
gotgan publish --local
# Add dependency from local registry
gotgan add bmb-json --local
# Add specific version
gotgan add bmb-json --local --version "^1.0"Registry structure:
~/.gotgan/
├── registry/
│ ├── bmb-json/
│ │ ├── 1.0.0/
│ │ │ ├── gotgan.toml
│ │ │ └── src/
│ │ └── index.json
│ └── ...
└── cache/
# gotgan.toml
[dependencies.rust]
regex = "1.10"-- main.bmb
use rust::regex::Regex;
fn match_email(s: &str) -> bool =
Regex::new(r"^\S+@\S+\.\S+$").unwrap().is_match(s);
# Analyze Rust crate for migration
gotgan migrate --analyze my_crate
# Generate BMB skeleton with inferred contracts
gotgan migrate --generate my_crate
# Verify migrated code
gotgan verify src/| Version | Features | Status |
|---|---|---|
| v0.1 | Project structure, build, run | ✅ 완료 |
| v0.2 | Local dependencies, lock file | ✅ 완료 |
| v0.3 | Local registry, publish, search | ✅ 완료 |
| v0.4 | Rust fallback ecosystem | 계획 |
| v0.5 | Migration tools | 계획 |
| v1.0 | Full feature set, BMB rewrite | 계획 |
# Build
cargo build
# Test
cargo test
# Run locally
cargo run -- new test-projectMIT License