Giter Club home page Giter Club logo

emacs-module's Introduction

A Haskell package for writing Emacs modules

Why would anyone want to write Emacs modules in Haskell?

Emacs Lisp is not a young language and can go quite a long way, but it has a couple of issues that are not going to be solved any time soon:

  • It’s dynamically typed which makes refactoring large extensions a pain

  • It’s intepreted and is quite slow. It might be argued that editors don’t need much computing power, but from time to time computation-intensive tasks do occur. For example, fuzzy matching provided by the cool flx.el package and used by great ivy.el package to quickly find things.

  • Somewhat related to the previous point, there’s virtually no support for parallelising computations. There’re adavances on adding threads to Emacs lisp, but this only provides concurrency, but no parallelism.

    Haskell is well known for solving points 1 and 3 outlined above. For me it also solves point 2 by providing enough performance and adding parallelism on top of it.

    If you think this might be a good idea and would like to see what this package can do for you, you can look at part of my emacs config that uses this package to implement things like

    • Rewrite of flx.el that leverages parallelism
    • Fast search across filesystem
    • Concurrrent grep reimplementation (somewhat dubious since things like ripgrep exist)

FAQ

How do I start writing my own extensions?

See tutorial at https://github.com/sergv/emacs-module/blob/master/Tutorial.md.

Also check out this package’s tests.

What about Windows?

It works, Cabal can build a dll for you.

How it’s related to haskell-emacs?

The haskell-emacs aims to address the same problem - writing Emacs extensions in Haskell, but uses different approach. It seems to use some kind of marshalling scheme to make Emacs data available in Haskell with a caveat that not all Emacs types can be converted (e.g. buffers cannot be typically serialised). Presumably, an extension built with this project will look like an executable that reads sexps from stdin and produces output on stdout. Or, possibly, as a daemon process that communicates with Emacs over network.

This project is a bit different. It wraps Emacs C API for writing new extensions that can manipulate Emacs values directly, without marhsalling. In this approach, an extension will look like a shared library/dll that can be loaded by standard emacs with (load "/tmp/libmy-ext.so").

Supported GHC versions

Tested with GHC 9.2, 9.4, 9.6, 9.8.

emacs-module's People

Contributors

sergv avatar widdershin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

emacs-module's Issues

Upstreaming NonNullPtr to base

Hi @sergv! I was looking for a way to represent non-null pointers for FFI and I came across your module. I'd like to ask you permission to open a proposal to upstream the NonNullPtr type and its associated allocation functions. Copyright to you would be preserved in the module meta-data.

Is this something with which you would be okay?

licensing

since you link against the GPL-licensed emacs-module.h, doesn't the project need to be at least as restrictively licensed too? e.g. something like

license: GPL-3.0-or-later

in the .cabal instead of BSD3?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.