{"id":29599431,"url":"https://github.com/codenlighten/zig-university","last_synced_at":"2025-07-20T11:06:59.545Z","repository":{"id":293482488,"uuid":"984180501","full_name":"codenlighten/zig-university","owner":"codenlighten","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-15T14:30:28.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T15:43:47.909Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/codenlighten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2025-05-15T14:17:03.000Z","updated_at":"2025-05-15T14:33:42.000Z","dependencies_parsed_at":"2025-05-15T15:54:50.696Z","dependency_job_id":null,"html_url":"https://github.com/codenlighten/zig-university","commit_stats":null,"previous_names":["codenlighten/zig-university"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codenlighten/zig-university","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fzig-university","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fzig-university/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fzig-university/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fzig-university/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codenlighten","download_url":"https://codeload.github.com/codenlighten/zig-university/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fzig-university/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266112314,"owners_count":23878022,"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":[],"created_at":"2025-07-20T11:06:58.927Z","updated_at":"2025-07-20T11:06:59.530Z","avatar_url":"https://github.com/codenlighten.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zig University\n\n## Zig Programming Examples\n\nThis repository contains a collection of examples demonstrating various features and capabilities of the Zig programming language (version 0.14.0).\n\n## Overview\n\nThese examples showcase Zig's powerful features, from basic memory management to advanced compile-time metaprogramming. Each example is self-contained and comes with explanatory comments.\n\n## Prerequisites\n\n- Zig 0.14.0 or compatible version\n- Basic familiarity with programming concepts\n\n## Examples\n\n### 1. Memory Allocators (`01_memory_allocators.zig`)\nDemonstrates Zig's various memory allocation strategies:\n- General Purpose Allocator\n- Arena Allocator\n- Fixed Buffer Allocator\n- Page Allocator\n\n```bash\nzig run 01_memory_allocators.zig\n```\n\n### 2. Data Structures (`02_data_structures.zig`)\nShowcases common data structures in Zig's standard library:\n- ArrayList\n- StringHashMap\n- AutoHashMap\n- BufSet\n- SinglyLinkedList\n\n```bash\nzig run 02_data_structures.zig\n```\n\n### 3. String Formatting (`03_string_formatting.zig`)\nExplores string manipulation and formatting capabilities:\n- String concatenation\n- Formatting with placeholders\n- Parsing strings\n\n```bash\nzig run 03_string_formatting.zig\n```\n\n### 4. File I/O (`04_file_io.zig`)\nDemonstrates file operations in Zig:\n- Reading and writing files\n- Directory operations\n- Path manipulation\n\n```bash\nzig run 04_file_io.zig\n```\n\n### 5. Error Handling (`05_error_handling.zig`)\nShowcases Zig's error handling mechanisms:\n- Error sets\n- Try/catch\n- Error unions\n- Error return tracing\n\n```bash\nzig run 05_error_handling.zig\n```\n\n### 6. Testing (`06_testing.zig`)\nDemonstrates Zig's built-in testing framework:\n- Unit tests\n- Test expectation functions\n- Test setup and teardown\n\n```bash\nzig run 06_testing.zig\n# or\nzig test 06_testing.zig\n```\n\n### 7. Threading (`07_threading.zig`)\nShows threading and concurrency in Zig:\n- Thread creation\n- Mutexes\n- Condition variables\n- Thread pools\n\n```bash\nzig run 07_threading.zig\n```\n\n### 8. JSON Processing (`08_json.zig`)\nDemonstrates JSON parsing and generation:\n- Parsing JSON strings\n- Generating JSON from data\n- Working with JSON objects and arrays\n\n```bash\nzig run 08_json.zig\n```\n\n### 9. Networking (`09_networking.zig`)\nImplements basic networking functionality:\n- TCP server and client\n- Socket programming\n- Asynchronous I/O\n\n```bash\nzig run 09_networking.zig\n```\n\n### 10. Compile-Time Features (`10_comptime_features.zig`)\nExplores Zig's powerful compile-time metaprogramming:\n- Compile-time function execution\n- Type reflection\n- Generic data structures\n- Type-based specialization\n\n```bash\nzig run 10_comptime_features.zig\n```\n\n### 11. Cryptography (`11_cryptography.zig`)\nShows cryptographic capabilities:\n- Hash functions (SHA-256, SHA-512, Blake2, Blake3)\n- HMAC for message authentication\n- Password hashing\n- Symmetric encryption\n- Secure random number generation\n\n```bash\nzig run 11_cryptography.zig\n```\n\n### 12. Build System (`12_build_system/`)\nDemonstrates Zig's build system for larger projects:\n- Multi-file projects\n- Dependencies\n- Custom build steps\n- Testing integration\n\n```bash\ncd 12_build_system\nzig build\nzig build run\nzig build test\n```\n\n### 13. Foreign Function Interface (FFI) (`13_ffi/`)\nShows Zig's seamless interoperability with C:\n- Calling C functions from Zig\n- Working with C structs\n- Memory management across the FFI boundary\n- String conversion between C and Zig\n\n```bash\ncd 13_ffi\nzig build run\n```\n\n## Learning Resources\n\nTwo key documentation files are included:\n- `overview.md` - A comprehensive overview of Zig's standard library\n- `additional.md` - Additional reference material for the Zig language\n\n## Key Features of Zig\n\n- Manual memory management with advanced allocator design\n- Compile-time metaprogramming\n- Error handling as a first-class language feature\n- C ABI compatibility and seamless FFI\n- Performance and safety focused design\n- Cross-compilation capabilities\n- Powerful build system\n\n## Contribution\n\nFeel free to add more examples or improve existing ones!\n\n## License\n\nThis project is available under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenlighten%2Fzig-university","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodenlighten%2Fzig-university","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenlighten%2Fzig-university/lists"}