{"id":34656697,"url":"https://github.com/joshuacox/name-generator","last_synced_at":"2025-12-24T18:09:32.809Z","repository":{"id":321977699,"uuid":"1087808555","full_name":"joshuacox/name-generator","owner":"joshuacox","description":"A name generation engine","archived":false,"fork":false,"pushed_at":"2025-12-16T20:17:39.000Z","size":2012,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-20T11:08:02.100Z","etag":null,"topics":["bash","c","cpp","elixir","erlang","go","haskell","java","javascript","name-generator","perl","racket","raku","ruby","rust","shell","zsh"],"latest_commit_sha":null,"homepage":"https://joshuacox.github.io/name-generator/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshuacox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-01T17:29:06.000Z","updated_at":"2025-12-16T20:17:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/joshuacox/name-generator","commit_stats":null,"previous_names":["joshuacox/name-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joshuacox/name-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuacox%2Fname-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuacox%2Fname-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuacox%2Fname-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuacox%2Fname-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshuacox","download_url":"https://codeload.github.com/joshuacox/name-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuacox%2Fname-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28005981,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bash","c","cpp","elixir","erlang","go","haskell","java","javascript","name-generator","perl","racket","raku","ruby","rust","shell","zsh"],"created_at":"2025-12-24T18:05:44.608Z","updated_at":"2025-12-24T18:09:32.797Z","avatar_url":"https://github.com/joshuacox.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Name Generator](https://joshuacox.github.io/name-generator/)\n\n## [namgen](https://github.com/joshuacox/namgen)\nThis repo has a sister-repo [namgen](https://github.com/joshuacox/namgen) that is a further implementation of this concept in cpp after proving itself to be the performance king.  This repo will continue to exist to pit languages against each other in a deathmatch.  The other repo will continue on as I add features like command line arguments and cap/camel casing.\n\nThis repository contains a\n[website](https://joshuacox.github.io/name-generator/)\nand simple name generator script that combines random nouns and adjectives to create unique names. \nThis was inpsired by the [docker mechanism](https://github.com/moby/moby/blob/39f7b2b6d0156811d9683c6cb0743118ae516a11/pkg/namesgenerator/names-generator.go#L134-L135) \nthat generates names. \nThis project differs in that I am attempting to have a much larger adjective and noun lists generating more variation.\n\n## Why\n\nDo you need to name a server, or something else?  I know 'treat em like cattle', but I detest names like dal2dc3c38r67, I say give it some personality, inspired by the docker mechanism that does the same, I needed a quick and dirty script to name a bunch of servers and wrote a quick one in bash, then decided to benchmark sh vs bash vs zsh, then threw python in the mix.   Well now I have \n\n1. bash\n1. c\n1. cpp\n1. D\n1. dart\n1. elisp\n1. elixir\n1. erlang\n1. fish\n1. golang\n1. haskell\n1. java\n1. javascript async + sync\n1. julia\n1. kotlin\n1. lua\n1. ocaml\n1. octave\n1. pascal\n1. perl\n1. php\n1. python\n1. R\n1. racket\n1. raku\n1. ruby\n1. rust\n1. scala\n1. sh\n1. typescript\n1. zsh\n\nPRs welcome for more!\n\n### Similar projects in that they aim to show one thing done in many ways.\n\n1. [Arch is the best](https://wiki.archlinux.org/title/Arch_is_the_best)\n1. [todoMVC](https://todomvc.com)\n1. [turtlekitty's dice](https://github.com/TurtleKitty/Dice)\n1. [pacman rosetta stone](https://wiki.archlinux.org/title/Pacman/Rosetta)\n1. [fantasy-names](https://www.npmjs.com/package/fantasy-names)\n1. [FantasyNamesJava](https://github.com/mp-pinheiro/fantasynamesjava)\n1. [namgen](https://github.com/joshuacox/namgen)\n\n\n## Getting Started\n\n#### web based\n\n1. Simply visit the [site](https://joshuacox.github.io/name-generator/) in github.io.\n1. Click generate.\n\n#### CLI based\n\nfollow these steps:\n\n1. Clone the repository to your local machine using Git: `git clone https://github.com/joshuacox/name-generator.git`\n1. Navigate to the cloned repository: `cd name-generator`\n1. Run the script using shell: `./name-generator.sh`\n1. Run the script using Python: `./name-generator.py`\n1. Refer to the `test/test.bats` or `benchmark.sh` script for examples of running all languages that are tested\n\n## Usage\n\nThe script will output a randomly generated name in the format \"adjective-noun\". You can run the script multiple times to generate different names.\n\n```\n./name-generator.sh\n```\n\nOr specify NOUN_FILE and ADJ_FILE:\n\n```\nNOUN_FILE=alternative-nouns/greek_gods.list ADJ_FILE=alternative-adjectives/taste.list ./name-generator.sh\nNOUN_FILE=alternative-nouns/us_presidents.list ADJ_FILE=alternative-adjectives/positive.list ./name-generator.sh\n```\n\nSpecify a count:\n\ne.g.\n\n```\ncounto=5 NOUN_FILE=alternative-nouns/greek_gods.list ADJ_FILE=alternative-adjectives/taste.list ./name-generator.sh\ntangy-apheliotes\nrancid-styx\ndelicious-dysis\nsweet-proioxis\nrotten-hedone\n```\n\n## Customization\n\nOriginally I was going to just throw files in the noun and adjective directories, however, this lead to heavier 'weights' for the lines in the smaller files, so I am concatenating into a single files at this point.\n\nHowever, if you were to place files in the noun or adjectives directories they would be randomly picked from for the adjective and noun files.\n\nTo add your own nouns and adjectives, create text files in the `alternative-nouns` and `alternative-adjectives` directories. Each file should contain one word per line.\n\nAnd then utilize them by specifying the env vars NOUN_FILE and ADJ_FILE i.e.:\n\n```\nNOUN_FILE=alternative-nouns/greek_gods.list ADJ_FILE=alternative-adjectives/taste.list ./name-generator.sh\nNOUN_FILE=alternative-nouns/us_presidents.list ADJ_FILE=alternative-adjectives/positive.list ./name-generator.sh\n```\n\n## Requirements\n\n* Python 3.x (if you use the name-generatory.py script)\n* A Unix-like operating system (tested on Linux)\n\n## Troubleshooting\n\nIf you encounter any issues, check the following:\n\n* Make sure you have Python installed on your system.\n* Ensure that the `nouns` and `adjectives` directories are in the same directory as the script.\n* Check that the text files in the `nouns` and `adjectives` directories are formatted correctly (one word per line).\n\n## Contributing\n\nIf you'd like to contribute to this project, please fork the repository and submit a pull request with your changes.\n\n## Funniest generations\n\nworse-bunghole\n\ninappropriate-middleman\n\nsordid-pronoun\n\nheavenly-lordstanly\n\njoyous-snookie\n\noverrated-truffle\n\nstaunch-djolu\n\ndiscrete-concrete\n\nfacetious-tool\n\nbrainless-rebel\n\nartless-lunch\n\nunattractive-prevention\n\npurported-teila\n\nmeaningless-nash\n\nhazardous-master\n\nashamed-bimka\n\ngasping-rennie\n\nresentful-antibody\n\nholistic-zisoux\n\n# Testing\n\n```\nmake test                                           \n./test/bats/bin/bats test/test.bats\ntest.bats\n ✓ test name-generator at 10\n ✓ test name-generator at 44\n ✓ test NameGenerator at 10\n ✓ test NameGenerator at 55\n ✓ test name-generator_go at 10\n ✓ test name-generator_go at 12399\n ✓ test name-generator.sh at 10\n ✓ test name-generator.sh at 22\n ✓ test name-generator.bash at 10\n ✓ test name-generator.bash at 33\n ✓ test name-generator.zsh at 10\n ✓ test name-generator.zsh at 66\n ✓ test name-generator.py at 10\n ✓ test name-generator.py at 77\n ✓ test name-generator.pl at 10\n ✓ test name-generator.pl at 75\n ✓ test name-generator.js at 10\n ✓ test name-generator.js at 88\n ✓ test name-generator-sync.js at 10\n ✓ test name-generator-sync.js at 99\n ✓ test /home/thoth/.cargo/target/debug/name-generator at 10\n ✓ test /home/thoth/.cargo/target/debug/name-generator at 33433\n ✓ test name-generator.rb at 10\n ✓ test name-generator.rb at 83\n ✓ test name-generator_haskell.hs at 10\n ✓ test name-generator_haskell.hs at 83\n ✓ test sh test/test\n ✓ test bash test/test\n ✓ test perl test/test\n ✓ test ruby test/test\n ✓ test zsh test/test\n ✓ test go test/test\n ✓ test java test/test\n ✓ test jssync test/test\n ✓ test js test/test\n ✓ test py test/test\n ✓ test rust test/test\n ✓ test haskell test/test\n ✓ test c test/test\n\n39 tests, 0 failures\n```\n\n\n\n# benchmarks\n\n`./benchark.sh`\n\nThe rust implementation was able to achieve 2 million results with at max 3 duplicates max in under 35 seconds\n\n## Language Deathmatch!!!\n\nwhat language is fastest? I have sh, bash, zsh, c, python, javascript, and rust now in this project:\nhttps://github.com/joshuacox/name-generator\nTLDR at low counts C dominates, but rust and python quickly take over at higher counts and rust is king at very large iterations\n\nalso created 9,530,416 unique names out of 10 million in under two minutes:\n\n```\nexport counto=10000000 \u0026\u0026 time /home/thoth/.cargo/target/debug/name-generator |sort|uniq -c|wc -l  \n9530416\n/home/thoth/.cargo/target/debug/name-generator  30.70s user 11.94s system 56% cpu 1:15.45 total\nsort  72.52s user 9.85s system 73% cpu 1:51.85 total\nuniq -c  2.84s user 0.32s system 2% cpu 1:51.85 total\n```\n\n[![asciicast](https://asciinema.org/a/dRhBeZltkuInh3eF0pOREJACA.svg)](https://asciinema.org/a/dRhBeZltkuInh3eF0pOREJACA)\n\nIt is intersting to note that at `export counto=2` the c implementation is fastest, then go, rust, the shell implementations, javascript, then java, and lastly python\n\n```\n  ./name-generator ran\n    1.23 ± 0.38 times faster than ./name-generator_go\n    1.97 ± 0.73 times faster than /home/thoth/.cargo/target/debug/name-generator\n    3.84 ± 1.03 times faster than ./name-generator.zsh\n    3.84 ± 1.02 times faster than ./name-generator.sh\n    3.94 ± 1.04 times faster than ./name-generator.bash\n    9.48 ± 3.13 times faster than ./name-generator.js\n   10.42 ± 3.49 times faster than ./name-generator-sync.js\n   14.58 ± 3.99 times faster than java NameGenerator\n   25.12 ± 6.79 times faster than ./name-generator.py\n```\n\nBut at a counto of 12 go and rust surpass the C, the shells hanging in the middle of the pack, Java passes javascript\n\n```\n  ./name-generator_go ran\n    1.61 ± 0.48 times faster than /home/thoth/.cargo/target/debug/name-generator\n    3.28 ± 0.90 times faster than ./name-generator\n    9.48 ± 1.85 times faster than ./name-generator.zsh\n   10.82 ± 2.54 times faster than ./name-generator.bash\n   10.86 ± 2.40 times faster than ./name-generator.sh\n   11.63 ± 2.44 times faster than java NameGenerator\n   13.68 ± 3.15 times faster than ./name-generator.js\n   16.84 ± 3.30 times faster than ./name-generator-sync.js\n   19.22 ± 3.80 times faster than ./name-generator.py\n```\n\nAt a counto of 25 java and asynchronous javascript charge ahead of the shells, and python begins to gather steam, with synchronous javascript dead last\n\n```\n  ./name-generator_go ran\n    1.74 ± 0.42 times faster than /home/thoth/.cargo/target/debug/name-generator\n    5.85 ± 0.72 times faster than ./name-generator\n   12.30 ± 2.17 times faster than java NameGenerator\n   19.45 ± 2.48 times faster than ./name-generator.js\n   20.63 ± 2.66 times faster than ./name-generator.zsh\n   21.01 ± 3.30 times faster than ./name-generator.py\n   21.74 ± 2.41 times faster than ./name-generator.bash\n   21.76 ± 2.36 times faster than ./name-generator.sh\n   29.58 ± 3.43 times faster than ./name-generator-sync.js\n```\n\nAt a counto of 50 python overtakes javascript and zsh\n\n```\n  ./name-generator_go ran\n    1.67 ± 0.48 times faster than /home/thoth/.cargo/target/debug/name-generator\n   11.43 ± 2.45 times faster than ./name-generator\n   11.96 ± 2.92 times faster than java NameGenerator\n   21.74 ± 4.84 times faster than ./name-generator.py\n   28.09 ± 6.11 times faster than ./name-generator.js\n   38.01 ± 7.95 times faster than ./name-generator.zsh\n   40.90 ± 8.50 times faster than ./name-generator.bash\n   41.64 ± 8.71 times faster than ./name-generator.sh\n   47.86 ± 10.91 times faster than ./name-generator-sync.js\n```\n\nAt a counto of 100 java and python overtake the C\n\n```\n  ./name-generator_go ran\n    1.73 ± 0.54 times faster than /home/thoth/.cargo/target/debug/name-generator\n   13.64 ± 1.39 times faster than java NameGenerator\n   21.70 ± 1.70 times faster than ./name-generator.py\n   25.97 ± 1.98 times faster than ./name-generator\n   53.89 ± 3.55 times faster than ./name-generator.js\n   79.16 ± 4.51 times faster than ./name-generator.zsh\n   81.36 ± 4.77 times faster than ./name-generator.sh\n   83.00 ± 5.39 times faster than ./name-generator.bash\n   83.13 ± 5.15 times faster than ./name-generator-sync.js\n```\n\nAt a counto of 250 the synchronous javascript pulls ahead of the shells\n\n```\n  ./name-generator_go ran\n    1.73 ± 0.65 times faster than /home/thoth/.cargo/target/debug/name-generator\n   15.11 ± 4.05 times faster than java NameGenerator\n   23.15 ± 6.14 times faster than ./name-generator.py\n   66.67 ± 18.06 times faster than ./name-generator\n  124.18 ± 33.03 times faster than ./name-generator.js\n  206.49 ± 54.98 times faster than ./name-generator-sync.js\n  208.77 ± 55.23 times faster than ./name-generator.zsh\n  223.60 ± 59.11 times faster than ./name-generator.bash\n  226.21 ± 59.86 times faster than ./name-generator.sh\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshuacox%2Fname-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshuacox%2Fname-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshuacox%2Fname-generator/lists"}