Difference between revisions of "Yi"

From HaskellWiki
Jump to: navigation, search
(Shuffle sections)
(Delete outdated stuff, point to yi website instead)
(45 intermediate revisions by 21 users not shown)
Line 5: Line 5:
== About ==
== About ==
Yi is a text editor written and extensible in Haskell. The goal of Yi is
Yi is a text editor written in Haskell and extensible in Haskell.
to provide a flexible, powerful and correct editor core
scriptable in Haskell.
== External links ==
* A purely functional editor core;
* Website: http://yi-editor.github.io/
* Keybindings written as parsers of the input;
* Repository: https://github.com/yi-editor/yi
* Emacs and Vim emulations provided by default;
* Hackage page: http://hackage.haskell.org/package/yi
* Vty, Gtk2Hs, and (experimental) Cocoa frontends
* IRC channel: #yi on Freenode
The long term goal of the project is to make Yi the editor of choice for the haskell hacker.
The main short term goal is to maximize Yi's Fun Factor. This includes:
* improve hackability (and therefore architecture)
* add cool features
former Yi homepage: http://www.cse.unsw.edu.au/~dons/yi.html
== Get Yi ==
Stable release on Hackage:
*[http://hackage.haskell.org/cgi-bin/hackage-scripts/package/yi http://hackage.haskell.org/cgi-bin/hackage-scripts/package/yi]
:(NOTE: the 0.2 release does not work with recent versions of GHC/libraries, and is not supported at all. Please use the darcs repo version instead.)
Development repository:
darcs get --partial http://code.haskell.org/yi/
We try to keep the repository in a clean and buildable state, so it's "testable". If you have Darcs installed and a GHC 6.8.x installation, this is a better choice.
== Screenshots (0.3) ==
[[Image:Yi-20070409.png|thumb|right|500px|The GTK frontend]]
[[Image:Yi-20080114-vty.png|thumb|none|500px|The Vty frontend]]
== NEWS ==
(Recent items first)
* I gave a talk about incremental parsing in Yi at the Chalmers' FP workshop. Find the slides here: http://code.haskell.org/yi/doc/IncrementalParsing.odp
* preliminary Haskell-specific support
* many small usability enhancements
* Buffer modes
* Context-free (ie. non-regular) syntax highlighters
* Fast (incremental) syntax highlighters
* [[XMonad]]-style, static configuration (fast load!)
* More Vim emulation
* Many bugfixes
* Yi 0.3 released
* 'sdist' functionality
* Haddocked API
* Reverse incremental search
* "rope-like" structure for buffer (eg. for reading/editing huge log files)
* Experimental Cocoa frontend (OS X)
* More functionality of emacs/vim implemented
* Andy wrote a nice Yi 0.3 tutorial: http://nobugs.org/developer/yi/index.html (note that this tutorial probably will not work for darcs Yi/Yi 0.4)
* Yi is now hosted on code.haskell.org/yi
* Further simplify build process
== Bugs ==
Check/report bug reports here: [http://code.google.com/p/yi-editor/issues/list Google Code: yi-editor]
== FAQs ==
== Contribute ==
Get the repo here:
darcs get --partial http://code.haskell.org/yi/
Work on whatever you please, patches are always welcome. :)
Otherwise, see the complete list of open issues here:
(Note you can start working on all issues in
New/Accepted state, regardless of the owner of the issue.
-- you can send an email to the list with your plan if unsure)
Post your questions and follow up on the mailing list: http://groups.google.com/group/yi-devel
Some other pending tasks are described below.
=== Write access policy ===
One does not need write access to the repository to contribute. Use "darcs send"  to send your patches to the Yi development mailing list; someone else can apply them.
Write access can however be granted, with the following disclaimer:
* All people with write access can apply patches without prior approval. If one thinks a patch would be controversial, it might be a good idea to discuss it on the list though.
* Try to not break the build. (By Murphy's law, if you do so it will happen at the most annoying moment...) So, always try to build before pushing patches. Bypassing Darcs's test build to record a patch indicates you should further improve your patch.
* [[JeanPhilippeBernardy | I]] can at any time rollback a patch for whatever reason. This however should not upset the author of the patch. Most contributions are  welcome, so a patch revert normally would only mean that a detail or two need to be worked out. (eg. it breaks an important feature in some configuration, etc.)
== Yi ideas ==
This section is meant to gather ideas people have for Yi.
*Evolution to an IDE:
:Show  exact location of compilation errors: 80% of an haskell project
:Support for the ghci debugger & others: 10 % of an haskell project (Added bonus: greath for learning: trough the debugger, people learn the real execution flow of an haskell program. Better if this is done inside an editor)
:Integration of refactoring tools : 5 %
:Edition: only 5%
*An extension to GHCi to support documentation of symbols. 
:This seems to be (reasonably) straightforward, as GHCi already has :info.  It would mean hacking the type environment (what about values?) to add documentation information.  The main problem would seem to be populating this --- maybe hack haddock to produce something from the library docs?  I assume that using package GHC uses the parent RTS (package GHC seems to be the way to go, but more investigation is required --- don?)
*Views on data
:Rather than just editing a file, you would open a view onto the file, i.e. there is no longer a 1-1 correspondence between buffers and files.  Why?  Well, for aggregate buffers (i.e., editing multiple files in the one view), or for multiple views of a file (e.g. AST and source-level).  There would be some primitive ops for editing a buffer (insertChar, delete, etc.), which would then call update functions on anything observing that file.
*Remote attach so I can work from home, but still use a remote machine
:Like Emacs's server?
*Haddock documentation
:(no brainer), maybe associate with .hi files for binaries. 
*Maybe a class <code>YiShow</code>, which all config items must be a member of?  This is to emulate describe-variable
*Support for collaborative editing. This would be very good for #haskell work, and the text editor Gobby and its [http://gobby.0x539.de/trac/wiki/ObbyProtocol Obby protocol] seem to provide a candidate way of doing things.
=== Borrowing from other editors ===
Take some ideas from emacs, some from vi, but don't stick them all together without a single core philosophy. Otherwise, you'll end up with an editor that looks like it was thrown together. Some people come from an emacs background, some from vi, some from elsewhere, and ALL of them will want yi to behave like their regular editor. The best way to do this is to have a single person make all the decisions on behaviour.
==== Emacs ====
Coming from an Emacs background, I think a few things are essential,
mainly the introspection capabilities of Emacs.
===== Emacs goodness =====
The following are things I like about Emacs, as an extensible
environment, and miss in Yi:
; Really good online documentation
: Emacs can tell you a lot about a function or variable with a keypress--- the current value, where it is declared, and a hypertext formation string
; Hooks-Extensibility
: All (good) apps allow users to extend, through, e.g., hooks --- a list of functions that are run before/after some event (like saving a file)
===== Emacs badness =====
So, why replace it?:
; ELisp
: Dynamically scoped, Dynamically typed, ugly, old.  'Nuff said
; What's a Parser?
: A lot of apps in emacs do stuff with text, usually text that is in some language.  There is no standard parser (like, e.g. parsec), so a lot of it is ugly handwritten spaghetti.  This also means that adding analysis tools isn't really done (or done nicely).
; ELisp again
: Haskell is a lot cleaner to write, especially because of the large number of libraries.
(See also [http://www.emacswiki.org/cgi-bin/wiki/WhyDoesElispSuck WhyDoesElispSuck] on the Emacs wiki.)
===== Emacs maybeness (?) =====
Some things that are sometimes bad, sometimes good:
; Everything is a buffer
: Makes some sense, but sometimes doesn't.  It is nice to have uniform key bindings do the right thing (e.g., C-Space sets the mark, and the region can then be used, e.g. to delete a sequence of emails in Wl) Sometimes, however, you just want some sort of GUI widget.
: OTOH, having the minibuffer be a special kind of buffer is a good idea.
; Properties
: It is possible to associate arbitrary properties with symbols.  This means you can annotate a symbol and then use that information at a later date
==== Vi? ====
; good things
: modal key editing -> configuration system is powerful enough!
: light weight - fast startup -> yi has this :)
=== Ideas ===
=== Implementation ===
; Interface to the runtime
: The scheduler, docs, etc.
; Introspection of e.g. what processes are running.
: There are already libraries in Haskell for processes, but they don't give Yi any extra information --- we really want a layer on top. 
== Trivia ==
Y I is the most recursive acronym. (Read it as combinators).
義, pronounced yi, means righteousness, one of the five virtues of confucianism.

Latest revision as of 17:29, 28 June 2016



Yi is a text editor written in Haskell and extensible in Haskell.

External links