{"id":15558316,"url":"https://github.com/gobengo/node-polyglot-fibonacci","last_synced_at":"2025-03-29T15:30:04.502Z","repository":{"id":31336043,"uuid":"34898679","full_name":"gobengo/node-polyglot-fibonacci","owner":"gobengo","description":"experiment. bindings to fibonacci implementation in non-JavaScript languages (defaults to C++)","archived":false,"fork":false,"pushed_at":"2015-05-01T10:44:31.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T14:23:39.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/gobengo.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}},"created_at":"2015-05-01T10:40:00.000Z","updated_at":"2015-05-01T10:44:31.000Z","dependencies_parsed_at":"2022-08-24T04:31:07.910Z","dependency_job_id":null,"html_url":"https://github.com/gobengo/node-polyglot-fibonacci","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/gobengo%2Fnode-polyglot-fibonacci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobengo%2Fnode-polyglot-fibonacci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobengo%2Fnode-polyglot-fibonacci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobengo%2Fnode-polyglot-fibonacci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gobengo","download_url":"https://codeload.github.com/gobengo/node-polyglot-fibonacci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246204052,"owners_count":20740239,"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":"2024-10-02T15:30:08.124Z","updated_at":"2025-03-29T15:30:04.481Z","avatar_url":"https://github.com/gobengo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-polyglot-fibonacci\n\nAn experiment in writing node.js bindings to other languages.\n\nThe bindings are to a function that calculates the Nth Fibonacci term.\n\n## Implementations\n\n* [C++](./lib/fibonacci.cc) - [bindings](./lib/fibonacci-cc.js) via [node-gyp](https://github.com/TooTallNate/node-gyp)\n    - recursive\n    - #TODO: recursive memoized\n    - iterative\n* [JavaScript](../lib/fibonacci-js.js)\n    - recursive\n    - #TODO: recursive memoized\n    - iterative\n* #TODO\n    - Rust - [example](https://github.com/alexcrichton/rust-ffi-examples/tree/master/node-to-rust/src)\n    - C++ via node-ffi. [example](https://github.com/node-ffi/node-ffi/blob/master/example/factorial/factorial.c) \n\n## Use it\n\n```\n⚡ FIBONACCI_IMPL=lib/fibonacci-cc.js node index.js 42\n433494437\n```\n```\n⚡ FIBONACCI_IMPL=lib/fibonacci-js.js node index.js 42\n433494437\n```\n\n## Compare Implementations\n\n```\n⚡ make compare N=42\nnode bin/compare.js\nComparing implementations of Fibonacci(42)\n1148.6017629394532ms - C++.recursive\n0.0134940185546875ms - C++.iterative\n5944.805768920898ms - JavaScript.recursive\n0.0868218994140625ms - JavaScript.iterative\n\nThe fastest was C++.iterative\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgobengo%2Fnode-polyglot-fibonacci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgobengo%2Fnode-polyglot-fibonacci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgobengo%2Fnode-polyglot-fibonacci/lists"}