{"id":40474505,"url":"https://github.com/webcien/u-lang","last_synced_at":"2026-01-20T18:22:13.919Z","repository":{"id":329077008,"uuid":"1117954899","full_name":"webcien/u-lang","owner":"webcien","description":"U is a Modern, Safe, and Lightweight systems programming language ","archived":false,"fork":false,"pushed_at":"2025-12-17T19:39:46.000Z","size":54322,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-20T19:53:15.979Z","etag":null,"topics":["programming-language"],"latest_commit_sha":null,"homepage":"https://github.com/webcien/u-lang","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webcien.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-17T04:00:29.000Z","updated_at":"2025-12-18T06:52:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/webcien/u-lang","commit_stats":null,"previous_names":["webcien/u-lang"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/webcien/u-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webcien%2Fu-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webcien%2Fu-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webcien%2Fu-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webcien%2Fu-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webcien","download_url":"https://codeload.github.com/webcien/u-lang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webcien%2Fu-lang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28608959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["programming-language"],"created_at":"2026-01-20T18:22:09.839Z","updated_at":"2026-01-20T18:22:12.680Z","avatar_url":"https://github.com/webcien.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# U Language\n\n**Modern, Safe, and Lightweight Systems Programming Language**\n\n[![Version](https://img.shields.io/badge/version-1.6.0-blue.svg)](https://github.com/webcien/u-lang/releases/tag/v1.6.0)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n[![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://github.com/webcien/u-lang)\n\n---\n\n## 🚀 What is U?\n\nU is a **systems programming language** that combines the best features of modern languages while maintaining simplicity and performance. It offers:\n\n- **Memory Safety** through a complete ownership system (like Rust, but simpler)\n- **Native GUI** with a declarative DSL (like Flutter/SwiftUI)\n- **Actor-based Concurrency** without data races (like Erlang/Pony)\n- **Modern Package Manager** for ecosystem growth (like Cargo)\n- **Full Generics Support** with monomorphization and trait bounds\n- **IDE Integration** via Language Server Protocol (LSP) and VS Code extension\n- **Cross-Platform** compilation to Linux, Windows, macOS, and WebAssembly\n\nU compiles to **clean C code** and uses **Zig** as a cross-compilation backend, resulting in:\n- ⚡ **Zero runtime overhead**\n- 🎯 **Predictable performance**\n- 📦 **Tiny binaries** (no runtime, no GC)\n- 🌍 **True cross-platform** support\n\n---\n\n## ✨ Key Features\n\n### 1. Complete Ownership System\n\nU implements a **7-rule ownership system** that guarantees memory safety without garbage collection:\n\n```u\n// Explicit deep copies with .clone()\nlet s1 = \"hello\";\nlet s2 = s1.clone(); // s2 is independent\n\n// Multiple immutable references\nlet v = Vec_new\u003ci32\u003e();\nlet r1 = \u0026v; // Immutable borrow\nlet r2 = \u0026v; // OK: Multiple immutable borrows allowed\n\n// Compile-time error on use-after-move\nlet x = Vec_new\u003ci32\u003e();\nlet y = x;  // x is moved\n// let z = x;  // ERROR: use of moved value\n```\n\n**No explicit lifetimes. No borrow checker complexity. Just simple, safe code.**\n\n### 2. Declarative GUI DSL\n\nBuild native user interfaces with a clean, declarative syntax:\n\n```u\nui my_app {\n    Container {\n        width: 600,\n        height: 400,\n        background: rgb(230, 240, 255),\n        child: Column {\n            children: [\n                Text { text: \"Hello, U Language!\", size: 24 },\n                Button { \n                    text: \"Click Me\", \n                    onClick: handle_click \n                },\n                TextField { placeholder: \"Enter text...\" }\n            ]\n        }\n    }\n}\n```\n\n**Compiles to Skia rendering calls. Runs on desktop and mobile.**\n\n### 3. Actor-Based Concurrency\n\nSafe, scalable concurrency without locks or data races:\n\n```u\nactor Counter {\n    let mut count: i32 = 0;\n    \n    fn increment() {\n        count = count + 1;\n    }\n    \n    fn get_count() -\u003e i32 {\n        return count;\n    }\n}\n\nfn main() {\n    let counter = spawn Counter;\n    send counter.increment();\n    let result = await counter.get_count();\n    return 0;\n}\n```\n\n**Micro-runtime of only 5.3 KB. Zero overhead message passing.**\n\n### 4. Modern Package Manager\n\nManage dependencies with a Cargo-like package manager:\n\n```bash\n# Create a new package\nul init my-package\n\n# Install dependencies\nul install u-std\n\n# Build your project\nul build --release\n\n# Publish to registry\nul publish\n```\n\n**Package manifest (`ul.toml`):**\n```toml\n[package]\nname = \"my-package\"\nversion = \"1.0.0\"\n\n[dependencies]\nu-std = \"1.0.0\"\nu-gui = { version = \"1.3.0\", features = [\"skia\"] }\n```\n\n### 5. Full Generics Support\n\nWrite generic code that works with any type:\n\n```u\n// Generic function with trait bound\nfn print_clonable\u003cT: Clone\u003e(value: T) {\n    let cloned = value.clone();\n    unsafe { printf(\"Cloned!\\n\"); }\n}\n\n// Generic struct\ntype Point\u003cT\u003e {\n    x: T,\n    y: T,\n}\n\nfn main() {\n    let p1 = Point\u003ci32\u003e { x: 10, y: 20 };\n    let p2 = Point\u003cf64\u003e { x: 1.0, y: 2.0 };\n    print_clonable(p1);\n}\n```\n\n**Monomorphization generates specialized code for each concrete type at compile time.**\n\n### 6. IDE Integration (LSP + VS Code)\n\nFirst-class editor support with the U Language Server:\n\n```bash\n# Install the Language Server\ncd lsp\ncargo build --release\n\n# Install VS Code extension\ncd editors/vscode\nnpm install\nnpm run compile\ncode --install-extension u-language-1.4.0.vsix\n```\n\n**Features:**\n- ✅ Autocompletion\n- ✅ Go to definition\n- ✅ Hover information\n- ✅ Real-time diagnostics\n- ✅ Syntax highlighting\n\n### 7. Cross-Platform Compilation\n\nCompile to any platform from any platform using Zig:\n\n```bash\n# Compile for Linux\nul build --target x86_64-linux\n\n# Compile for Windows\nul build --target x86_64-windows\n\n# Compile for macOS\nul build --target x86_64-macos\n\n# Compile for WebAssembly\nul build --target wasm32-wasi\n```\n\n---\n\n## 📦 Installation\n\n### Prerequisites\n\n- **Rust** (for building the compiler)\n- **Zig** (for cross-compilation)\n- **Git**\n\n### Build from Source\n\n```bash\ngit clone https://github.com/webcien/u-lang.git\ncd u-lang/compiler\ncargo build --release\n```\n\nThe compiler binary will be at `target/release/ul`.\n\n### Add to PATH\n\n```bash\nexport PATH=\"$PATH:/path/to/u-lang/compiler/target/release\"\n```\n\n---\n\n## 🎯 Quick Start\n\n### Hello World\n\nCreate `hello.ul`:\n\n```u\nfn main() {\n    unsafe {\n        printf(\"Hello, U Language!\\n\");\n    }\n    return 0;\n}\n\nextern \"C\" {\n    fn printf(format: ptr, ...);\n}\n```\n\nCompile and run:\n\n```bash\nul build hello.ul\n./hello\n```\n\n### GUI Application\n\nCreate `gui_app.ul`:\n\n```u\nui my_window {\n    Container {\n        width: 400,\n        height: 300,\n        background: rgb(255, 255, 255),\n        child: Text {\n            text: \"Hello, GUI!\",\n            size: 24,\n            color: rgb(0, 0, 0)\n        }\n    }\n}\n\nfn main() {\n    unsafe {\n        skia_init();\n        let surface = skia_create_surface(400, 300);\n        let canvas = skia_get_canvas(surface);\n        render_ui_my_window(canvas);\n        skia_save_png(surface, \"output.png\");\n    }\n    return 0;\n}\n```\n\nCompile:\n\n```bash\nul build gui_app.ul\n```\n\n---\n\n## 📚 Documentation\n\n- **[Language Guide](docs/)** - Complete language reference\n- **[Standard Library](stdlib/)** - API documentation\n- **[ul.toml Specification](docs/UL_TOML_SPEC.md)** - Package manifest format\n- **[Examples](examples/)** - Sample programs\n\n---\n\n## 🏗️ Project Structure\n\n```\nu-lang/\n├── compiler/          # U Language compiler (Rust)\n│   └── src/\n│       ├── lexer.rs           # Tokenization\n│       ├── parser.rs          # AST generation\n│       ├── type_checker.rs    # Type validation\n│       ├── ownership_checker.rs  # Ownership validation\n│       ├── concurrency_checker.rs # Concurrency validation\n│       ├── optimizer.rs       # Code optimization\n│       ├── package_manager.rs # Package management\n│       └── codegen/\n│           └── c.rs           # C code generation\n├── runtime/           # Runtime libraries (C)\n│   ├── actor_runtime.c     # Actor system (5.3 KB)\n│   ├── event_loop_sdl2.c   # Event loop\n│   ├── layout.c            # Flexbox layout\n│   └── skia_real.c         # Skia integration\n├── stdlib/            # Standard library (U)\n│   ├── clone.ul       # Clone trait\n│   ├── option.ul      # Option\u003cT\u003e\n│   ├── result.ul      # Result\u003cT, E\u003e\n│   ├── vec.ul         # Vec\u003cT\u003e\n│   └── hashmap.ul     # HashMap\u003cK, V\u003e\n├── examples/          # Example programs\n├── docs/              # Documentation\n└── tests/             # Test suite\n```\n\n---\n\n## 🛠️ Tooling\n\n### Compiler Commands\n\n| Command | Description |\n|:---|:---|\n| `ul build \u003cfile\u003e` | Compile a U source file |\n| `ul build --release` | Compile with optimizations |\n| `ul build --target \u003ctriple\u003e` | Cross-compile to target platform |\n| `ul fmt \u003cfile\u003e` | Format source code |\n| `ul lint \u003cfile\u003e` | Lint source code |\n\n### Package Manager Commands\n\n| Command | Description |\n|:---|:---|\n| `ul init \u003cname\u003e` | Create a new package |\n| `ul install \u003cpackage\u003e` | Install a dependency |\n| `ul publish` | Publish package to registry |\n| `ul update` | Update dependencies |\n\n---\n\n## 🎨 Standard Library\n\nU provides a modern standard library with common data structures:\n\n| Type | Description | File |\n|:---|:---|:---|\n| `Option\u003cT\u003e` | Optional value | `stdlib/option.ul` |\n| `Result\u003cT, E\u003e` | Error handling | `stdlib/result.ul` |\n| `Vec\u003cT\u003e` | Dynamic array | `stdlib/vec.ul` |\n| `HashMap\u003cK, V\u003e` | Hash map | `stdlib/hashmap.ul` |\n| `Clone` | Deep copy trait | `stdlib/clone.ul` |\n\n---\n\n## 🌟 Why U?\n\n### vs. Rust\n- ✅ **Simpler ownership** (no explicit lifetimes)\n- ✅ **Native GUI DSL** (no external frameworks)\n- ✅ **Smaller learning curve**\n- ❌ No borrow checker complexity\n\n### vs. Go\n- ✅ **No garbage collection** (predictable performance)\n- ✅ **Memory safety** (ownership system)\n- ✅ **Native GUI** (no web-based UI)\n- ❌ Smaller ecosystem (for now)\n\n### vs. Zig\n- ✅ **Memory safety** (ownership system)\n- ✅ **Actor concurrency** (safe by default)\n- ✅ **GUI DSL** (declarative UI)\n- ❌ Uses Zig as backend (dependency)\n\n### vs. C/C++\n- ✅ **Memory safety** (no segfaults, no use-after-free)\n- ✅ **Modern syntax** (type inference, traits)\n- ✅ **Package manager** (dependency management)\n- ✅ **Same performance** (compiles to C)\n\n---\n\n## 📈 Roadmap\n\n### ✅ v1.6 (Q3 2026) - COMPLETED\n- ✅ Native Windows compiler\n- ✅ GUI with Skia integration\n- ✅ Macro system\n- ✅ Automatic linking scripts\n\n### v1.7 (Q4 2026)\n- Interactive GUI (event loop)\n- Compile-time execution\n- Advanced pattern matching\n- Module system improvements\n\n### v2.0 (Q4 2026)\n- Async/await over actors\n- LLVM backend (optional)\n- Garbage collection (optional)\n- WebAssembly improvements\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n### Development Setup\n\n```bash\ngit clone https://github.com/webcien/u-lang.git\ncd u-lang/compiler\ncargo build\ncargo test\n```\n\n---\n\n## 📜 License\n\nU Language is licensed under the **MIT License**.\n\nSee [LICENSE](LICENSE) for details.\n\n---\n\n## 🙏 Acknowledgments\n\nU Language draws inspiration from:\n- **Rust** - Ownership system and safety\n- **Go** - Simplicity and tooling\n- **Zig** - Cross-compilation and C interop\n- **Pony** - Actor-based concurrency\n- **Flutter/SwiftUI** - Declarative UI\n\nSpecial thanks to the open-source community.\n\n---\n\n## 📞 Contact\n\n- **Repository:** https://github.com/webcien/u-lang\n- **Issues:** https://github.com/webcien/u-lang/issues\n- **Discussions:** https://github.com/webcien/u-lang/discussions\n\n---\n\n## 🚀 Get Started\n\n```bash\n# Clone the repository\ngit clone https://github.com/webcien/u-lang.git\n\n# Build the compiler\ncd u-lang/compiler\ncargo build --release\n\n# Try an example\ncd ../examples\n../compiler/target/release/ul build hello.ul\n./hello\n```\n\n**Welcome to U Language! 🎉**\n\n---\n\n**Copyright © 2025 Webcien and U contributors**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebcien%2Fu-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebcien%2Fu-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebcien%2Fu-lang/lists"}