{"id":21043663,"url":"https://github.com/mrsmith33/vox","last_synced_at":"2026-01-28T04:02:48.115Z","repository":{"id":46943022,"uuid":"91568700","full_name":"MrSmith33/vox","owner":"MrSmith33","description":"Vox language compiler. AOT / JIT / Linker. Zero dependencies","archived":false,"fork":false,"pushed_at":"2025-10-02T18:08:51.000Z","size":2992,"stargazers_count":358,"open_issues_count":1,"forks_count":18,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-10-02T20:14:35.104Z","etag":null,"topics":["amd64","aot","codegen","compiler","d","dlang","jit","language","linker","pe-format","programming-language","ssa-form","vox","voxlang","x86-64"],"latest_commit_sha":null,"homepage":"","language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrSmith33.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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":"2017-05-17T11:27:18.000Z","updated_at":"2025-10-02T18:08:54.000Z","dependencies_parsed_at":"2024-01-29T08:09:54.565Z","dependency_job_id":"f314921d-89bb-4907-971d-9324f5548e54","html_url":"https://github.com/MrSmith33/vox","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/MrSmith33/vox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrSmith33%2Fvox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrSmith33%2Fvox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrSmith33%2Fvox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrSmith33%2Fvox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrSmith33","download_url":"https://codeload.github.com/MrSmith33/vox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrSmith33%2Fvox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28837863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T02:10:51.810Z","status":"ssl_error","status_checked_at":"2026-01-28T02:10:50.806Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["amd64","aot","codegen","compiler","d","dlang","jit","language","linker","pe-format","programming-language","ssa-form","vox","voxlang","x86-64"],"created_at":"2024-11-19T14:13:41.937Z","updated_at":"2026-01-28T04:02:48.082Z","avatar_url":"https://github.com/MrSmith33.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Small and fast JIT/AOT compiler with zero dependencies\n\n[![CI](https://github.com/MrSmith33/vox/workflows/CI/badge.svg?branch=master\u0026event=push)](https://github.com/MrSmith33/tiny_jit/releases/tag/CI)\n\n* [Latest CI build](https://github.com/MrSmith33/tiny_jit/releases/tag/CI)\n* [Channel on /r/ProgrammingLanguages discord](https://discord.gg/HpYYhH4) - Projects Q-Y -\u003e Vox\n\n# Vox programming language\n\n**Vox** is a multiparadigm programming language inspired by D (60%), Jai (30%), and Zig (10%).\n\n## Main features\n\n- Fast compilation\n- Strong metaprogramming\n- Can be used for scripting and standalone programs (both JIT and AOT compilation)\n- No dependencies (except D compiler)\n\n## Similarities to the D language\n\n- Same syntax for most portions of the language (struct, function, enum, for, while, if, UFCS, slices, arrays)\n- Conditional compilation\n- Templates, Variadic templates, and functions\n- C interoperability\n- Modules / Packages\n\n## Differences from the D language\n\n- No GC, minimal runtime, no classes (only structs), no exceptions\n- More compile-time features, faster CTFE\n- Using templates for heavy calculations is discouraged, instead, CTFE can be used for introspection, and code generation.\n- Macros (WIP)\n- No C++ interoperability\n\n## Platforms\n\nSupported:\n- windows-x64 - host and target\n- linux-x64 - host and target\n- macos-x64 - only jit-mode\n\nPlanned:\n- linux-arm64\n- wasm\n- windows-arm64?\n- spirv (Vulkan/OpenCL/OpenGL shaders)\n\n## Project goals\n\n- Strong focus on application extensions\n- Maximize user productivity\n- Maximize application performance\n- AOT and JIT, plugin support, runtime compilation, embedded compiler, tiered compilation\n- Static typing\n- Great error messages\n- Fast / Incremental compilation\n- Minimize effort needed for installation, setup, integration\n    - Minimal dependencies/encapsulate dependency into module or package\n    - Runtime as a library/minimal runtime/no runtime\n    - Embedding/extern C\n    - Code driven compilation, extending compiler from inside of the program being compiled\n- Processor intrinsics\n- Conditional compilation\n- CTFE, Templates, Introspection, Code generation\n\n## Syntax examples\n\n```D\ni32 fib(i32 number) {\n    if (number \u003c 1) return 0;\n    if (number \u003c 3) return 1;\n    return fib(number-1) + fib(number-2);\n}\n\nstruct Point {\n    i32 x;\n    i32 y;\n}\n\nT min[T](T a, T b) {\n    if (a \u003c b) return a;\n    return b;\n}\n```\n\n- Cross-platform hello world \u003chttps://gist.github.com/MrSmith33/34a7557ad5ac23ebe6cf27bef15a39a6\u003e\n- Fibonacci \u003chttps://gist.github.com/MrSmith33/9645d9552b567fdbdc1a4d8822b4f1f7\u003e\n- Fannkuch \u003chttps://gist.github.com/MrSmith33/ac14e66a83b9d047793adede464ca1ef\u003e\n- Roguelike tutorial using SDL2 - [repo](https://github.com/MrSmith33/rltut_2019)\n- Voxel engine that uses Vox as a scripting language: [Voxelman 2](https://github.com/MrSmith33/voxelman2)\n- Example of JIT compilation for amd64 from D code:\n\n  \u003cdetails\u003e\n    \u003csummary\u003ecode\u003c/summary\u003e\n    \n  ```D\n  // Source code\n  string source = q{\n      void test(i32* array, i32 index, i32 value) {\n          array[index] = value;\n      }\n  };\n  \n  // Error handling is omitted\n  Driver driver;\n  driver.initialize(jitPasses);\n  scope(exit) driver.releaseMemory;\n  driver.beginCompilation();\n  driver.addModule(SourceFileInfo(\"test\", source));\n  driver.compile();\n  driver.markCodeAsExecutable();\n  \n  // Get function pointer\n  auto testFun = driver.context.getFunctionPtr!(void, int*, int, int)(\"test\");\n  \n  // Use compiled function\n  int[2] val = [42, 56];\n  testFun(val.ptr, 1, 10);\n  assert(val[1] == 10);\n  ```\n    \n  \u003c/details\u003e\n\n## Running \u0026 testing\n\nIn `main.d` uncomment one of the following lines:\n```D\n//version = bench; // Runs benchmark\n//version = devtest; // Run single test with fine-tuned logging. Useful for development. Uses tester.runDevTests(). Toggle options there for precise analisys while developing.\n//version = test; // Runs test suite. Uses tester.runAllTests().\n```\n\nand run with: `source\u003e dmd -m64 -i main.d \u0026\u0026 main`\n\nBenchmarking:\n\n`ldc2 -d-version=bench -m64 -O3 -release -boundscheck=off -enable-inlining -flto=full -i main.d \u0026\u0026 main`\n\nDebug CLI build:\n\n`dmd -i -g -m64 -version=cli main.d -of=vox.exe`\n\nRelease CLI build:\n\n`ldc2 -d-version=cli -m64 -O3 -release -boundscheck=off -enable-inlining -flto=full -mcpu=native -i main.d -of=vox.exe`\n\nDebug shared library build:\n\n`ldc2 -m64 -shared -g -d-debug -fvisibility=hidden -link-defaultlib-shared=false -i c_api.d -of=libvox.dll`\n\nCompiling with Profile Guided Optimization:\n\n```\nldc2 -d-version=test -m64 -release -fprofile-instr-generate -mcpu=native -i main.d -of=vox_instrumented.exe\nvox_instrumented\nldc-profdata merge default.profraw -output vox.profdata\nldc2 -d-version=cli -m64 -O3 -release -boundscheck=off -enable-inlining -flto=full -mcpu=native -fprofile-instr-use=vox.profdata -i main.d -of=vox.exe\n```\n\n# Using Commandline interface\n\n## Getting help\n\nGives the full list of flags\n```D\nvox --help\n```\n\n\n## Input files\n\n* `.vx` files are source code files.\n* `.har` files, aka [Human Readable Archive files](https://github.com/marler8997/har). A text file that combines multiple textual files.\n\nEach file must begin with `--- \u003cpath\u003e`, three dashes, space, and name.\n\nFiles can be nested inside directories `--- dir/dir2/file.txt`.\n\nExample:\n```D\n--- main.vx\nimport kernel32;\nvoid main() { ExitProcess(42); }\n--- kernel32.vx\n@extern(module, \"kernel32\")\nnoreturn ExitProcess(u32 uExitCode);\n```\nCan be compiled with `vox program.har`\n\n\n# CLI Tools\nThe compiler contains embedded tools:\n\n## PDB dump\nPrints content of vox.pdb file into stdout.\n```\nvox pdb-dump vox.pdb\n```\n\n# Syntax highlighting\n\n## GitHub\n\nTo get some syntax highlighting on GitHub define `.gitattributes` file in the repository with the following content ([docs](https://github.com/github/linguist/blob/master/docs/overrides.md)):\n\n```\n*.vx linguist-language=D\n```\n\nAll `.vx` files will be highlighted and classified as D.\n\n## Editor\n\n* [Vim](https://github.com/jedekar/vim-vox)\n\n# Compiler overview\n\n## Stats\n\n- Impl size: 40k LoC of D, 3MB exe\n- Time to compile: 4s debug / 45s release\n- Test suite: 95ms for 361 tests\n- Time to compile 10MLoC of fibonacci: 8s on Windows, 7.5s on Linux\n\nFor more in detail description of implementation see [internals.md](internals.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrsmith33%2Fvox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrsmith33%2Fvox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrsmith33%2Fvox/lists"}