
Ecaml – Writing Emacs Plugins in OCaml - cm3
https://github.com/janestreet/ecaml
======
qwertyuiop924
Can it be true? Can we finally write our Emacs plugins in Scheme or Common
Lisp, and have them work?

Wait, then we'll have 2 GCs fighting over data. Dang it. We were almost free!

Seriously, though, I do have some concerns. If the new Plugin API becomes
widely used enough, elisp may become a second-class citizen in the ecosystem,
which would mean that emacs would no longer be easily programmable. That would
be bad.

~~~
wcummings
Exactly, the elisp monoculture is a feature not a bug.

~~~
qwertyuiop924
Well, so long as extensions have to pass elisp data, it's okay-ish.

------
padator
What about an Emacs-like editor fully written in OCaml:
[https://github.com/aryx/fork-efuns](https://github.com/aryx/fork-efuns) Easy
to write an Emacs plugin then ...

------
bluejekyll
Does anyone have a favorite learning OCaml resource?

~~~
zem
real world ocaml is pretty good:
[https://realworldocaml.org/](https://realworldocaml.org/)

there's also a mooc that i've heard good things about: [https://www.fun-
mooc.fr/courses/parisdiderot/56002S02/sessio...](https://www.fun-
mooc.fr/courses/parisdiderot/56002S02/session02/about)

------
junke
I like both Emacs and OCaml but I can't see a case where I would want to use
Ecaml. In what situation is it useful?

~~~
cm3
In Emacs 25 you can write native plugins loaded dynamically at runtime. With
this you can do it in OCaml instead of C. Of course you can write it in
anything else that will expose the right C interface.

~~~
emidln
I suppose that begets the question, why would I write a native plugin instead
of using elisp? I'm guessing the answer is so I can do some sort of background
work in another thread?

~~~
mookid11
You can use the ocaml toolchain (for instance: ocamllex and ocamlyacc) and
stop writing ad hoc parsers.

~~~
junke
That makes sense. Thanks.

