{"id":22150374,"url":"https://github.com/decryptu/zig-playground","last_synced_at":"2026-01-29T16:36:30.674Z","repository":{"id":265784979,"uuid":"896637993","full_name":"Decryptu/zig-playground","owner":"Decryptu","description":"A hands-on learning repository showcasing Zig programming language features through practical examples. Features both a command-line and GUI application demonstrating core Zig concepts, modern systems programming practices, and SDL2 integration.","archived":false,"fork":false,"pushed_at":"2024-12-01T10:11:32.000Z","size":1776,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T18:07:06.780Z","etag":null,"topics":["hello-world","helloworld","sdl2","zig","zig-lang","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/Decryptu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-11-30T22:31:36.000Z","updated_at":"2024-12-01T20:26:43.000Z","dependencies_parsed_at":"2024-12-01T10:41:35.936Z","dependency_job_id":null,"html_url":"https://github.com/Decryptu/zig-playground","commit_stats":null,"previous_names":["decryptu/hello_zig","decryptu/zig-starter-kit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fzig-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fzig-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fzig-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fzig-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Decryptu","download_url":"https://codeload.github.com/Decryptu/zig-playground/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236229977,"owners_count":19115713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hello-world","helloworld","sdl2","zig","zig-lang","ziglang"],"created_at":"2024-12-02T00:15:13.053Z","updated_at":"2025-10-12T14:30:43.163Z","avatar_url":"https://github.com/Decryptu.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zig Examples\n\nThis project contains four examples demonstrating different aspects of the Zig programming language:\n\n1. A basic command-line program showcasing fundamental Zig features\n2. A simple GUI application using SDL2\n3. A vector operations example with interactive visualization\n4. A matrix operations example using comptime features\n\n## Prerequisites\n\n- Zig (0.13.0 or later)\n- SDL2 (for the GUI example)\n- macOS with Apple Silicon (M1/M2) or modify paths for your system\n\n### Installation on macOS\n\n```bash\n# Install Zig\nbrew install zig\n\n# Install SDL2 (required for GUI example)\nbrew install sdl2\n```\n\n## Building and Running\n\nThe project includes four examples that can be built and run separately. After building, the executables can be found in the `zig-out/bin/` directory:\n\n- `zig-out/bin/basic` - The basic command-line example\n- `zig-out/bin/gui` - The GUI application\n- `zig-out/bin/vector` - The vector operations example\n- `zig-out/bin/matrix` - The matrix operations example\n\n### Basic Example\n\nDemonstrates fundamental Zig features including:\n\n- Functions\n- Structs with methods\n- Error handling\n- String formatting\n- Basic types\n\n```bash\n# Build all targets\nzig build\n\n# Run the basic example directly\n./zig-out/bin/basic\n\n# Or use zig build command\nzig build run-basic\n```\n\n### GUI Example\n\nShows how to create a simple GUI application using SDL2:\n\n- Window creation\n- Event handling\n- Basic graphics rendering\n- Keyboard input\n- Game loop implementation\n\n```bash\n# Build all targets\nzig build\n\n# Run the GUI example directly\n./zig-out/bin/gui\n\n# Or use zig build command\nzig build run-gui\n```\n\n### Vector Example\n\nDemonstrates Zig's SIMD vector operations with an interactive visualization:\n\n- Vector arithmetic operations\n- SIMD instructions usage\n- Interactive web visualization\n- Real-time computation\n\n```bash\n# Build all targets\nzig build\n\n# Run the vector example directly\n./zig-out/bin/vector\n\n# Or use zig build command\nzig build vector\n```\n\n### Matrix Example\n\nShowcases advanced Zig features using matrix operations:\n\n- Generic programming with comptime\n- Compile-time error checking\n- Struct methods\n- Array operations\n- Formatted printing\n\n```bash\n# Build all targets\nzig build\n\n# Run the matrix example directly\n./zig-out/bin/matrix\n\n# Or use zig build command\nzig build matrix\n```\n\n### GUI Controls\n\n- Arrow keys: Move the red square\n- Escape: Exit the program\n- Window close button: Exit the program\n\n## Project Structure\n\n```t\n.\n├── .gitignore\n├── LICENSE\n├── README.md\n├── build.zig        # Build configuration\n├── src/\n│   ├── basic.zig   # Basic Zig example\n│   ├── gui.zig     # SDL2 GUI example\n│   ├── vector.zig  # Vector operations example\n│   └── matrix.zig  # Matrix operations example\n└── .vscode/\n    └── settings.json\n```\n\n## Build Output\n\nAfter building, the project generates the following executables:\n\n```t\nzig-out/\n└── bin/\n    ├── basic       # Basic command-line example executable \n    ├── gui         # GUI application executable\n    ├── vector      # Vector operations executable\n    └── matrix      # Matrix operations executable\n```\n\n## Features Demonstrated\n\n### Basic Example (basic.zig)\n\n- Function definitions\n- Custom types (structs)\n- String formatting and printing\n- Error handling with `try`\n- Basic arithmetic\n\n### GUI Example (gui.zig)\n\n- SDL2 integration\n- Window management\n- Input handling\n- Basic graphics rendering\n- Resource management with `defer`\n- Game loop pattern\n\n### Vector Example (vector.zig)\n\n- SIMD vector operations\n- Interactive visualization\n- Real-time computation\n- Vector arithmetic\n- Web component integration\n- User input handling\n- Dynamic result visualization\n\n### Matrix Example (matrix.zig)\n\n- Generic programming using comptime\n- Error checking at compile time\n- Struct methods\n- Array operations\n- Formatted printing\n\n## Learning Resources\n\n- [Zig Documentation](https://ziglang.org/documentation/master/)\n- [SDL2 Documentation](https://wiki.libsdl.org/wiki/index)\n- [Zig Learning Resources](https://github.com/zigcc/awesome-zig)\n- [Zig Vector Operations](https://ziglang.org/documentation/master/#Vectors)\n\n## Contributing\n\nFeel free to:\n\n- Report issues\n- Suggest improvements\n- Submit pull requests\n\nAll contributions are welcome!\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecryptu%2Fzig-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecryptu%2Fzig-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecryptu%2Fzig-playground/lists"}