[Haskell-cafe] Editor
Claus Reinke
claus.reinke at talk21.com
Mon May 21 09:20:14 EDT 2007
>I have a dream. It's not a little dream. It's a big dream. I have a
>dream that someday I can find a UNIX/Linux text editor for Haskell
>hacking (and possibly two or three hundred other programming languages,
>although that's optional) that can give me all of the following:
'find / -type dream | xargs rm' is not a good way to go about that
that search, is it?-) by excluding the editors that fullfill most of your
criteria, without any good reason, you're guaranteed to come up
empty. "i have a dream that there is an answer to life the universe
and everything, and it isn't 42"?
you might not like the answer most people give, but there is a reason
why that answer is so popular. of course, just because it is one valid
answer, it need not be the right answer for you. you just need to be
specific about why that particular answer doesn't suit you.
> 1. A real GUI environment that takes into account some of the HID
> advances made in the past 30 years. (Emacs and Vim don't count,
> in other words.)
be specific, please! emacs and vim are often the first to integrate
and experiment with whatever new ideas come into view (some even
originated there). only few of those experiments find enough followers
to make it into the main distributions, though. whatever it is you're
missing, if you can't even name it, it can't be good enough reason to
discard either emacs or vim).
in my experience, most people complain about vim or emacs because
they aren't aware of what these can do. it is not just that there is so much
functionality and variation available that one has to invest time to learn
even parts of that, one new feature a day. it is that much of what people
don't like is deliberately not fixed, but configurable.
some people don't like the complexity of emacs interactions, and
prefer vim's brief and efficient modes&key-strokes, some don't like
vim modes and prefer emacs-style commands, some prefer plain
text, some prefer gui, some ... you might prefer either vim or emacs,
but you shouldn't complain about anything that you can configure
yourself (such as modes vs long commands, gui vs text, os-style
or vim-style copy&paste, colours and specifics of syntax highlighting,
available menus, and so on).
vim has a good integrated manual, and tutorials, but if i want that
much functionality, i have to learn about it, and spend a lot of time
in that documentation. the more my personal needs deviate from
default settings, the more i have to learn and configure; the more
specific functionality i need the more i have to delve into the details
of what is available. if i don't want to learn how to use such powers,
i have to make do with a less powerful, out-of-the-box environment.
some people are happy with textpad, but i know nobody who has
studied all of current vim or emacs. most users start out with the
textpad equivalent of functionality in vim or emacs, then add to their
knowledge and toolbox as and when they need to do so.
looking at your requirements, for vim, to the extent i know it:
> 2. Good quality syntax highlighting for Haskell that includes all
> of the usual syntax highlighting goodies, plus:
yes
> * the ability to seamlessly handle raw Haskell and both
> common forms of Literate Haskell;
i stopped using literate haskell long ago, so i can't really say.
(i always wanted literate haskell _sessions_, not programs, with
definitions, redefinitions, evaluations, explanations, but all with a
quite different structure than is useful for the programs being
explored/described in such a session)
> * the ability to properly highlight Haddock comments;
seem to be highlighted only as comments, by default, but you could
change that, if you really wanted to. if the change looks useful, it
should make it into the next vim release - that's how the current haskell
highlighting got there and keeps developing.
> * the ability to highlight functions and types from
> libraries (user-expandable) differently from local
> functions and types.
that sounds potentially useful, and some of the information is
available (my vim settings have tables of local and library definitions
for completion). however, vim doesn't know about haskell scopes,
so the easiest solution would be unaware of renaming/hiding/etc.
> 3. Line folding to hide and show blocks of code.
yes, along with other folding modes
> 4. Code completion (user-expandable, ideally) for common library
> functions, type declarations, etc.
several completions, including two user-expandable ones. in my setup,
completion can be based on source, tag files, haddock indices, ghci
:browse,..
> 5. Easy, quick access to online documentation for said functions
> and declarations.
yes. open your favourite browser on the haddocks for the id under cursor.
> 6. Good (ideally scriptable) access to external utilities for
> compilation, debugging, profiling, type inference, project
> management, etc.
yes, and several scripting languages to choose from. quickfix mode is
there, the ghci debugger is not yet supported because it is too new, i
haven't seen profiling support, but i can ask for type and info for the id
under cursor, create tags files, jump to definitions, search in imports,..;
since it is all scriptable, ghc's api support is rapidly developing, and
other haskell implementation provide apis, too, its all up to haskellers
to start linking the two in whatever way they like (most haskellers only
have to do the linking for their editor, if there is functionality missing,
just tell the api developers - they really like to know).
> 7. A good plug-in system (ideally written in Haskell?) for
> expansion.
if you just want to run haskell functions over parts of your text, use
'<range>!ghc -e my_function MyLib.hs', and map each such function
to some key or menu entry; apparently, vim could also run code from
dynamically loaded libraries, but when i last looked into that, it wasn't
easy to produce such on all platforms, from haskell, with ghc.
if you you just want to control your editor from haskell, vim is
remote-scriptable (we used that in the vim interface to HaRe). or
emacs can communicate with an asynchronous haskell subprocess
(we used that in the emacs interface to HaRe).
8. oh, and of course, you forgot many requirements, such as side-by-side
diff views, same functionality on other os platforms, and other
miscellanea.
>Is there such a beast available out there somewhere? If not, is such a
>beast lurking in the background ready to pounce in the near future?
no, no. such things can't exist, i'm sure;-) just keep emacs and vim out
of the house, and no editing beast will interfere with your dreams (beware
the ides, though, they're catching up, too!-)
http://www.haskell.org/haskellwiki/Applications_and_libraries/Program_development#Editor_support
http://www.haskell.org/haskell-mode/
http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/
claus
ps. no, vim is not perfect!-)
More information about the Haskell-Cafe
mailing list