[ESS] Polymode is on MELPA

Vitalie Spinu spinuvit at gmail.com
Tue May 13 22:37:55 CEST 2014


 >>> Grant Rettke on Tue, 13 May 2014 09:12:01 -0500 wrote:

 > Thank you!

 > For folks new to polymode like myself, but coming form org-mode and
 > literate programming, may you please comment on some of the key
 > differences and philosophies behind polymode?

It is a new multiple-modes-in-the-same-buffer-mode and is designed to be
better and faster than anything else out there :). Still some work
needed for that, but it already works. The main idea is to use indirect
buffers for each submode separately. Because of this, polymode doesn't
re-install the modes each time you switch different code spans.

The key philosophy is the ease of extensibility. You should be able to
declare your own polymodes, exporters, weavers etc. in as much as 5
lines of code. Another "philosophy" is the hierarchical customization
paradigm. Because all objects (polymodes, submodes, weavers, exporters)
respect a well defined hierarchy of objects, it is enough to customize
parent objects and all children will inherit the customization. If you
are familiar with prototype OO paradigm, this is precisely it. For
example there is a root noweb polymode and other, more specific, noweb
polymodes (like poly-noweb+R-mode) that inherits from the root. By
customizing the root polymode, all children automatically inherit the
customization.

Another key feature as compared to other multi-modes is that polymode
tries to play well with the plethora of literate programming tools out
there. There are many tools, some more specific, some more generic than
others. That means that some weavers/exporters must be available only in
specific polymodes and there will multiple weavers/exporters for each
polymode. This demands an intricate dependency model, and I think I have
found a reasonably good paradigm for that. Namely, you first have to
develop an literate programming tool, say exporter, then you will
register it with a predefined polymode, say pm-noweb. This exporter then
will be available to all polymodes inherited from pm-noweb. You can have
a _default_ weaver/exporter for each polymode and you can also choose
the weaver/exporter interactively.

There is much more to it. I am in the process of preparing detailed
docs.


   Vitalie



More information about the ESS-help mailing list