{"id":37174519,"url":"https://github.com/azhenley/knox","last_synced_at":"2026-01-14T20:23:28.610Z","repository":{"id":72749965,"uuid":"165435498","full_name":"AZHenley/knox","owner":"AZHenley","description":"A toy programming language written in Go that compiles to C.","archived":false,"fork":false,"pushed_at":"2022-06-20T23:30:40.000Z","size":176,"stargazers_count":90,"open_issues_count":65,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-06-21T17:51:48.180Z","etag":null,"topics":["compiler","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Go","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/AZHenley.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":"2019-01-12T20:59:53.000Z","updated_at":"2024-06-15T11:22:30.000Z","dependencies_parsed_at":"2023-03-26T15:11:17.567Z","dependency_job_id":null,"html_url":"https://github.com/AZHenley/knox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AZHenley/knox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AZHenley%2Fknox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AZHenley%2Fknox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AZHenley%2Fknox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AZHenley%2Fknox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AZHenley","download_url":"https://codeload.github.com/AZHenley/knox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AZHenley%2Fknox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"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":["compiler","programming-language"],"created_at":"2026-01-14T20:23:27.948Z","updated_at":"2026-01-14T20:23:28.599Z","avatar_url":"https://github.com/AZHenley.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Knox Programming Language\n\nKnox is an experimental language meant to help me learn Go and explore compiler design (NOTE: I don't work on this anymore.). It acts as a systems language with high-level constructs for convenience. The compiler is written in Go and generates C. It is very early in development.\n\nThe principles behind the design of Knox are:\n - Explicitness. Explicit and unambiguous code is a priority, even over brevity. No surprises.  \n - Pass by reference. All complex types should be pass by reference and pointers should be hidden, like Java and C#.\n - Small language. Simple and consistent syntax with few constructs, as an alternative to Zig or C.\n - Convenient data structures. Strings, lists, and maps are first-class data structures that should be as easy as Python.\n - Operability. Use any C library and produce C libraries.\n - Easy to setup and use. No massive installation like C# or Java and no annoying configuration like Go's gopath.\n - Fast enough. Compiling time, execution time, and memory usage should be comparable to directly using C.  \n - Low overhead. All runtime dependencies are optional for systems programming.\n - Well-behaved. Contracts, error handling, and unit tests are first-class constructs.\n\n```\nfunc main() void {\n    fizzbuzz(300);\n}\n\nfunc fizzbuzz(n : int) void {\n    for i : int in stl.range(1,10,1) {\n        if i%15 == 0 {\n            stl.print(\"FizzBuzz\");\n        } else if i%3 == 0 {\n            stl.print(\"Fizz\");\n        } else if i%5 == 0 {\n            stl.print(\"Buzz\");\n        } else {\n            stl.print(i);\n        }\n    }\n}\n```\n\n## Comparison to Go:\n - Classes instead of structs\n - Objects are pass-by-reference\n - Ada-style type constraints\n - No garbage collector\n - No type inference\n - No short form of variable declarations\n - No variable declaration blocks\n - No implicit casting\n - Variables must be initialized\n - Semicolons required\n - Different syntax for variable and function declarations\n - Python-style While and For loops\n - Allows whitespace between if and elseif blocks\n - Enum support\n - Sum types\n - Constructors\n - Classes must explicitly implement interfaces\n - No pointers\n - All return values must be used or explicitly thrown away\n - No goto\n - Multiple assignment is only for multiple return values\n \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazhenley%2Fknox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazhenley%2Fknox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazhenley%2Fknox/lists"}