Yi (editor)
Encyclopedia
Yi is a text editor
Text editor
A text editor is a type of program used for editing plain text files.Text editors are often provided with operating systems or software development packages, and can be used to change configuration files and programming language source code....

 written and extensible in Haskell
Haskell (programming language)
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language. As a functional programming language, the...

. The goal of Yi is to provide a flexible, powerful and correct editor core dynamically scriptable
Scripting language
A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...

 in Haskell.

Yi used to be a Haskell interpreter
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

, very much like Emacs
Emacs
Emacs is a class of text editors, usually characterized by their extensibility. GNU Emacs has over 1,000 commands. It also allows the user to combine these commands into macros to automate work.Development began in the mid-1970s and continues actively...

 is an Emacs Lisp
Emacs Lisp
Emacs Lisp is a dialect of the Lisp programming language used by the GNU Emacs and XEmacs text editors . It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C...

 interpreter; however, the current version of Yi recompiles the code that describes its settings (including editing modes and extensions).
Specifically, Yi is implemented as a small executable program which compiles through
GHC
Glasgow Haskell Compiler
The Glorious Glasgow Haskell Compilation System, more commonly known as the Glasgow Haskell Compiler or GHC, is an open source native code compiler for the functional programming language Haskell. The lead developers are Simon Peyton Jones and Simon Marlow...

 the larger body of code which actually constitutes a useful editor; this small 'kernel' can repeatedly recompile (and thus type-check) the extensions. This makes it easy to dynamically hack, experiment and modify Yi despite it being written in a strongly statically typed language. Using Haskell as a first-class extension language means that other libraries and tools written in Haskell are also readily usable in editor code.

The long term goal of the project is to in essence make Yi the editor of choice for Haskell hackers in much the same way that Emacs is the editor of choice for Lisp programmers.

Front ends

Yi can use either gtk2hs
GTK+
GTK+ is a cross-platform widget toolkit for creating graphical user interfaces. It is licensed under the terms of the GNU LGPL, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the X Window System, along with Qt.The name GTK+ originates from GTK;...

 or vty as front ends, so users can choose their favorite interface. There is also an experimental Cocoa
Cocoa (API)
Cocoa is Apple's native object-oriented application programming interface for the Mac OS X operating system and—along with the Cocoa Touch extension for gesture recognition and animation—for applications for the iOS operating system, used on Apple devices such as the iPhone, the iPod Touch, and...

 frontend.

"Emulation modes"

The primary emulation modes for Yi are vim
Vim (text editor)
Vim is a text editor written by Bram Moolenaar and first released publicly in 1991. Based on the vi editor common to Unix-like systems, Vim is designed for use both from a command line interface and as a standalone application in a graphical user interface...

 and emacs
Emacs
Emacs is a class of text editors, usually characterized by their extensibility. GNU Emacs has over 1,000 commands. It also allows the user to combine these commands into macros to automate work.Development began in the mid-1970s and continues actively...

. Keybindings for vi
Vi
vi is a screen-oriented text editor originally created for the Unix operating system. The portable subset of the behavior of vi and programs based on it, and the ex editor language supported within these programs, is described by the Single Unix Specification and POSIX.The original code for vi...

, mg
Mg (editor)
mg, originally called MicroGnuEmacs, , is a public-domain text editor that runs on Unix-like operating systems. It is based on MicroEMACS, but intended to more closely resemble GNU Emacs while still maintaining a small memory footprint and fast speed...

 and nano
Nano (text editor)
nano is a text editor for Unix-like computing systems or operating environments using a command line interface. It emulates the Pico text editor, part of the Pine email client, and also provides additional functionality....

and others are also provided. Other editor interfaces can be written by the user to extend Yi.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK