
EclipseFP 0.10 has been released since last Friday. It is an open-source development environment for Haskell code. EclipseFP integrates GHC with an Haskell-aware code editor and also supports quick file browsing through an outline view, automatic building/compiling and quick one-button code execution. For this new release we have been working on code assistance support, something that has been heavily requested, and a Cabal editor. Downloads and more information are available on the project home page http://eclipsefp.sourceforge.net/ This release requires Eclipse 3.2, as opposed to Eclipse 3.1 that was required on the previous release. You may need to upgrade your Eclipse platform if you plan to use version 0.10. I have taken the liberty to create a wiki page for EclipseFP. You can post your comments and feature requests there, if you'd like. It is located at http://www.haskell.org/haskellwiki/EclipseFP Cheers, Thiago Arrais

Hello Thiago, Saturday, July 1, 2006, 7:56:48 PM, you wrote:
For this new release we have been working on code assistance support, something that has been heavily requested, and a Cabal editor.
can you please describe that "code assistance" means? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat,
On 7/2/06, Bulat Ziganshin
can you please describe that "code assistance" means?
You may know it as code completion, completion assistance or code suggestion. It is a much used feature on IDEs: just type your code, hit a special key combination and the program will be able to guess what you mean depending on the context and suggest some options for you. You could try with EclipseFP, just hit Ctrl-Space. Regards, Thiago Arrais

Hello Thiago, Monday, July 3, 2006, 5:52:06 AM, you wrote:
can you please describe that "code assistance" means? You may know it as code completion, completion assistance or code
thanks
You could try with EclipseFP, just hit Ctrl-Space.
i still downloading Eclipse in order to try your plugin. You've asked about features we want to see in the IDE. Here's my own list, more or less in priorities order: - background compilation with errors highlighting - integration with WinHugs - syntax highlighting, including highlighting of bracket's pair - ability to "fall in" definition of identifier under cursor, including multi-level ability to return back (with support for base libraries, libraries i installed and current project) - fast access to help about identifier - auto-deriving of type signatures for global identifiers (adding signatures, that compiler will infer, to the source file) - automatic management of import lists - one-key inclusion/exclusion of items in module export list - project management based on Cabal file - auto-indenting with user-tuned style Are you use GHC library? In the paper "Visual Haskell: A full-featured Haskell development environment" http://www.haskell.org/~simonmar/papers/vshaskell.pdf Simon Marlow described how this library can be used to enhance Haskell support in IDE -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat,
Thanks for the suggestions (by the way, very good article on IO). Some
comments below.
On 7/3/06, Bulat Ziganshin
- background compilation with errors highlighting
There is already some support for background compilation using GHC. Error highlighting doesn't still work as I'd like to, but is there too.
- syntax highlighting, including highlighting of bracket's pair
There is already some of this too, although it may not be exactly what you have in mind.
- ability to "fall in" definition of identifier under cursor
Being worked on. Should be one of the leading features on the next release, together with some more code completion.
- automatic management of import lists
Being worked on, together with code completion. I would like some more detail here, though.
- auto-indenting with user-tuned style
This one seems very challenging and interesting, not a must-have for me but a very attractive feature. I have purposely left some items behind, just because resources are limited and we need to focus on some more valuable features. Do you think the ones I selected are the most valuable ones? Would you mind to delve into some more detail on the topics above on the EclipseFP mailing list? I am particularly interested on these four (in order of priority): - ability to "fall in" definition of identifier under cursor - automatic management of import lists - syntax highlighting - auto-indenting with user-tuned style You can subscribe to our mailing list on http://lists.sourceforge.net/mailman/listinfo/eclipsefp-develop
Are you use GHC library?
Not yet, but it may turn to be a very wise decision to make in the future. EclipseFP is being written in Java, I wonder how the GHC library would be accessed on such a environment. Need to take a look at the paper. Cheers, Thiago Arrais

