حول
Incan: a modern, Pythonic language that compiles to Rust! Type-safe, async-friendly, with fixtures, testing, and web/inter-op built in.
لغات البرمجة وبيئات التشغيلالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- ٠
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصل
Python-like readability. Rust-native performance.
Website · Docs · Install · The Book · Discussions · LinkedIn
Incan is a statically typed language for writing clear, high-level application code that compiles to native code through the Rust compiler. It aims to feel lightweight and expressive while keeping the things that matter in large codebases explicit: types, errors, and mutability.
The current toolchain is designed to be easy to install, try, inspect, and diagnose without cloning the compiler repository first.
Getting started
To use Incan 0.6, get the incan executable and toolchain.tar.zst archive from the same build for your host. For a published release, download the matching toolchain.tar.zst.sigstore.json and keep it beside the archive. Put the downloaded incan first on PATH before installing the toolchain.
rustup toolchain install 1.98.0 --profile minimal --component rustc-dev
incan toolchain install ./toolchain.tar.zst
export PATH="${INCAN_HOME:-$HOME/.incan}/bin:$PATH"
incan --version
For host prerequisites, installation in a separate INCAN_HOME, and development checkout setup, see Install and run Incan.
Create loaf.toml, src/main.incn and tests/test_main.incn as the Getting started tutorial shows, then check, run, test and build the project. Every command takes an explicit path:
incan check src/main.incn
incan run src/main.incn
incan test tests/test_main.incn
incan build src/main.incn --profile release
Tooling and inspection
The current toolchain includes these public surfaces for installation, first contact, diagnostics, and inspection:
- Toolchain installation through a host-specific archive and the pinned Rust compiler.
- Project loop through
incan check,incan run,incan test, andincan build, each with an explicit path.ovenruns the same project operations. - Stable diagnostics through
incan check --format jsonandincan explain <CODE>. - Build inputs and reuse through
oven describe-unit PATH, which reports the selected compilation inputs, andOVEN_TRACE=-, which reports executable reuse decisions. - Codegraph export through
incan inspect codegraph --format jsonl, with compiler-backed files, modules, declarations, imports, exports, references, calls, diagnostics, spans, provenance, and degraded-state records. - Boundary parity hardening across local, imported, re-exported, package, test-batch, and vocab/tooling paths.
Read the CLI reference for detailed command contracts, or the 0.6 release notes for release-specific change history.
These examples show the inspection commands most useful when evaluating a project:
incan check src/main.incn --format json
incan explain INCAN-T0001
oven describe-unit src/main.incn
incan inspect codegraph src --format jsonl
Positioning
Python won because it made application code readable and fast to write. Incan starts from that same readability premise, but changes the foundation: static types, explicit errors, explicit mutability, and Rust-native compilation.
Incan is not a Python compatibility runtime or a faster Python interpreter. It is for new application code where teams want Python-like ergonomics without Python's runtime, packaging, and deployment tradeoffs.
As AI tools generate more code, those constraints matter more. Incan gives developers and agents a smaller, typed, auditable language surface that compiles into the Rust ecosystem.
Why Incan?
- Readable by default: concise syntax for modeling data and writing “glue code” without ceremony.
- Explicit error handling:
Result,Option, and?keep failure paths visible and reviewable. - Strong domain types:
newtypeandmodelmake invariants and intent first-class. - Deterministic composition: traits are for behavior contracts and predictable composition.
- Rust interop when you need it: call into Rust crates for ecosystems and performance-sensitive utilities.
- Native performance: the compiler builds a native binary through the pinned Rust compiler.
Who is this for?
- If you like the readability of Python but want stronger correctness tools and predictable performance, Incan is aimed at that workflow.
- If you like Rust but want a smaller surface syntax for everyday application code, Incan is built to stay close to Rust semantics while reducing boilerplate.
- If you like TypeScript or JavaScript tooling but want native binaries and Rust-backed execution for application code, Incan should feel familiar in its focus on typed APIs, editor feedback, and installable command-line tooling.
Choose your path
- Coming from Python: compare Python app patterns to typed Incan models,
Result/Option, traits, and tests. - Coming from Rust: see how Incan handles errors, Rust interop, diagnostics, and native builds.
- Coming from TypeScript or JavaScript: compare typed app workflows, editor tooling, and native artifact inspection.
Status
⚠️ Beta Software ⚠️
Incan is in active development. The language, compiler, and APIs may still change, although we will try to keep it stable as much as possible.
Feedback and contributions are of course welcome!
Docs policy: Stability policy
A small example
enum AppError:
InvalidInput(str)
type Email = newtype str:
def from_str(v: str) -> Result[Email, AppError]:
if "@" not in v:
return Err(AppError.InvalidInput("missing @"))
return Ok(Email(v.lower()))
@derive(Debug, Eq, Clone)
model User:
id: int
email: Email
is_active: bool = true
trait Loggable:
def log(self, msg: str) -> None:
println(f"[{self.name}] {msg}")
class UserService with Loggable:
name: str
users: Dict[int, User]
def create(mut self, email_str: str) -> Result[User, AppError]:
email = Email.from_str(email_str)?
user = User(id=len(self.users) + 1, email=email)
self.users[user.id] = user
self.log(f"created user {user.id}")
return Ok(user)
Documentation
The docs site is published at incan.io; its source lives in workspaces/docs-site/.
Build/serve locally:
make docs
make -C workspaces/docs-site docs-serve
Performance
Incan compiles to a native binary through the Rust compiler, so Rust is the meaningful reference point: on these workloads Incan runs within roughly 20% of hand-written Rust, and matches or beats it on some. Python is included for scale, not as the target.
- Benchmarks:
workspaces/benchmarks/ - Results:
workspaces/benchmarks/results/results.md
| Benchmark | Incan | Rust | Python | Incan vs Rust |
|---|---|---|---|---|
| Fibonacci (1M iterations) | 3ms | 4ms | 42ms | ~1× |
| Collatz (1M numbers) | 94ms | 92ms | 4,209ms | 1.02× |
| GCD (10M pairs) | 92ms | 84ms | 819ms | 1.10× |
| Mandelbrot (2K×2K) | 113ms | 113ms | 4,655ms | 1.00× |
| N-Body (500K steps) | 20ms | 17ms | 1,507ms | 1.18× |
| Prime Sieve (50M) | 141ms | 124ms | 3,163ms | 1.14× |
| Quicksort (1M elements) | 56ms | 48ms | 1,000ms | 1.17× |
| Mergesort (1M elements) | 83ms | 130ms | 1,300ms | 0.64× |
A ratio below 1.00× means Incan is faster than the hand-written Rust implementation of the same algorithm; Mergesort is the clear case. Fibonacci runs in single-digit milliseconds, where a one-millisecond difference is measurement noise rather than a meaningful gap, so it is reported as approximately even.
Benchmark details:
- Machine: Apple Silicon (results may vary)
- Incan/Rust: Release builds with optimizations
- Python: CPython 3.14
- Methodology: hyperfine with warmup runs
- Reproduce:
make benchmarks(addSKIP_PYTHON=truefor Incan vs Rust only)
Community
- LinkedIn group: Incan Programming Language Community
- GitHub Discussions: Ask questions and share what you're building
Contributing
Contributions are welcome—docs, compiler, tooling, stdlib, and RFC work.
- Contributor docs
- Repo guidelines: CONTRIBUTING.md
License
Apache 2.0
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…