{"id":13486070,"url":"https://github.com/luafun/luafun","last_synced_at":"2026-04-04T12:57:30.844Z","repository":{"id":11962621,"uuid":"14534744","full_name":"luafun/luafun","owner":"luafun","description":"Lua Fun is a high-performance functional programming library for Lua designed with LuaJIT's trace compiler in mind.","archived":false,"fork":false,"pushed_at":"2025-04-15T14:55:30.000Z","size":542,"stargazers_count":2235,"open_issues_count":43,"forks_count":111,"subscribers_count":66,"default_branch":"master","last_synced_at":"2026-02-20T09:33:40.432Z","etag":null,"topics":["functional-programming","lua","luajit","luarocks"],"latest_commit_sha":null,"homepage":"https://luafun.github.io/","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luafun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING.md","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}},"created_at":"2013-11-19T19:02:26.000Z","updated_at":"2026-02-17T20:05:30.000Z","dependencies_parsed_at":"2023-12-22T13:10:31.090Z","dependency_job_id":"9af8a1f8-6861-4b35-a1b3-b05d52ff301d","html_url":"https://github.com/luafun/luafun","commit_stats":{"total_commits":62,"total_committers":15,"mean_commits":4.133333333333334,"dds":"0.32258064516129037","last_synced_commit":"02c39fa7430689b89a799e3bf95797aac2067210"},"previous_names":["rtsisyk/luafun"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/luafun/luafun","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luafun%2Fluafun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luafun%2Fluafun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luafun%2Fluafun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luafun%2Fluafun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luafun","download_url":"https://codeload.github.com/luafun/luafun/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luafun%2Fluafun/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31400460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: 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":["functional-programming","lua","luajit","luarocks"],"created_at":"2024-07-31T18:00:38.930Z","updated_at":"2026-04-04T12:57:30.822Z","avatar_url":"https://github.com/luafun.png","language":"Lua","readme":"Lua Functional\n==============\n\n\u003cimg src=\"/doc/logo.png\" align=\"right\" width=\"174px\" height=\"144px\" /\u003e\n\n**Lua Fun** is a high-performance functional programming library for [Lua]\ndesigned with [LuaJIT's trace compiler][LuaJIT] in mind.\n\nLua Fun provides a set of more than 50 programming primitives typically\nfound in languages like Standard ML, Haskell, Erlang, JavaScript, Python and\neven Lisp. High-order functions such as ``map``, ``filter``, ``reduce``,\n``zip``, etc., make it easy to **write simple and efficient functional code**.\n\nLet's see an example:\n\n```lua\n\u003e -- Functional style\n\u003e require \"fun\" ()\n\u003e -- calculate sum(x for x^2 in 1..n)\n\u003e n = 100\n\u003e print(reduce(operator.add, 0, map(function(x) return x^2 end, range(n))))\n328350\n\n\u003e -- Object-oriented style\n\u003e local fun = require \"fun\"\n\u003e -- calculate sum(x for x^2 in 1..n)\n\u003e print(fun.range(n):map(function(x) return x^2 end):reduce(operator.add, 0))\n328350\n```\n\n**Lua Fun** takes full advantage of the innovative **tracing JIT compiler**\nto achieve transcendental performance on nested functional expressions.\nFunctional compositions and high-order functions can be translated into\n**efficient machine code**. Can you believe it? Just try to run the example\nabove with ``luajit -jdump`` and see what happens:\n\n```asm\n-- skip some initialization code --\n-\u003eLOOP:\n0bcaffd0  movaps xmm5, xmm7\n0bcaffd3  movaps xmm7, xmm1\n0bcaffd6  addsd xmm7, xmm5\n0bcaffda  ucomisd xmm7, xmm0\n0bcaffde  jnb 0x0bca0024        -\u003e5\n0bcaffe4  movaps xmm5, xmm7\n0bcaffe7  mulsd xmm5, xmm5\n0bcaffeb  addsd xmm6, xmm5\n0bcaffef  jmp 0x0bcaffd0        -\u003eLOOP\n---- TRACE 1 stop -\u003e loop\n```\n\nThe functional chain above was translated by LuaJIT to (!) **one machine loop**\ncontaining just 10 CPU assembly instructions without CALL. Unbelievable!\n\nReadable? Efficient? Can your Python/Ruby/V8 do better?\n\nStatus\n------\n\n**Lua Fun** is in an early alpha stage. The library fully\n[documented][Documentation] and covered with unit tests.\n\n[![Build Status](https://travis-ci.org/luafun/luafun.png)][Travis]\n\nLuaJIT 2.1 alpha is recommended. The library designed in mind of fact that\n[LuaJIT traces tail-, up- and down-recursion][LuaJIT-Recursion] and has a lot of\n[byte code optimizations][LuaJIT-Optimizations]. Lua 5.1-5.3 are also\nsupported.\n\nThis is **master** (development) branch. API may be changed without any special\nnotice. Please use **stable** branch for your production deployments.\nIf you still want to use **master**, please don't forget to grep `git log`\nfor *Incompatible API changes* message. Thanks!\n\nPlease check out [documentation][Documentation] for more information.\n\nMisc\n----\n\n**Lua Fun** is distributed under the [MIT/X11 License] -\n(same as Lua and LuaJIT).\n\nThe library was written to use with [Tarantool] - an efficient in-memory\nstore and an asynchronous Lua application server.\n\nSee Also\n--------\n\n* [Documentation]\n* [RockSpec]\n* [RPM/DEB packages](https://packagecloud.io/rtsisyk/master)\n* [Hacking]\n* lua-l@lists.lua.org\n* luajit@freelists.org\n* roman@tsisyk.com\n\n [Lua]: https://www.lua.org/\n [LuaJIT]: https://luajit.org/luajit.html\n [LuaJIT-Recursion]: http://lambda-the-ultimate.org/node/3851#comment-57679\n [LuaJIT-Optimizations]: http://wiki.luajit.org/Optimizations\n [MIT/X11 License]: https://opensource.org/licenses/MIT\n [Tarantool]: https://github.com/tarantool/tarantool\n [Getting Started]: https://luafun.github.io/getting_started.html\n [Documentation]: https://luafun.github.io/\n [Travis]: https://travis-ci.org/luafun/luafun\n [RockSpec]: https://raw.github.com/luafun/luafun/master/fun-scm-1.rockspec\n [Hacking]: HACKING.md\n\nPlease **\"Star\"** the project on GitHub to help it to survive! Thanks!\n\n*****\n\n**Lua Fun**. Simple, Efficient and Functional. In Lua. With JIT.\n","funding_links":[],"categories":["Lua","\u003ca name=\"helper\"\u003e\u003c/a\u003eHelper Libraries","\u003e 1k ★","Libraries","资源","Resources"],"sub_categories":["Programming Language","Utility Belts","Programming Paradigms"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluafun%2Fluafun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluafun%2Fluafun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluafun%2Fluafun/lists"}