{"id":15010937,"url":"https://github.com/sergv/emacs-module","last_synced_at":"2025-04-05T17:04:33.769Z","repository":{"id":45059460,"uuid":"135213196","full_name":"sergv/emacs-module","owner":"sergv","description":"Wrappers around emacs-module.h to write Emacs modules in Haskell","archived":false,"fork":false,"pushed_at":"2024-12-15T19:22:47.000Z","size":268,"stargazers_count":59,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T16:04:02.226Z","etag":null,"topics":["emacs","emacs-modules","haskell","haskell-bindings"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","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/sergv.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}},"created_at":"2018-05-28T22:02:55.000Z","updated_at":"2025-03-02T23:43:31.000Z","dependencies_parsed_at":"2023-02-08T02:32:55.826Z","dependency_job_id":"d9383876-ea46-453a-9a70-0bb8f9d9116f","html_url":"https://github.com/sergv/emacs-module","commit_stats":{"total_commits":171,"total_committers":2,"mean_commits":85.5,"dds":0.005847953216374324,"last_synced_commit":"d02fdf903af28120f7936e5375b48c97d8a11b6f"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergv%2Femacs-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergv%2Femacs-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergv%2Femacs-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergv%2Femacs-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergv","download_url":"https://codeload.github.com/sergv/emacs-module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369953,"owners_count":20927928,"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":["emacs","emacs-modules","haskell","haskell-bindings"],"created_at":"2024-09-24T19:37:39.561Z","updated_at":"2025-04-05T17:04:33.734Z","avatar_url":"https://github.com/sergv.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Haskell package for writing Emacs modules\n\n## Why would anyone want to write Emacs modules in Haskell?\nEmacs Lisp is not a young language and can go quite a long way, but\nit has a couple of issues that are not going to be solved any time soon:\n\n- It’s dynamically typed which makes refactoring large extensions a pain\n- It’s intepreted and is quite slow. It might be argued that editors don’t\n  need much computing power, but from time to time computation-intensive\n  tasks do occur. For example, fuzzy matching provided by the cool\n  [flx.el](https://github.com/lewang/flx) package and used by great\n  [ivy.el](https://github.com/abo-abo/swiper) package to quickly find things.\n- Somewhat related to the previous point, there’s virtually no support\n  for parallelising computations. There’re [adavances](https://www.gnu.org/software/emacs/draft/manual/html_node/elisp/Threads.html) on adding threads\n  to Emacs lisp, but this only provides [concurrency, but no parallelism](https://stackoverflow.com/questions/1050222/what-is-the-difference-between-concurrency-and-parallelism).\n\n  Haskell is well known for solving points 1 and 3 outlined above.\n  For me it also solves point 2 by providing enough performance and adding\n  parallelism on top of it.\n\n  If you think this might be a good idea and would like to see what\n  this package can do for you, you can look at part of\n  [my emacs config](https://github.com/sergv/emacs-native/tree/master/lib/Emacs)\n  that uses this package to implement things like\n\n  + Rewrite of `flx.el` that leverages parallelism\n  + Fast search across filesystem\n  + Concurrrent grep reimplementation (somewhat dubious since things like `ripgrep` exist)\n\n## FAQ\n### How do I start writing my own extensions?\nSee tutorial at https://github.com/sergv/emacs-module/blob/master/Tutorial.md.\n\nAlso check out\n[this package’s tests](https://github.com/sergv/emacs-module/blob/master/test/src/Emacs/TestsInit.hs).\n\n### What about Windows?\nIt works, Cabal can build a dll for you.\n\n### How it’s related to [haskell-emacs](https://github.com/knupfer/haskell-emacs)?\nThe `haskell-emacs` aims to address the same problem - writing Emacs\nextensions in Haskell, but uses different approach. It seems to use\nsome kind of marshalling scheme to make Emacs data available in\nHaskell with a caveat that not all Emacs types can be converted (e.g.\nbuffers cannot be typically serialised). Presumably, an extension\nbuilt with this project will look like an executable that reads sexps\nfrom stdin and produces output on stdout. Or, possibly, as a daemon\nprocess that communicates with Emacs over network.\n\nThis project is a bit different. It wraps Emacs C API for writing new\nextensions that can manipulate Emacs values directly, without\nmarhsalling. In this approach, an extension will look like a shared\nlibrary/dll that can be loaded by standard emacs with `(load \"/tmp/libmy-ext.so\")`.\n\n## Supported GHC versions\n\nTested with GHC `9.2`, `9.4`, `9.6`, `9.8`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergv%2Femacs-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergv%2Femacs-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergv%2Femacs-module/lists"}