haskell-emacs icon indicating copy to clipboard operation
haskell-emacs copied to clipboard

Use the new module support coming in Emacs 25

Open jwiegley opened this issue 9 years ago • 9 comments

This is a great project! I wonder if you could achieve even better integration by using the new support for dynamically loaded C modules coming in Emacs 25.1. It would require a little more boilerplate to get a Haskell library "ready" for inclusion into Emacs, but it should eliminate some of the marshalling overhead in some cases.

jwiegley avatar Aug 30 '16 19:08 jwiegley

Hi John!

I discussed this with Florian a little while ago - don't think he'll mind me posting.

Florian: """ I must confess that I didn't know about the native modules. It seems to me that the only advantage of the native modules are the avoidance of the pipe overhead, but with the big disadvantage of having to recompile emacs and not beeing able to distribute via melpa.

I guess I'll wait a bit and look how it works """

Me: """" I don't think you have to recompile emacs - it loads .so files. I think you could use the same model - I started with https://github.com/mwotton/emacsplugin which shows how you can compile a .so separately, then require it in emacs.

I agree that unless you can show the pipe overhead is really killing you it doesn't make much sense, and in any case it'll take a while for everyone to upgrade to 25. """

mwotton avatar Aug 30 '16 20:08 mwotton

You are right, recompiling Emacs is not necessary. And also that if the overhead isn't killing you (if the module is largely computational, with small inputs and outputs), then piping is perfectly fine.

jwiegley avatar Aug 30 '16 20:08 jwiegley

Hey John, what an honor to read your words on my tiny hobbyist project (I've actually got a totally different profession). At least for now, I'd suggest to ignore the overhead until there pops up a high perf usecase, or are you limited in a specific case?

knupfer avatar Sep 04 '16 19:09 knupfer

You are right, @knupfer, ignoring until a pressing need arises is the wise course. Good luck with your totally different profession! :)

jwiegley avatar Sep 04 '16 23:09 jwiegley

@jwiegley is there a tutorial for emacs modules? I'd like to make a "hello world" modules that (say) sorts a buffer via haskell.

sboosali avatar Jan 20 '17 23:01 sboosali

This looks like it may be a good starting point, although I have not tried it yet myself: http://diobla.info/blog-archive/modules-tut.html

jwiegley avatar Jan 21 '17 00:01 jwiegley

Thanks!

Yeah, I saw that a few months ago, but I thought you could load the module dynamically, without recompiling Emacs (or i've misunderstood the process).

On Fri, Jan 20, 2017 at 4:02 PM, John Wiegley [email protected] wrote:

This looks like it may be a good starting point, although I have not tried it yet myself: http://diobla.info/blog-archive/modules-tut.html

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/knupfer/haskell-emacs/issues/60#issuecomment-274211980, or mute the thread https://github.com/notifications/unsubscribe-auth/ACNoMZbOzmyKCquD8fxJqn6G_DmhOSZIks5rUUsjgaJpZM4Jw6kD .

--

(this message was composed with dictation: charitably interpret typos)Sam Boosalis

sboosali avatar Jan 21 '17 01:01 sboosali

Yeah, I saw that a few months ago, but I thought you could load the module dynamically, without recompiling Emacs (or i've misunderstood the process).

Ah, then I didn't read carefully enough. Try this instead: http://nullprogram.com/blog/2016/11/05/

jwiegley avatar Jan 21 '17 02:01 jwiegley

This is extremely helpful, thanks again!

On Fri, Jan 20, 2017 at 6:21 PM, John Wiegley [email protected] wrote:

Yeah, I saw that a few months ago, but I thought you could load the module dynamically, without recompiling Emacs (or i've misunderstood the process).

Ah, then I didn't read carefully enough. Try this instead: http://nullprogram.com/blog/2016/11/05/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/knupfer/haskell-emacs/issues/60#issuecomment-274226138, or mute the thread https://github.com/notifications/unsubscribe-auth/ACNoMcV6BNwnpgWig71VXZp2o-qw28iSks5rUWvAgaJpZM4Jw6kD .

--

(this message was composed with dictation: charitably interpret typos)Sam Boosalis

sboosali avatar Jan 21 '17 02:01 sboosali