{"id":35739242,"url":"https://github.com/yasakei/neutron","last_synced_at":"2026-02-10T17:05:42.944Z","repository":{"id":313867214,"uuid":"1053212800","full_name":"yasakei/neutron","owner":"yasakei","description":"Yet another useless programming language","archived":false,"fork":false,"pushed_at":"2026-02-09T15:17:39.000Z","size":30533,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-09T21:49:36.759Z","etag":null,"topics":["coding","language","programming"],"latest_commit_sha":null,"homepage":"https://neutron.ct.ws","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yasakei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"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-09-09T06:25:50.000Z","updated_at":"2026-02-01T06:13:38.000Z","dependencies_parsed_at":"2025-09-09T09:09:16.332Z","dependency_job_id":"cd1768b1-cb07-414a-a467-af0c114b34b4","html_url":"https://github.com/yasakei/neutron","commit_stats":null,"previous_names":["yasakei/neutron"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/yasakei/neutron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasakei%2Fneutron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasakei%2Fneutron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasakei%2Fneutron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasakei%2Fneutron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yasakei","download_url":"https://codeload.github.com/yasakei/neutron/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasakei%2Fneutron/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29308968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T16:09:25.305Z","status":"ssl_error","status_checked_at":"2026-02-10T16:08:52.170Z","response_time":65,"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":["coding","language","programming"],"created_at":"2026-01-06T14:13:24.664Z","updated_at":"2026-02-10T17:05:42.930Z","avatar_url":"https://github.com/yasakei.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Neutron Programming Language\n\n### A Fast, Modern Scripting Language Built for Performance\n\n[![CI](https://github.com/yasakei/neutron/actions/workflows/ci.yml/badge.svg)](https://github.com/yasakei/neutron/actions/workflows/ci.yml)\n[![Release](https://github.com/yasakei/neutron/actions/workflows/release.yml/badge.svg)](https://github.com/yasakei/neutron/actions/workflows/release.yml)\n\n**[Quick Start](docs/guides/quickstart.md)** • **[Documentation](docs/readme.md)** •  **[Download](https://github.com/yasakei/neutron/releases)**\n\u003c/div\u003e\n\n\u003e [!IMPORTANT]\n\u003e **Solo Developer Project:** Neutron is actively developed by a single developer and currently lacks many advanced features and libraries found in mature languages. The ecosystem is small with no established community yet. Contributions are highly encouraged to help grow the language and its ecosystem!\n\n---\n\n## Installation\n \n ### Download Pre-built Binaries\n \n **[Download Latest Release](https://github.com/yasakei/neutron/releases/latest)**\n \n #### Linux\n - **Debian/Ubuntu/Others:** Download `neutron-linux-x64.tar.gz` from Releases.\n - **Arch Linux:**\n   ```bash\n   yay -S neutron\n   ```\n \n #### macOS\n - **Apple Silicon:** Download `neutron-macos-arm64.tar.gz` from Releases.\n - **Intel Macs:** Build from source: `python3 package.py`\n \n #### Windows\n - Download the **Installer** (`NeutronInstaller.exe`) from Releases.\n \n ---\n \n ## Overview\n \n **Neutron** is a high-performance scripting language with a C++ runtime, designed for speed and simplicity.\n \n **Key Features:**\n - **Fast:** C++ bytecode VM with multi-tier tracing JIT (x86-64 \u0026 ARM64)\n - **JIT Compiled:** Tracing JIT compiles hot loops to native x86-64 and ARM64 machine code\n - **Native:** Compiles to standalone executables\n - **Battery-Included:** Standard library with HTTP, JSON, RegEx, and more\n - **Cross-Platform:** Runs on Linux, macOS (Apple Silicon \u0026 Intel), Windows\n \n \u003e [!NOTE]\n \u003e **New?** Check the **[Quick Start Guide](docs/guides/quickstart.md)** to get running in 5 minutes.\n \n ---\n\n## Architecture\n \n Neutron uses a modern multi-stage pipeline: **Scanner/Parser** → **Bytecode Compiler** → **Stack-based VM** → **[Multi-Tier JIT](docs/implementation/jit.md)**.\n \n - **Zero Dependencies:** Written in C++17 with minimal external reliance.\n - **Smart Memory:** Deterministic RC/GC memory management.\n - **JIT Compilation:** Three-tier execution (interpreter → threaded code → tracing JIT) with native codegen for **x86-64** and **ARM64**.\n - **Native Modules:** Direct C++ integration for max performance.\n\n## Core Features\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Language Design\n\n**Dynamic Typing**  \nWrite code without type declarations - types are inferred at runtime with full type safety\n\n**C-Style Syntax**  \nFamiliar `{}` blocks, `;` terminators, and control flow from C/JavaScript/Java\n\n**Object-Oriented**  \nClasses, methods, inheritance, and `this` keyword for structured programming\n\n**First-Class Functions**  \nLambdas, closures, and higher-order functions for functional programming patterns\n\n**Exception Handling**  \n`try`/`catch`/`finally` blocks for robust error management\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Standard Library\n\n**System Operations** (`sys`)  \nFile I/O, directory manipulation, environment variables, process control\n\n**Web \u0026 Networking** (`http`)  \nHTTP client with GET/POST/PUT/DELETE support, real socket-based server\n\n**Data Formats** (`json`)  \nFast JSON parsing, serialization, and file I/O\n\n**Regular Expressions** (`regex`)  \nPattern matching, search, replace, split with full capture group support\n\n**Mathematics** (`math`)  \nStandard math functions and constants\n\n**Type Utilities** (`fmt`)  \nType conversion, formatting, and inspection\n\n**Time \u0026 Date** (`time`)  \nTimestamps, formatting, and delays\n\n**Arrays** (`arrays`)  \nAdvanced array operations and manipulations\n\n**Concurrency** (`async`)  \nNative multi-threading support with async/await syntax\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Developer Tools\n\n**Box Package Manager**  \n`box install module` - Native C++ modules with zero configuration\n\n**Comprehensive Errors**  \nDetailed stack traces with source code context and helpful suggestions\n\n**Module System**  \n`use module` for built-ins, `using 'file.nt'` for local imports\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Modern Features\n\n**String Interpolation**  \n`\"Hello, ${name}!\"` - Embed expressions in strings\n\n**Array Literals**  \n`[1, 2, 3]` with full indexing and manipulation\n\n**Match Statements**  \nPattern matching for cleaner conditionals\n\n**Native Extensions**  \nWrite performance-critical code in C++ and call it from Neutron\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Quick Start\n\n### Project-Based Development\n\n```bash\n# Create a new project\n./neutron init my-app\n\n# Run your project\n./neutron run\n\n# Build to standalone native executable (bundles all dependencies)\n./neutron build\n\n# Install Box package manager\n./neutron install box\n```\n\n### Hello World\n\n```js\n// hello.nt\nsay(\"Hello, World!\");\n```\n\n```bash\n./neutron hello.nt  # Run it directly\n```\n\n\u003e [!TIP]\n\u003e **Common Mistake**: Use `.length` (property), not `.length()` (method). See [Common Pitfalls Guide](docs/guides/common-pitfalls.md).\n\n\u003e [!NOTE]\n\u003e **Looking for more examples?** Check out the `examples/real_world/` directory for practical applications like a Todo CLI, HTTP Server, and Data Processing scripts.\n\n### Real-World Examples\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eHTTP \u0026 JSON - Fetch GitHub Repository Data\u003c/b\u003e\u003c/summary\u003e\n\n```js\n// github.nt - Fetch repository information\nuse http;\nuse json;\n\nvar response = http.get(\"https://api.github.com/repos/microsoft/vscode\");\nvar repo = json.parse(response.body);\n\nsay(\"Repository: ${repo.name}\");\nsay(\"Stars: ${repo.stargazers_count}\");\nsay(\"Forks: ${repo.forks_count}\");\nsay(\"Language: ${repo.language}\");\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eHTTP Server - Simple Web Server\u003c/b\u003e\u003c/summary\u003e\n\n```js\n// server.nt - Simple HTTP server\nuse http;\n\nfun handler(req) {\n    say(\"Request: \" + req.method + \" \" + req.path);\n    \n    if (req.path == \"/\") {\n        return \"Hello from Neutron!\";\n    } else {\n        return {\n            \"status\": 404,\n            \"body\": \"Not Found\"\n        };\n    }\n}\n\nsay(\"Starting server on port 8080...\");\nvar server = http.createServer(handler);\nhttp.listen(server, 8080);\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eAlgorithms - Fibonacci with Performance\u003c/b\u003e\u003c/summary\u003e\n\n```js\n// fibonacci.nt - Fast recursive fibonacci\nfun fib(n) {\n    if (n \u003c= 1) return n;\n    return fib(n - 1) + fib(n - 2);\n}\n\nuse time;\nvar start = time.now();\n\nfor (var i = 0; i \u003c 30; i = i + 1) {\n    say(\"fib(${i}) = ${fib(i)}\");\n}\n\nvar elapsed = time.now() - start;\nsay(\"Computed in ${elapsed}ms\");\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eOOP - Person Class with Methods\u003c/b\u003e\u003c/summary\u003e\n\n```js\n// person.nt - Object-oriented programming\nclass Person {\n    var name;\n    var age;\n\n    fun init(name, age) {\n        this.name = name;\n        this.age = age;\n    }\n\n    fun greet() {\n        return \"Hi, I'm ${this.name}, ${this.age} years old\";\n    }\n\n    fun birthday() {\n        this.age = this.age + 1;\n        say(\"Happy birthday! Now ${this.age}!\");\n    }\n}\n\nvar alice = Person();\nalice.init(\"Alice\", 25);\nsay(alice.greet());\nalice.birthday();\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eFile I/O - Log Analyzer\u003c/b\u003e\u003c/summary\u003e\n\n```js\n// analyzer.nt - Analyze log files\nuse sys;\n\nvar content = sys.read(\"server.log\");\nvar lines = content.split(\"\\n\");\n\nvar errors = 0;\nvar warnings = 0;\n\nfor (var i = 0; i \u003c lines.length(); i = i + 1) {\n    var line = lines[i];\n    if (line.contains(\"ERROR\")) {\n        errors = errors + 1;\n    }\n    if (line.contains(\"WARN\")) {\n        warnings = warnings + 1;\n    }\n}\n\nsay(\"Log Analysis:\");\nsay(\"  Errors: ${errors}\");\nsay(\"  Warnings: ${warnings}\");\n```\n\u003c/details\u003e\n\n\u003e [!TIP]\n\u003e See the [Quick Start Guide](docs/guides/quickstart.md) for more examples and the [Language Reference](docs/reference/language-reference.md) for complete syntax.\n\n## Documentation\n\n**[Complete Documentation Index](docs/README.md)**\n\n### Essential Guides\n- [Project System Guide](docs/guides/project-system.md) - Project management, building, and deployment\n- [Language Reference](docs/reference/language-reference.md) - Complete syntax and features\n- [Module System](docs/reference/module-system.md) - Using and creating modules\n\n### Module Documentation\n- [Sys Module](docs/modules/sys_module.md) - File I/O and system operations\n- [JSON Module](docs/modules/json_module.md) - JSON parsing, serialization, and file I/O\n- [HTTP Module](docs/modules/http_module.md) - HTTP client and server functionality\n- [Regex Module](docs/modules/regex_module.md) - Regular expressions and pattern matching\n- [Math Module](docs/modules/math_module.md) - Mathematical operations\n- [More modules...](docs/modules/)\n\n## Box Package Manager\n\n\u003e **Native C++ modules for Neutron** - Install, manage, and use high-performance native extensions with zero configuration. Box automatically detects Neutron projects and installs modules locally.\n\n### Installation Example\n\n```bash\n# Install a native module (auto-installs to .box/modules/ in projects)\nbox install base64\n```\n\n```js\n// Use it in your code immediately\nuse base64;\n\nvar encoded = base64.encode(\"Hello, World!\");\nsay(encoded);  // SGVsbG8sIFdvcmxkIQ==\n\nvar decoded = base64.decode(encoded);\nsay(decoded);  // Hello, World!\n```\n\n### Features\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n**Auto-Detection**  \nAutomatically finds and configures your system's C++ compiler (GCC, Clang, MSVC, MinGW)\n\n**Version Control**  \nPin specific versions with `box install module@1.2.3`\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n**Project-Local**  \nModules install to `.box/modules/` in your project directory\n\n**Cross-Platform**  \nWorks seamlessly on Linux (`.so`), macOS (`.dylib`), and Windows (`.dll`)\n\n**Build Tools**  \nCreate your own native modules with `box build`\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### Common Commands\n\n| Command | Description |\n|---------|-------------|\n| `box install \u003cmodule\u003e[@version]` | Install a module from NUR |\n| `box list` | Show all installed modules |\n| `box remove \u003cmodule\u003e` | Uninstall a module |\n| `box build` | Build a native module from source |\n| `box search \u003cquery\u003e` | Search available modules |\n\n\u003e [!NOTE]\n\u003e See [Box Documentation](nt-box/docs/) for creating native modules and the [Box Modules Guide](docs/reference/box-modules.md) for advanced usage.\n\n## Language Syntax\n\n### Variables \u0026 Functions\n\n```js\n// Variables with dynamic typing\nvar name = \"Alice\";\nvar age = 25;\nvar scores = [95, 87, 92];\n\n// Functions\nfun add(a, b) {\n    return a + b;\n}\n\n// Lambdas\nvar multiply = fun(a, b) { return a * b; };\nsay(multiply(3, 4));  // 12\n```\n\n### Control Flow\n\n```js\n// If-else\nif (age \u003e= 18) {\n    say(\"Adult\");\n} else {\n    say(\"Minor\");\n}\n\n// Loops\nfor (var i = 0; i \u003c 10; i = i + 1) {\n    say(i);\n}\n\nwhile (condition) {\n    // loop body\n}\n\n// Match statement (pattern matching)\nmatch (value) {\n    case 1 =\u003e say(\"One\");\n    case 2 =\u003e say(\"Two\");\n    default =\u003e say(\"Other\");\n}\n```\n\n### Classes \u0026 OOP\n\n```js\nclass Animal {\n    init(name) {\n        this.name = name;\n    }\n\n    speak() {\n        return \"${this.name} makes a sound\";\n    }\n}\n\nclass Dog extends Animal {\n    speak() {\n        return \"${this.name} barks!\";\n    }\n}\n\nvar dog = Dog(\"Buddy\");\nsay(dog.speak());  // Buddy barks!\n```\n\n### Exception Handling\n\n```js\ntry {\n    var data = json.parse(invalid_json);\n} catch (e) {\n    say(\"Error: ${e}\");\n} finally {\n    say(\"Cleanup code here\");\n}\n```\n\n\u003e [!NOTE]\n\u003e For complete language documentation, see the [Language Reference](docs/reference/language-reference.md).\n\n## Contributing\n\nWe welcome contributions from the community! Whether it's bug fixes, new features, documentation improvements, or native modules.\n\n### How to Contribute\n\n1. **Fork** the repository\n2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)\n3. **Commit** your changes (`git commit -m 'Add amazing feature'`)\n4. **Push** to the branch (`git push origin feature/amazing-feature`)\n5. **Open** a Pull Request\n\n### Guidelines\n\n- Read [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines\n- Follow the existing code style and conventions\n- Write tests for new features\n- Update documentation as needed\n\n### Community\n\n- **Discord:** [Join our server](https://discord.gg/29f2w6jme8) for discussions and support\n- **Issues:** [Report bugs or request features](https://github.com/YourUsername/neutron/issues)\n- **Discussions:** Share ideas and get help from the community\n\n## License\n\nNeutron is distributed under the **Neutron Permissive License (NPL) 1.1**.\n\nSee [LICENSE](LICENSE) for complete terms and conditions.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Created and maintained by [yasakei](https://github.com/yasakei)**\n\nStar this repo if you find Neutron useful!\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyasakei%2Fneutron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyasakei%2Fneutron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyasakei%2Fneutron/lists"}