{"id":18111716,"url":"https://github.com/afaur/elixir-fib-solver-gen-server","last_synced_at":"2025-10-17T14:55:05.949Z","repository":{"id":83721520,"uuid":"149697760","full_name":"afaur/elixir-fib-solver-gen-server","owner":"afaur","description":"Fibonacci number solver that operates as a process using GenServer. The Fibonacci Solver is started and monitored by a supervisor. It builds up answers as it decrements the provided input until reaching 2. It caches the solved result and all answers it solved to figure it out.","archived":false,"fork":false,"pushed_at":"2018-09-25T17:42:12.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T13:56:54.661Z","etag":null,"topics":["elixir","fib","fibonacci","fibonacci-numbers","fibonacci-sequence","genserver"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afaur.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":"2018-09-21T02:19:09.000Z","updated_at":"2024-03-20T21:38:08.000Z","dependencies_parsed_at":"2023-03-12T16:00:25.261Z","dependency_job_id":null,"html_url":"https://github.com/afaur/elixir-fib-solver-gen-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaur%2Felixir-fib-solver-gen-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaur%2Felixir-fib-solver-gen-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaur%2Felixir-fib-solver-gen-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaur%2Felixir-fib-solver-gen-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afaur","download_url":"https://codeload.github.com/afaur/elixir-fib-solver-gen-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247452783,"owners_count":20941168,"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":["elixir","fib","fibonacci","fibonacci-numbers","fibonacci-sequence","genserver"],"created_at":"2024-11-01T01:07:16.730Z","updated_at":"2025-10-17T14:55:05.867Z","avatar_url":"https://github.com/afaur.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Project Overview\n  - Fibonacci number solver that operates as a process using GenServer\n  - The Fibonacci Solver is started and monitored by a supervisor\n  - Initial state cache contains a map of %{0 =\u003e 1, 1 =\u003e 1}\n  - It builds up answers as it decrements the provided input until reaching 2\n  - It caches the solved result and all answers it solved to figure it out\n\n## Benefits from Erlang\n  - Has one integer type and supports big integers, large numbers are computed\n      without any additional logic in our implementation.\n  - Map type in state will handle big integers as values.\n  - Pattern matching and function overloading add simplicity.\n  - Using a supervisor to monitor the fib process, it is restarted if it dies.\n  - Able to use genserver to implement state, and messaging from other processes.\n\n## Possible Enhancements\n  ### Current Functionality\n    If it knows the answer (from cache) it is provided instantly.\n  ### Possible Enhancement\n    Use the largest answer it already knows to help solve new unknown fibs.\n\n  ### Current Functionality\n    Caches a map %{input =\u003e result} of all known values.\n  ### Possible Enhancement\n    Setting a range used to qualify if it should cache a result.\n    This would minimize the memory footprint by storing less items.\n\n  ### Current Functionality\n    Right now the cache is stored as long as the process has not died.\n  ### Possible Enhancement\n    Option for if a value should leave after no cache hit in a duration.\n\n## Instructions\n```\niex -S mix run\n```\n\n## Example Output\n```\niex -S mix run\nErlang/OTP 21 [erts-10.0.7] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]\nInteractive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)\n\niex(1)\u003e Fib.solve 5\n{:ok, 5}\n\niex(2)\u003e Fib.solve 50\n{:ok, 12586269025}\n\niex(3)\u003e Fib.solve 500\n{:ok,\n 139423224561697880139724382870407283950070256587697307264108962948325571622863290691557658876222521294125}\n\niex(4)\u003e Fib.solve 5000\n{:ok,\n 3878968454388325633701916308325905312082127714646245106160597214895550139044037097010822916462210669479293452858882973813483102008954982940361430156911478938364216563944106910214505634133706558656238254656700712525929903854933813928836378347518908762970712033337052923107693008518093849801803847813996748881765554653788291644268912980384613778969021502293082475666346224923071883324803280375039130352903304505842701147635242270210934637699104006714174883298422891491273104054328753298044273676822977244987749874555691907703880637046832794811358973739993110106219308149018570815397854379195305617510761053075688783766033667355445258844886241619210553457493675897849027988234351023599844663934853256411952221859563060475364645470760330902420806382584929156452876291575759142343809142302917491088984155209854432486594079793571316841692868039545309545388698114665082066862897420639323438488465240988742395873801976993820317174208932265468879364002630797780058759129671389634214252579116872755600360311370547754724604639987588046985178408674382863125}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafaur%2Felixir-fib-solver-gen-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafaur%2Felixir-fib-solver-gen-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafaur%2Felixir-fib-solver-gen-server/lists"}