Thiago Arrais wrote:
Bulat,
Thanks for the suggestions (by the way, very good article on IO). Some comments below.
On 7/3/06, Bulat Ziganshin
wrote: - auto-indenting with user-tuned style
This one seems very challenging and interesting, not a must-have for me but a very attractive feature.
The haskell-mode in Emacs cycles through several logical indent levels as you keep pressing the Tab key. This tends to work for me, but not every time. -- Chris

Hello Thiago, Monday, July 3, 2006, 4:18:01 PM, you wrote:
- background compilation with errors highlighting
There is already some support for background compilation using GHC. Error highlighting doesn't still work as I'd like to, but is there too.
now i'm using editor with just syntax highlighting and therefore i wrote about things those lacking are most important for me. first is the compilation. after i've compiled program i don't like to find files, go to specified line just because i'm not Ceasar and can't think about files/lines and program bugs simultaneously. why the error highlighting is a problem? GHC even supports -ferror-spans option in which emacs-style error message is printed (i.e. it includes the exact range of lines/chars what contain error) the next problem is slowness of GHC compilation. There are whole range of methods to deal with it: 1) background compilation, as you already implemented 2) fast "precompilation" with hugs and reporting bugs it encountered and then "true" compilation with ghc - of course, for this sort of scenario the program should be compatible with both compilers 3) "wide" compilation scheme - on first step compile all modules just searching for syntax errors (which should be much faster) and on the second step perform full compilation 4) using GHCi - it's a 2-3 times faster than GHC and moreover you will drop the startup time and the linking time. This also can be combined with GHC compilation - after module has been successfully compiled with GHCi and programmer continues to further develop his code, GHC can be invoked in background to recompile the modules and make them faster work / faster load in next GHCi session 5) using the GHC library to find simple errors just while editing so compilation in most cases will be successful this list contains all ideas i can recall. i personally like the last variant. of course, the compilation should still be performed in background, it just be called much less often and programmer will not wait for its completion. on the other side, for debugging, 4th variant will be more interesting i also mentioned tight integration with WinHugs. are you seen WinHugs 2006 version? are you able to see it? look at least at http://haskell.org/haskellwiki/WinHugs (Win)Hugs remains the fastest way to debug haskell programs and new WinHugs adds new pretty look and usability features to this story. one especially important one is ability to position editor just at the line containing error. It's already supported for Vim and i will be glad to see the same support for Eclipse. May be it just need adding instructions about setting up editor's call (for Vim it is "gvim.exe --remote-silent +%d %s") The almost complete support for WinHugs should include just two facilities: 1) save all, run modified files through the CPP, load module specified 2) same as above plus run the function specified (running modules through C preprocessor required because WinHugs can't preprocess modules and developing any serious program as compatible both with Hugs and GHC is impossible without conditional compilation)
- syntax highlighting, including highlighting of bracket's pair
There is already some of this too, although it may not be exactly what you have in mind.
i'm spoiled with vim-like one in FAR :)
- ability to "fall in" definition of identifier under cursor
Being worked on. Should be one of the leading features on the next release, together with some more code completion.
i does it on Vim, using modified hasktags (original one finds only functions with explicit signatures). if Eclipse supports 'tags' file, it should be relatively easy, at least for global identifiers (although field names and class methods will be out of luck in this case). what set of indexed identifiers you are plan to support?
- automatic management of import lists
Being worked on, together with code completion. I would like some more detail here, though.
if compiler complains about missing identifiers, the plugin should find module where it defined and add this module name (or this identifier if module already imported with just some identifiers) to import list. i personally keep import list splitted into two parts - global and local modules of current project, each list sorted alphabetically it will be also great to delete from import list unused modules/identifiers, but that is very low on my priority list
- auto-indenting with user-tuned style
This one seems very challenging and interesting, not a must-have for me but a very attractive feature.
You can start with indenting after lines with "special" words (such as if, when and so on). The catch is what in Haskell many "control structures" are finished on the same line they are started or just partially applied and passed as parameters to some other functions :) I personally want to see as "control structures" many functions i defined myself. It's also true for syntax highlighting - my current syntax file contains as "reserved words" the "return", "when", "forever", "block" and many other function names also i should mention that Emacs haskell mode, afaik, already does it. you can try to borrow their experience?
I have purposely left some items behind, just because resources are limited and we need to focus on some more valuable features. Do you think the ones I selected are the most valuable ones?
i tried to sort them in the importance order and for me the first 4 are most important (i often need them in my development process): - background compilation with errors highlighting - integration with WinHugs - syntax highlighting, including highlighting of bracket's pair - ability to "fall in" definition of identifier under cursor
Would you mind to delve into some more detail on the topics above on the EclipseFP mailing list? I am particularly interested on these four (in order of priority):
- ability to "fall in" definition of identifier under cursor - automatic management of import lists - syntax highlighting - auto-indenting with user-tuned style
i've said about everything except for syntax highlighting. there is no
much to say - editor i use has vim-like features, which means that
it's really great in this area. may be there is some Eclipse package
that does the same?
one feature i forgot to mention is code navigation. The structured
code navigation should, imho, include files in the project mirroring
the directory structure and on the next level each file should be
splitted to "sections". In the absence of classes splitting to
sections is widely used for the Haskell source files. For example, GHC
library sources contains the following section headings:
-- -----------------------------------------------------------------------------
-- Handy IOErrors
-- -----------------------------------------------------------------------------
-- Handle Finalizers
and so on. I personally adopted this headings style but it will be
great to just allow to use regexp to define it. And inside each
section one can see the identifiers it define
Another, unstructured view should just list all identifiers in project
and type in several chars from the identifier name to locate it in
list. It's an explanation of this very helpful feature:
my shell (FAR manager) saves all the
commands i use (now this list contains ~5000 ones!) and when i open
this list and start to type some word, it just filers whole list and
show only commands which contains this sequence of letters. that is
damn useful. just for example i open this window and typed "hugs" -
FAR filters out 146 commands which includes this word:
---------------------------- Commands history *[hugs](146/5144) --------------------------
t C:\Base\Compiler\Hugs\runhugs.exe +st.qkoOuI -98 nocmt.hs You can subscribe to our mailing list on
http://lists.sourceforge.net/mailman/listinfo/eclipsefp-develop done Are you use GHC library? Not yet, but it may turn to be a very wise decision to make in the
future. Simon said in his paper that many great features of Visual Haskell
would be impossible without GHC running in background EclipseFP is being written in Java, I wonder how the GHC
library would be accessed on such a environment. Need to take a look
at the paper. http://haskell.org/haskellwiki/InterfacingOtherLanguages#Java
--
Best regards,
Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat,
Thank you for the detailed responses. I apologize for not answering
before, I was waiting for a quieter time to be able to answer
properly.
On 7/3/06, Bulat Ziganshin
now i'm using editor with just syntax highlighting and therefore i wrote about things those lacking are most important for me. first is the compilation.
I agree with you, background compilation is the most important feature for me too. Therefore, I will try to work on this for the next release. I am looking for a Cabal-integrated build system and planning to delegate all the work (like dependency fetching and selective compilation) to the chosen build system instead of implementing it as part of EclipseFP. I think I will experiment with this approach. EclipseFP distributes live builds for every modification to the source code. Can I contact you when those builds start to be available? Would you mind trying them?
after i've compiled program i don't like to find files, go to specified line just because i'm not Ceasar and can't think about files/lines and program bugs simultaneously.
Not to mention that with an background compilation running frequently (at least more frequently that it would run if it was called manually), people tend to have fewer compilation errors to fix at a time. This should happen a lot on productivity (at least it helps me).
why the error highlighting is a problem? GHC even supports -ferror-spans option in which emacs-style error message is printed (i.e. it includes the exact range of lines/chars what contain error)
I will take a look at that. I don't actually know where our error-reporting problems come from because EclipseFP is a pretty old code base and I wasn't around when this was coded. But I do know that the current error highlighting isn't the best thing one would want. It certainly helps a lot, but it still isn't as precise as one would like. The background compilation and error highlighting issues are already enough work (and my message is getting quite long already). This doesn't mean the other issues are not valid, but we need to keep a focus here if we want to get anything done. So, I am snipping the rest of the message for the time being (and hoping those issues can be dealt with soon). Cheers, Thiago Arrais -- Mergulhando no Caos - http://thiagoarrais.blogspot.com Pensamentos, idéias e devaneios sobre desenvolvimento de software e tecnologia em geral

