{"id":16806396,"url":"https://github.com/coilysiren/algo-zone","last_synced_at":"2025-10-17T13:02:11.549Z","repository":{"id":53476451,"uuid":"230387802","full_name":"coilysiren/algo-zone","owner":"coilysiren","description":"pronounced like \"auto zone\", a place for figuring out algorithms","archived":false,"fork":false,"pushed_at":"2023-10-23T04:48:45.000Z","size":167,"stargazers_count":11,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T00:51:19.464Z","etag":null,"topics":["algorithms","golang","javascript","python","ruby","rust"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coilysiren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-27T06:38:34.000Z","updated_at":"2024-01-19T18:27:06.000Z","dependencies_parsed_at":"2024-10-13T09:50:56.611Z","dependency_job_id":"062bf12e-39ed-4cee-b2e1-b1339e98c774","html_url":"https://github.com/coilysiren/algo-zone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coilysiren/algo-zone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coilysiren%2Falgo-zone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coilysiren%2Falgo-zone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coilysiren%2Falgo-zone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coilysiren%2Falgo-zone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coilysiren","download_url":"https://codeload.github.com/coilysiren/algo-zone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coilysiren%2Falgo-zone/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265246163,"owners_count":23734109,"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":["algorithms","golang","javascript","python","ruby","rust"],"created_at":"2024-10-13T09:50:53.567Z","updated_at":"2025-10-17T13:02:11.461Z","avatar_url":"https://github.com/coilysiren.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# algo-zone\n\npronounced like \"auto zone\", a place for figuring out algorithms\n\n## Installation Prereqs\n\n- python\n- docker\n\n## Usage\n\nInstall the required dependencies:\n\n```bash\npip install invoke pyyaml\n```\n\nThen run any of the algos:\n\n```bash\ninvoke test $language $script         $data_index\ninvoke test python    insertion_sort  any\ninvoke test python    any             any\ninvoke test rust      selection_sort  any\ninvoke test python    sql             any\ninvoke test python    sql             0\n```\n\nYou will get output like so:\n\n```bash\n$ invoke test python any\n\ndocker run ... python ./src/python/sort_builtin.py\n  ⏱  ./src/python/sort_builtin.py on ./data/sort_input_0.txt ran for 0.52 seconds\n  🟢 ./src/python/sort_builtin.py on ./data/sort_input_0.txt succeeded\ndocker run ... python ./src/python/sql_test.py\n  ⏱  ./src/python/sql_test.py on ./data/sql_input_2.sql ran for 0.75 seconds\n  🟢 ./src/python/sql_test.py on ./data/sql_input_2.sql succeeded\ndocker run ... python ./src/python/sql_test.py\n  ⏱  ./src/python/sql_test.py on ./data/sql_input_3.sql ran for 0.75 seconds\n  🟢 ./src/python/sql_test.py on ./data/sql_input_3.sql succeeded\ndocker run ... python ./src/python/sql_test.py\n  ⏱  ./src/python/sql_test.py on ./data/sql_input_1.sql ran for 0.74 seconds\n  🟢 ./src/python/sql_test.py on ./data/sql_input_1.sql succeeded\n\n✨ script run success ✨\n```\n\n_(note: I will likely not bother to update the above example when the output changes in minor ways)_\n\n## New Languages\n\nAdding new languages is a multi-step process, wherein you have to adapt each language to use parent python script's API. Which is to say, `tasks.py` expects every language to operate in roughly the same way, so each language needs modification to give them some uniformity of behavior. algo-zone was implemented in python first, so expect languages to be easier to add the more similar they are to python.\n\nThe broad steps to adding a language, are:\n\n- Add it to `config.yml`. The only truly \"required\" keys are the `dockerImage` and `scriptInvoker`. Everything else is about modifying the languages to behave in a uniform manner. Your new language will likely require its own new special one-off key, like rust needing `useShortScriptName`.\n- Create a folder in `src/`. If you're lucky, then you can get away with `src/` only needing the source file. The first source file you will want to add is `sort_builtin`. Every `sort_builtin` file just calls the language's native sorting function. You will also of course want to add any necessary language metadata, like `go.mod` or `Cargo.toml`.\n- Handle any special cases. There are always special cases. I can only imagine this repo running out of special cases once it has 10+ languages. Some existing special cases include:\n\n  - Languages that simply do not have a way to say \"run this one individual language file inside this folder\". `golang` has this. The workaround was to make every file be a \"test\" file.\n  - Compiled languages each require a special something. `rust` specifically requires the target scripts to be mentioned in its manifest file (`Cargo.toml`). This can result in confusion if you add a new algo but forget to add it to the manifest file.\n\nThe most important thing to understand is: you need to figure out how to get your language to execute some code in a specific file. It its weird and complicated, when you add your new special case handling code to `tasks.py`. After that, you should be able to do:\n\n```bash\ninvoke test cobol insertion_sort\n```\n\nWhich will spin up a docker container for your brand new fancy language. The tests run inside that docker container. That docker container will be expecting a file as output, look at the existing language examples to get an idea of what this means.\n\nOverall you should expect this process to take a few hours. It's hard getting all these languages to play nice with each other!!!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoilysiren%2Falgo-zone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoilysiren%2Falgo-zone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoilysiren%2Falgo-zone/lists"}