[aklug] Re: My dream editor...?

From: Christopher Howard <christopher.howard@frigidcode.com>
Date: Fri May 20 2011 - 18:47:32 AKDT

On 05/20/2011 11:16 AM, Tim Johnson wrote:
> Christopher, do I take that to mean that the program itself is a
> binary that is created by compiling of haskell code? IOWS:
> haskell has both interpreter and compiler?
>

Not a Yi expert yet, so you'll have to settle for quotes:

"Yi is a text editor written and extensible in Haskell. The goal of the
Yi project is to provide a flexible, powerful and correct editor core
scriptable in Haskell. A principle of Yi is that any behaviour can be
programmed, so there exist vi, vim, emacs, mg, nano, joe and ee
frontends to Yi. Other editor interfaces can be written easily via a
lexer specification." -- original Yi homepage

"Some Lisp programs such as Emacs, but also the Linux kernel
(when fully modularised) are mostly dynamic; i.e., apart from
a small static core, the significant functionality is dynamically
loaded. In this paper, we explore fully dynamic applications in
Haskell where the static core is minimal and code is hot swap-
pable." -- paper "Dynamic Applications From the Ground Up"

"The static core, with the help of the dynamic linker, loads any con-
figuration data (as plugins) followed by the main application code.
Control is then transferred to the main application’s entry point—
its main function—and the program proper starts up. In Yi files are
opened, buffers allocated and the user may begin editing. . . .Note that
the Yi configuration plugins and the main applica-
tion are dynamically linked against each other so that plugins may
call application code (and vice versa). . . .During execution the user
may invoke the Haskell dynamic
linker library [24] to recompile and reload any configuration files,
or to reload the application itself. The state of the application is
preserved during reloading (hot swapping), with the result that new
code can be integrated or existing code be replaced, without having
to quit the application." -- ibid

There is more in the paper about hot code injection, dynamic
reconfiguration, and state preservation,

From what I understand so far, the core binary is a compiled Haskell
program, but most of the actual editor functionality are compiled
Haskell extensions, which are dynamically loaded.

Presumably you don't have to recompile your extensions every time you
start Yi (if they are already compiled you just load them) but I would
need to double check on that.

In answer to your second question: In GHCi (the Haskell compiler in
interactive mode) you can load any module dynamically, either from
pre-compiled object code, or "interpreted" from the source (that is,
compiled on the fly into byte code).

-- 
frigidcode.com
theologia.indicium.us
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri, 20 May 2011 18:47:32 -0800

This archive was generated by hypermail 2.1.8 : Fri May 20 2011 - 18:47:17 AKDT