Are you use GHC library?
Not yet, but it may turn to be a very wise decision to make in the future. EclipseFP is being written in Java, I wonder how the GHC library would be accessed on such a environment. Need to take a look at the paper. I think the way to go is to call it via JNI. This has worked fine for me in the past on Windows with dlls, but not on Linux (because GHC did not yet support position-independent code at that time and I didn't manage to connect to a native library otherwise). Is this possible meanwhile?
Ciao, Leif
Cheers,
Thiago Arrais _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Leif,
On 7/3/06, Leif Frenzel
I think the way to go is to call it via JNI. This has worked fine for me in the past on Windows with dlls
Although it required quite some glue code written in C, and it did not look very pretty. Have you already taken a look at this thing here http://sourceforge.net/projects/jvm-bridge/ Seems like it will free us from writing much of the glue code. I will definetely experiment with the GHC library + JVM-Bridge, it seems very much promising. Has anyone actually tried something like that? Cheers, Thiago Arrais

I have managed to call Haskell from Java on Linux -- I had to manually invoke gcc for the linking step because ghc won't output a shared object. It was very ugly indeed, but I can show you what I did if it will help. jvm-bridge also seems more developed now than when I was doing this, so maybe that's easier. keegan Thiago Arrais wrote:
Leif,
On 7/3/06, Leif Frenzel
wrote: I think the way to go is to call it via JNI. This has worked fine for me in the past on Windows with dlls
Although it required quite some glue code written in C, and it did not look very pretty. Have you already taken a look at this thing here
http://sourceforge.net/projects/jvm-bridge/
Seems like it will free us from writing much of the glue code.
I will definetely experiment with the GHC library + JVM-Bridge, it seems very much promising. Has anyone actually tried something like that?
Cheers,
Thiago Arrais _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 7/3/06, Thiago Arrais
EclipseFP is being written in Java, I wonder how the GHC library would be accessed on such a environment.
The York Haskell Compiler (yhc) compiles to bytecode, and my memory suggests that there was an implementation of the required runtime system written in Java. My mail archive confirms this: Neil Mitchell wrote about it on haskell-cafe on March 28 under the topic of 'Haskell's Market'. My feeling is that such an approach might be a smoother (and more portable) integration than JNI. Of course, you'd need to be able compile GHC with YHC, which I cannot guess the feasability of. HTH, Maarten

Hi
The York Haskell Compiler (yhc) compiles to bytecode, and my memory suggests that there was an implementation of the required runtime system written in Java. My mail archive confirms this: Neil Mitchell wrote about it on haskell-cafe on March 28 under the topic of 'Haskell's Market'. It does indeed, but it would probably be faster to write a trivial C/Java wrapper round the C version of the runtime - still reasonably simple with Yhc. Yhc also compiles directly to .NET bytecodes, if the same was done with Java bytecodes it might be even easier than integrating an interpretter. Any way, there should be many ways to get Haskell, Yhc and Java all playing nicely.
My feeling is that such an approach might be a smoother (and more portable) integration than JNI. Of course, you'd need to be able compile GHC with YHC, which I cannot guess the feasability of. My guess is that would be very hard, I can only assume the GHC source code is far from Haskell 98. Maybe once Haskell' is done and Yhc supports that then you'll have more of a chance. It would probably be very good if Yhc could compile GHC then porting GHC would become trivial.
There is of course the option to integrate with the (still not started) Yhc API which will certainly compile with Yhc, rather than relying on GHC. Thanks Neil
participants (7)
-
Bulat Ziganshin
-
Chris Kuklewicz
-
Keegan McAllister
-
Leif Frenzel
-
Maarten Hazewinkel
-
Neil Mitchell
-
Thiago Arrais